本文整理汇总了Python中pump.pump.Pump.original_graph方法的典型用法代码示例。如果您正苦于以下问题:Python Pump.original_graph方法的具体用法?Python Pump.original_graph怎么用?Python Pump.original_graph使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pump.pump.Pump
的用法示例。
在下文中一共展示了Pump.original_graph方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_large_case
# 需要导入模块: from pump.pump import Pump [as 别名]
# 或者: from pump.pump.Pump import original_graph [as 别名]
def test_large_case(self):
from testgraph import TestGraph
p = Pump("data/person_def.json")
p.original_graph = TestGraph()
p.update_data = {1: {u'uri': u'http://vivo.school.edu/individual/n25674',
u'action': u'REMOVE'}}
[add, sub] = p.update()
self.assertTrue(len(add) == 0 and len(sub) == 8)
示例2: test_not_found
# 需要导入模块: from pump.pump import Pump [as 别名]
# 或者: from pump.pump.Pump import original_graph [as 别名]
def test_not_found(self):
from rdflib import Graph
p = Pump("data/person_def.json")
p.original_graph = Graph() # empty graph
p.update_data = {1: {u'uri': u'http://vivo.school.edu/individual/n12345678',
u'action': u'Remove'}}
[add, sub] = p.update()
self.assertTrue(len(add) == 0 and len(sub) == 0)
示例3: test_summarize
# 需要导入模块: from pump.pump import Pump [as 别名]
# 或者: from pump.pump.Pump import original_graph [as 别名]
def test_summarize(self):
from testgraph import TestGraph
p = Pump("data/person_def.json")
p.original_graph = TestGraph()
print p.update_def
p.update_data = {1: {u'uri': u'http://vivo.school.edu/individual/n1723097935',
u'any1': u'1'}}
print p.summarize() # No exception thrown by summarize
示例4: test_single_uri_case
# 需要导入模块: from pump.pump import Pump [as 别名]
# 或者: from pump.pump.Pump import original_graph [as 别名]
def test_single_uri_case(self):
from testgraph import TestGraph
p = Pump("data/person_def.json")
p.original_graph = TestGraph()
p.update_data = {1: {u'uri': u'http://vivo.school.edu/individual/n2084211328',
u'action': u'Remove'}}
[add, sub] = p.update()
self.assertTrue(len(add) == 0 and len(sub) == 1)
示例5: test_add_one_new_to_two
# 需要导入模块: from pump.pump import Pump [as 别名]
# 或者: from pump.pump.Pump import original_graph [as 别名]
def test_add_one_new_to_two(self):
from testgraph import TestGraph
p = Pump("data/grant_pi_def.json")
p.original_graph = TestGraph()
p.update_data = {1: {u'uri': u'http://vivo.school.edu/individual/n45',
u'pis': u'http://vivo.school.edu/individual/n1134'}}
[add, sub] = p.update()
self.assertTrue(
len(add) == 3 and len(sub) == 6)
示例6: test_none_to_empty
# 需要导入模块: from pump.pump import Pump [as 别名]
# 或者: from pump.pump.Pump import original_graph [as 别名]
def test_none_to_empty(self):
from testgraph import TestGraph
p = Pump("data/grant_pi_def.json")
p.original_graph = TestGraph()
p.update_data = {1: {u'uri': u'http://vivo.school.edu/individual/n44',
u'pis': u'None'}}
[add, sub] = p.update()
self.assertTrue(
len(add) == 0 and len(sub) == 0)
示例7: test_inject_empty_original_graph
# 需要导入模块: from pump.pump import Pump [as 别名]
# 或者: from pump.pump.Pump import original_graph [as 别名]
def test_inject_empty_original_graph(self):
from rdflib import Graph, URIRef
p = Pump()
p.original_graph = Graph()
p.update_data = {1: {u'uri': u'http://vivo.school.edu/individual/n8984374104', u'abbreviation': u'None'}}
[add, sub] = p.update()
self.assertTrue(
len(add) == 1 and len(sub) == 0 and (None,
URIRef("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),
URIRef("http://vivoweb.org/ontology/core#Building")) in add)
示例8: test_no_secondary_merge
# 需要导入模块: from pump.pump import Pump [as 别名]
# 或者: from pump.pump.Pump import original_graph [as 别名]
def test_no_secondary_merge(self):
from testgraph import TestGraph
p = Pump("data/person_def.json")
p.original_graph = TestGraph()
p.update_data = {3: {u'uri': u'http://vivo.school.edu/individual/n710', u'action': u''},
4: {u'uri': u'http://vivo.school.edu/individual/n1723097935', u'action': u'a'},
7: {u'uri': u'http://vivo.school.edu/individual/n711', u'action': u'a'},
}
[add, sub] = p.update()
self.assertTrue(len(add) == 0 and len(sub) == 0)
示例9: test_unique_three_delete_not_found
# 需要导入模块: from pump.pump import Pump [as 别名]
# 或者: from pump.pump.Pump import original_graph [as 别名]
def test_unique_three_delete_not_found(self):
from testgraph import TestGraph
# Delete the zip code from an existing address that doesn't have a zip code.
p = Pump("data/org_def.json")
p.original_graph = TestGraph()
p.update_data = {1: {u'uri': u'http://vivo.school.edu/individual/n3535', u'zip': u'None'}}
[add, sub] = p.update()
self.assertTrue(len(add) == 0 and len(sub) == 0)
示例10: test_change_without_lang
# 需要导入模块: from pump.pump import Pump [as 别名]
# 或者: from pump.pump.Pump import original_graph [as 别名]
def test_change_without_lang(self):
from rdflib import URIRef, Literal
from testgraph import TestGraph
p = Pump("data/org_def.json")
p.update_data = {1: {u'uri': u'http://vivo.school.edu/individual/n2525', u'name': u'Ad ver tising'}}
p.original_graph = TestGraph()
[add, sub] = p.update()
self.assertTrue(
len(add) == 1 and len(sub) == 1 and (URIRef("http://vivo.school.edu/individual/n2525"),
URIRef("http://www.w3.org/2000/01/rdf-schema#label"),
Literal("Ad ver tising")) in add)
示例11: test_add_without_datatype
# 需要导入模块: from pump.pump import Pump [as 别名]
# 或者: from pump.pump.Pump import original_graph [as 别名]
def test_add_without_datatype(self):
from rdflib import URIRef, Literal
from testgraph import TestGraph
p = Pump("data/building_def.json")
p.update_data = {1: {u'uri': u'http://vivo.school.edu/individual/n1001011525', u'url': u'http://a'}}
p.original_graph = TestGraph()
[add, sub] = p.update()
self.assertTrue(
len(add) == 4 and len(sub) == 0 and (None,
URIRef("http://vivoweb.org/ontology/core#linkURI"),
Literal("http://a")) in add)
示例12: test_change_with_datatype
# 需要导入模块: from pump.pump import Pump [as 别名]
# 或者: from pump.pump.Pump import original_graph [as 别名]
def test_change_with_datatype(self):
from rdflib import URIRef, Literal, XSD
from testgraph import TestGraph
p = Pump("data/building_def.json")
p.update_data = {1: {u'uri': u'http://vivo.school.edu/individual/n1001011525', u'abbreviation': u'PH9'}}
p.original_graph = TestGraph()
[add, sub] = p.update()
self.assertTrue(
len(add) == 1 and len(sub) == 1 and (URIRef("http://vivo.school.edu/individual/n1001011525"),
URIRef("http://vivoweb.org/ontology/core#abbreviation"),
Literal("PH9", datatype=XSD.string)) in add)
示例13: test_delete_unicode
# 需要导入模块: from pump.pump import Pump [as 别名]
# 或者: from pump.pump.Pump import original_graph [as 别名]
def test_delete_unicode(self):
from rdflib import URIRef, Literal
from testgraph import TestGraph
p = Pump("data/person_def.json")
p.update_data = {1: {u'uri': u'http://vivo.school.edu/individual/n711', u'name': u'None'}}
p.original_graph = TestGraph()
[add, sub] = p.update()
self.assertTrue(
len(add) == 0 and len(sub) == 1 and (URIRef("http://vivo.school.edu/individual/n711"),
URIRef("http://www.w3.org/2000/01/rdf-schema#label"),
Literal("Ελληνικά")) in sub)
示例14: test_uri_not_found
# 需要导入模块: from pump.pump import Pump [as 别名]
# 或者: from pump.pump.Pump import original_graph [as 别名]
def test_uri_not_found(self):
from testgraph import TestGraph
# Use the URI when not found
p = Pump("data/person_def.json")
p.update_data = {1: {u'uri': u'http://vivo.school.edu/individual/n1723097936',
u'types': u'fac;person'}}
p.original_graph = TestGraph()
[add, sub] = p.update()
self.assertTrue(len(add) == 2 and len(sub) == 0)
示例15: test_uri_is_blank
# 需要导入模块: from pump.pump import Pump [as 别名]
# 或者: from pump.pump.Pump import original_graph [as 别名]
def test_uri_is_blank(self):
from testgraph import TestGraph
# Use the URI when not found
p = Pump("data/person_def.json")
p.update_data = {1: {u'uri': u' ',
u'types': u'fac;person'}}
p.original_graph = TestGraph()
[add, sub] = p.update()
self.assertTrue(len(add) == 2 and len(sub) == 0)