本文整理汇总了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).