本文整理匯總了Python中Session.Session.do_metadata方法的典型用法代碼示例。如果您正苦於以下問題:Python Session.do_metadata方法的具體用法?Python Session.do_metadata怎麽用?Python Session.do_metadata使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Session.Session
的用法示例。
在下文中一共展示了Session.do_metadata方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: len
# 需要導入模塊: from Session import Session [as 別名]
# 或者: from Session.Session import do_metadata [as 別名]
type = ""
for txt in textLines:
if len(txt) > 0:
if txt[0] == "#" and txt.find("Description") > 0:
description = txt.replace(
"#", "").replace("Description:", "")
elif txt[0] == "#" and txt.find("Name") > 0:
name = txt.replace("#", "").replace("Name:", "")
elif txt[0] == "#" and txt.find("Type") > 0:
type = txt.replace("#", "").replace("Type:", "")
elif txt[0] == "#":
pass
else:
rule = rule + txt + "\n"
meta_key = rdf_session.do_metadata()
orderOfService.append([file_input, text, name, description, meta_key])
# Checks to make sure all the SPARQL rules are collected.
#
if Config.DEBUG > 0:
print "SPARQLer Rules Collected:"
for ob in orderOfService:
print(ob[0] + " : " + ob[1].replace("\n", "")
.replace(" ", "").replace("\t", ""))
currentObjs = rdf_session.store_sizes()[0]
# Execute each sparql rule over until the number of new objects
# doesn't change. Once the total of objects stabilises, then the
# loop breaks (as rules can inference each other).