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


Python Vocab.niceName方法代码示例

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


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

示例1: testniceName_1foafmyprop

# 需要导入模块: from libvocab import Vocab [as 别名]
# 或者: from libvocab.Vocab import niceName [as 别名]
 def testniceName_1foafmyprop(self):
   """simple test of nicename for a known namespace (FOAF), unknown property"""
   foaf_spec = Vocab(dir=FOAFSNAPSHOTDIR, f=FOAFSNAPSHOT)
   u = 'http://xmlns.com/foaf/0.1/myprop'
   nn = foaf_spec.niceName(u)
   # print "nicename for ",u," is: ",nn
   self.failUnless(nn == 'foaf:myprop', "Didn't extract nicename. input is"+u+"output was"+nn)
开发者ID:foaf,项目名称:foaftown,代码行数:9,代码来源:run_tests.py

示例2: testniceName_3baduri

# 需要导入模块: from libvocab import Vocab [as 别名]
# 或者: from libvocab.Vocab import niceName [as 别名]
 def testniceName_3baduri(self):
   """niceName should return same string if passed a non-URI (but log a warning?)"""
   foaf_spec = Vocab(FOAFSNAPSHOTDIR,FOAFSNAPSHOT)
   foaf_spec.index()
   u = 'thisisnotauri'
   nn = foaf_spec.niceName(u)
   #  print "nicename for ",u," is: ",nn
   self.failUnless(nn == u, "niceName didn't return same string when given a non-URI")
开发者ID:foaf,项目名称:foaftown,代码行数:10,代码来源:run_tests.py

示例3: testniceName_3mystery

# 需要导入模块: from libvocab import Vocab [as 别名]
# 或者: from libvocab.Vocab import niceName [as 别名]
 def testniceName_3mystery(self):
   """simple test of nicename for an unknown namespace"""
   foaf_spec = Vocab(FOAFSNAPSHOTDIR,FOAFSNAPSHOT)
   foaf_spec.index()
   u = 'http:/example.com/mysteryns/myprop'
   nn = foaf_spec.niceName(u)
   # print "nicename for ",u," is: ",nn
   self.failUnless(nn == 'http:/example.com/mysteryns/:myprop', "Didn't extract verbose nicename")
开发者ID:foaf,项目名称:foaftown,代码行数:10,代码来源:run_tests.py

示例4: testniceName_2foafhomepage

# 需要导入模块: from libvocab import Vocab [as 别名]
# 或者: from libvocab.Vocab import niceName [as 别名]
 def testniceName_2foafhomepage(self):
   """simple test of nicename for a known namespace (FOAF), known property."""
   foaf_spec = Vocab(FOAFSNAPSHOTDIR,FOAFSNAPSHOT)
   foaf_spec.index()
   u = 'http://xmlns.com/foaf/0.1/homepage'
   nn = foaf_spec.niceName(u)
   # print "nicename for ",u," is: ",nn
   self.failUnless(nn == 'foaf:homepage', "Didn't extract nicename")
开发者ID:foaf,项目名称:foaftown,代码行数:10,代码来源:run_tests.py


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