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


Python Vocab.lookup方法代码示例

本文整理汇总了Python中libvocab.Vocab.lookup方法的典型用法代码示例。如果您正苦于以下问题:Python Vocab.lookup方法的具体用法?Python Vocab.lookup怎么用?Python Vocab.lookup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在libvocab.Vocab的用法示例。


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

示例1: test_label_for_foaf_workplaceHomepage

# 需要导入模块: from libvocab import Vocab [as 别名]
# 或者: from libvocab.Vocab import lookup [as 别名]
 def test_label_for_foaf_workplaceHomepage(self):
   """check we can get the label for foaf's workplaceHomepage property"""
   foaf_spec = Vocab(dir=FOAFSNAPSHOTDIR, f=FOAFSNAPSHOT,uri='http://xmlns.com/foaf/0.1/')
   foaf_spec.index()
   l = foaf_spec.lookup('http://xmlns.com/foaf/0.1/workplaceHomepage').label
   # print "Label for foaf workplaceHomepage is "+l
   self.assertEqual(l,"workplace homepage")
开发者ID:foaf,项目名称:foaftown,代码行数:9,代码来源:run_tests.py

示例2: test_label_for_foaf_Person

# 需要导入模块: from libvocab import Vocab [as 别名]
# 或者: from libvocab.Vocab import lookup [as 别名]
 def test_label_for_foaf_Person(self):
   """check we can get the label for foaf's Person class"""
   foaf_spec = Vocab(dir=FOAFSNAPSHOTDIR,f=FOAFSNAPSHOT, uri='http://xmlns.com/foaf/0.1/')
   foaf_spec.index()
   l = foaf_spec.lookup('http://xmlns.com/foaf/0.1/Person').label
   # print "Label for foaf Person is "+l
   self.assertEqual(l,"Person")
开发者ID:foaf,项目名称:foaftown,代码行数:9,代码来源:run_tests.py

示例3: test_lookup_Person

# 需要导入模块: from libvocab import Vocab [as 别名]
# 或者: from libvocab.Vocab import lookup [as 别名]
 def test_lookup_Person(self):
   """find a term given it's uri"""
   foaf_spec = Vocab(dir=FOAFSNAPSHOTDIR,f=FOAFSNAPSHOT, uri='http://xmlns.com/foaf/0.1/') 
   foaf_spec.index()
   p = foaf_spec.lookup('http://xmlns.com/foaf/0.1/Person')
   # print "lookup for Person: ",p
   self.assertNotEqual(p.uri,  None, "Couldn't find person class in FOAF")
开发者ID:foaf,项目名称:foaftown,代码行数:9,代码来源:run_tests.py

示例4: test_got_sioc

# 需要导入模块: from libvocab import Vocab [as 别名]
# 或者: from libvocab.Vocab import lookup [as 别名]
 def test_got_sioc(self):
   sioc_spec = Vocab(SIOCSNAPSHOTDIR,SIOCSNAPSHOT, uri = SIOC)
   sioc_spec.index()
   cr =  sioc_spec.lookup('http://rdfs.org/sioc/ns#creator_of')
开发者ID:foaf,项目名称:foaftown,代码行数:6,代码来源:run_tests.py

示例5: test_status_for_doap_Repository

# 需要导入模块: from libvocab import Vocab [as 别名]
# 或者: from libvocab.Vocab import lookup [as 别名]
 def test_status_for_doap_Repository(self):
   """check we can get the computed 'unknown' status for doap's Repository class"""
   doap_spec = Vocab(dir=DOAPSNAPSHOTDIR,f=DOAPSNAPSHOT, uri='http://usefulinc.com/ns/doap#')
   doap_spec.index()
   s = doap_spec.lookup('http://usefulinc.com/ns/doap#Repository').status
   self.assertEqual(s,"unknown", "if vs:term_status isn't used, we set t.status to 'unknown'")
开发者ID:foaf,项目名称:foaftown,代码行数:8,代码来源:run_tests.py

示例6: test_status_for_foaf_Person

# 需要导入模块: from libvocab import Vocab [as 别名]
# 或者: from libvocab.Vocab import lookup [as 别名]
 def test_status_for_foaf_Person(self):
   """check we can get the status for foaf's Person class"""
   foaf_spec = Vocab(dir=FOAFSNAPSHOTDIR,f=FOAFSNAPSHOT, uri='http://xmlns.com/foaf/0.1/')
   foaf_spec.index()
   s = foaf_spec.lookup('http://xmlns.com/foaf/0.1/Person').status
   self.assertEqual(s,"stable")
开发者ID:foaf,项目名称:foaftown,代码行数:8,代码来源:run_tests.py

示例7: test_label_for_sioc_Community

# 需要导入模块: from libvocab import Vocab [as 别名]
# 或者: from libvocab.Vocab import lookup [as 别名]
 def test_label_for_sioc_Community(self):
   """check we can get the label for sioc's Community class"""
   sioc_spec = Vocab(dir=SIOCSNAPSHOTDIR,f=SIOCSNAPSHOT, uri=SIOC)
   sioc_spec.index()
   l = sioc_spec.lookup(SIOC+'Community').label
   self.assertEqual(l,"Community")
开发者ID:foaf,项目名称:foaftown,代码行数:8,代码来源:run_tests.py

示例8: test_lookup_Wombat

# 需要导入模块: from libvocab import Vocab [as 别名]
# 或者: from libvocab.Vocab import lookup [as 别名]
 def test_lookup_Wombat(self):
   """fail to a bogus term given it's uri"""
   foaf_spec = Vocab(dir=FOAFSNAPSHOTDIR,f=FOAFSNAPSHOT, uri='http://xmlns.com/foaf/0.1/') 
   foaf_spec.index()
   p = foaf_spec.lookup('http://xmlns.com/foaf/0.1/Wombat') # No Wombats in FOAF yet.
   self.assertEqual(p,  None, "lookup for Wombat should return None")
开发者ID:foaf,项目名称:foaftown,代码行数:8,代码来源:run_tests.py


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