当前位置: 首页>>代码示例>>Python>>正文


Python Pump.original_graph方法代码示例

本文整理汇总了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)
开发者ID:ctsit,项目名称:vivo-pump,代码行数:10,代码来源:test_vivopump.py

示例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)
开发者ID:ctsit,项目名称:vivo-pump,代码行数:10,代码来源:test_vivopump.py

示例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
开发者ID:ctsit,项目名称:vivo-pump,代码行数:10,代码来源:test_vivopump.py

示例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)
开发者ID:ctsit,项目名称:vivo-pump,代码行数:10,代码来源:test_vivopump.py

示例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)
开发者ID:ctsit,项目名称:vivo-pump,代码行数:11,代码来源:test_vivopump.py

示例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)
开发者ID:ctsit,项目名称:vivo-pump,代码行数:11,代码来源:test_vivopump.py

示例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)
开发者ID:ctsit,项目名称:vivo-pump,代码行数:12,代码来源:test_vivopump.py

示例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)
开发者ID:ctsit,项目名称:vivo-pump,代码行数:12,代码来源:test_vivopump.py

示例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)
开发者ID:ctsit,项目名称:vivo-pump,代码行数:12,代码来源:test_vivopump.py

示例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)
开发者ID:ctsit,项目名称:vivo-pump,代码行数:13,代码来源:test_vivopump.py

示例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)
开发者ID:ctsit,项目名称:vivo-pump,代码行数:13,代码来源:test_vivopump.py

示例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)
开发者ID:ctsit,项目名称:vivo-pump,代码行数:13,代码来源:test_vivopump.py

示例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)
开发者ID:ctsit,项目名称:vivo-pump,代码行数:13,代码来源:test_vivopump.py

示例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)
开发者ID:ctsit,项目名称:vivo-pump,代码行数:13,代码来源:test_vivopump.py

示例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)
开发者ID:ctsit,项目名称:vivo-pump,代码行数:13,代码来源:test_vivopump.py


注:本文中的pump.pump.Pump.original_graph方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。