本文整理汇总了Python中rdflib.graph.ConjunctiveGraph.__str__方法的典型用法代码示例。如果您正苦于以下问题:Python ConjunctiveGraph.__str__方法的具体用法?Python ConjunctiveGraph.__str__怎么用?Python ConjunctiveGraph.__str__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rdflib.graph.ConjunctiveGraph
的用法示例。
在下文中一共展示了ConjunctiveGraph.__str__方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
# 需要导入模块: from rdflib.graph import ConjunctiveGraph [as 别名]
# 或者: from rdflib.graph.ConjunctiveGraph import __str__ [as 别名]
def setUp(self):
register('json-ld',
Parser,
'rdflib_jsonld.parser',
'JsonLDParser')
# self.graph = Graph()
self.proj_context_uri = 'http://127.0.0.1:8000/contexts/projects/3.json'
self.context_file = settings.STATIC_IMPORTS_ROOT + '3-context.json'
self.data_file = settings.STATIC_IMPORTS_ROOT + 'dt-bone.json'
self.context_str = self.request_json_str(self.proj_context_uri)
self.data_str = self.load_json_file_str(self.data_file)
g_context = ConjunctiveGraph(identifier=self.proj_context_uri)
g_context.parse(data=self.context_str, format='json-ld')
proj_graph_obj = URIRef(self.proj_context_uri)
print('N3: ' + str(g_context.__str__()))
for c in g_context.contexts():
print(str(c))
print('-------Triples for context-graph------')
self.test_type_linking(g_context)
g_data = ConjunctiveGraph().parse(data=self.data_str, format='json-ld')
print('-------Triples for data-record--------')
self.test_type_linking(g_data)