本文整理汇总了Python中prov.model.ProvBundle.get_flattened方法的典型用法代码示例。如果您正苦于以下问题:Python ProvBundle.get_flattened方法的具体用法?Python ProvBundle.get_flattened怎么用?Python ProvBundle.get_flattened使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类prov.model.ProvBundle
的用法示例。
在下文中一共展示了ProvBundle.get_flattened方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_non_unifiable_document
# 需要导入模块: from prov.model import ProvBundle [as 别名]
# 或者: from prov.model.ProvBundle import get_flattened [as 别名]
def test_non_unifiable_document(self):
g = ProvBundle()
g.add_namespace("ex", "http://www.example.com/")
g.activity('ex:compose', other_attributes={'prov:role': "ex:dataToCompose1"})
g.used('ex:compose', 'ex:testEntity')
with self.assertRaises(ProvExceptionCannotUnifyAttribute):
g.activity('ex:testEntity')
h = g.bundle('ex:bundle')
h.add_namespace("ex", "http://www.example.com/")
h.entity('ex:compose', other_attributes={'prov:label': "impossible!!!"})
with self.assertRaises(ProvExceptionCannotUnifyAttribute):
g.get_flattened()
示例2: test3
# 需要导入模块: from prov.model import ProvBundle [as 别名]
# 或者: from prov.model.ProvBundle import get_flattened [as 别名]
def test3(self):
target = ProvBundle()
target.activity('ex:compose', other_attributes=(('prov:role', "ex:dataToCompose1"), ('prov:role', "ex:dataToCompose2")))
result = ProvBundle()
result.activity('ex:compose', other_attributes={'prov:role': "ex:dataToCompose1"})
result_inner = ProvBundle(identifier="ex:bundle1")
result_inner.activity('ex:compose', other_attributes=(('prov:role', "ex:dataToCompose1"), ('prov:role', "ex:dataToCompose2")))
result.add_bundle(result_inner)
self.assertEqual(result.get_flattened(), target)
示例3: test1
# 需要导入模块: from prov.model import ProvBundle [as 别名]
# 或者: from prov.model.ProvBundle import get_flattened [as 别名]
def test1(self):
target = ProvBundle()
target.activity('ex:correct', '2012-03-31T09:21:00', '2012-04-01T15:21:00')
result = ProvBundle()
result.activity('ex:correct', '2012-03-31T09:21:00')
result_inner = ProvBundle(identifier="ex:bundle1")
result_inner.activity('ex:correct', None, '2012-04-01T15:21:00')
result.add_bundle(result_inner)
self.assertEqual(result.get_flattened(), target)
示例4: test_inferred_retyping_in_flattened_documents
# 需要导入模块: from prov.model import ProvBundle [as 别名]
# 或者: from prov.model.ProvBundle import get_flattened [as 别名]
def test_inferred_retyping_in_flattened_documents(self):
g = ProvBundle()
g.add_namespace("ex", "http://www.example.com/")
g.wasGeneratedBy('ex:Bob', time='2012-05-25T11:15:00')
b1 = g.bundle('ex:bundle')
b1.agent('ex:Bob')
h = ProvBundle()
h.add_namespace("ex", "http://www.example.com/")
h.agent('ex:Bob')
h.wasGeneratedBy('ex:Bob', time='2012-05-25T11:15:00')
self.assertEqual(g.get_flattened(), h)