• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python pump.Pump类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中pump.pump.Pump的典型用法代码示例。如果您正苦于以下问题:Python Pump类的具体用法?Python Pump怎么用?Python Pump使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Pump类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_pump_get_default_filename

 def test_pump_get_default_filename(self):
     import os
     p = Pump("data/building_def.json")
     filename = p.out_filename
     p.get()
     self.assertTrue(os.path.isfile(filename))
     os.remove(filename)
开发者ID:ctsit,项目名称:vivo-pump,代码行数:7,代码来源:test_vivopump.py


示例2: test_large_case

 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,代码行数:8,代码来源:test_vivopump.py


示例3: test_not_found

 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,代码行数:8,代码来源:test_vivopump.py


示例4: test_summarize

 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,代码行数:8,代码来源:test_vivopump.py


示例5: test_single_uri_case

 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,代码行数:8,代码来源:test_vivopump.py


示例6: test_add_one_new_to_two

 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,代码行数:9,代码来源:test_vivopump.py


示例7: test_none_to_empty

 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,代码行数:9,代码来源:test_vivopump.py


示例8: test_inject_empty_original_graph

 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,代码行数:10,代码来源:test_vivopump.py


示例9: test_boolean_get

 def test_boolean_get(self):
     from pump.vivopump import read_csv
     p = Pump("data/faculty_boolean_def.json")
     p.get()
     data = read_csv('pump_data.txt', delimiter='\t')
     nfac = 0
     for row, vals in data.items():
         if vals['faculty'] == '1':
             nfac += 1
     self.assertEqual(5, nfac)
开发者ID:ctsit,项目名称:vivo-pump,代码行数:10,代码来源:test_vivopump.py


示例10: test_no_secondary_merge

 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,代码行数:10,代码来源:test_vivopump.py


示例11: test_unique_three_delete_not_found

    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,代码行数:10,代码来源:test_vivopump.py


示例12: test_add_without_datatype

 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,代码行数:11,代码来源:test_vivopump.py


示例13: test_change_with_datatype

 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,代码行数:11,代码来源:test_vivopump.py


示例14: test_delete_unicode

 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,代码行数:11,代码来源:test_vivopump.py


示例15: test_change_without_lang

 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,代码行数:11,代码来源:test_vivopump.py


示例16: test_uri_not_found

    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,代码行数:11,代码来源:test_vivopump.py


示例17: test_uri_is_blank

    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,代码行数:11,代码来源:test_vivopump.py


示例18: test_multiple_one_change_nothing

    def test_multiple_one_change_nothing(self):
        from testgraph import TestGraph

        #  Do nothing if the multiple values specified match those in VIVO

        p = Pump("data/person_def.json")
        p.update_data = {1: {u'uri': u'http://vivo.school.edu/individual/n1723097935',
                             u'types': u'fac;person'}}
        p.original_graph = TestGraph()
        [add, sub] = p.update()
        self.assertTrue(len(add) == 0 and len(sub) == 0)
开发者ID:ctsit,项目名称:vivo-pump,代码行数:11,代码来源:test_vivopump.py


示例19: test_multiple_one_delete

    def test_multiple_one_delete(self):
        from testgraph import TestGraph

        #  Empty the set of values

        p = Pump("data/person_def.json")
        p.original_graph = TestGraph()
        p.update_data = {1: {u'uri': u'http://vivo.school.edu/individual/n25674',
                             u'research_areas': u'None'}}
        [add, sub] = p.update()
        self.assertTrue(len(add) == 0 and len(sub) == 4)
开发者ID:ctsit,项目名称:vivo-pump,代码行数:11,代码来源:test_vivopump.py


示例20: test_unique_one_delete

 def test_unique_one_delete(self):
     from rdflib import URIRef, Literal, XSD
     from testgraph import TestGraph
     p = Pump()
     p.original_graph = TestGraph()
     p.update_data = {1: {u'uri': u'http://vivo.school.edu/individual/n1001011525', u'abbreviation': u'None'}}
     [add, sub] = p.update()
     self.assertTrue(
         len(add) == 0 and len(sub) == 1 and (URIRef("http://vivo.school.edu/individual/n1001011525"),
                                              URIRef("http://vivoweb.org/ontology/core#abbreviation"),
                                              Literal("JWRU", datatype=XSD.string)) in sub)
开发者ID:ctsit,项目名称:vivo-pump,代码行数:11,代码来源:test_vivopump.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python events.emit函数代码示例发布时间:2022-05-25
下一篇:
Python pump.parse_spec函数代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap