本文整理汇总了Python中askomics.libaskomics.ParamManager.ParamManager.encode_to_rdf_uri方法的典型用法代码示例。如果您正苦于以下问题:Python ParamManager.encode_to_rdf_uri方法的具体用法?Python ParamManager.encode_to_rdf_uri怎么用?Python ParamManager.encode_to_rdf_uri使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类askomics.libaskomics.ParamManager.ParamManager
的用法示例。
在下文中一共展示了ParamManager.encode_to_rdf_uri方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from askomics.libaskomics.ParamManager import ParamManager [as 别名]
# 或者: from askomics.libaskomics.ParamManager.ParamManager import encode_to_rdf_uri [as 别名]
def __init__(self, relation_type, identifier, label, identifier_prefix,rdfs_domain, prefixDomain, rdfs_range, prefixRange):
type_range = identifier
idx = identifier.find("@")
if idx > 0:
uridi = identifier[0:idx]
else:
uridi = identifier
if label == "":
if idx > 0:
self.label = identifier[0:idx]
else:
self.label = identifier
else:
self.label = label
self.uri = ParamManager.encode_to_rdf_uri(uridi,prefix="askomics:")
self.rdfs_range = rdfs_range
if relation_type.startswith("entity"):
self.relation_type = "owl:ObjectProperty"
elif relation_type == "goterm":
self.relation_type = "owl:ObjectProperty"
self.rdfs_range = "owl:Class"
else:
self.relation_type = "owl:DatatypeProperty"
self.rdfs_domain = ParamManager.encode_to_rdf_uri(rdfs_domain,prefixDomain)
self.log = logging.getLogger(__name__)
示例2: test_encode_to_rdf_uri
# 需要导入模块: from askomics.libaskomics.ParamManager import ParamManager [as 别名]
# 或者: from askomics.libaskomics.ParamManager.ParamManager import encode_to_rdf_uri [as 别名]
def test_encode_to_rdf_uri(self):
r = ParamManager.encode_to_rdf_uri("A",prefix="http://helloworld/test/")
assert r == "<http://helloworld/test/A>"
r = ParamManager.encode_to_rdf_uri("A",prefix="<http://helloworld/test/>")
assert r == "<http://helloworld/test/A>"
r = ParamManager.encode_to_rdf_uri("A<A>A",prefix="<http://helloworld/test/>")
assert r == "<http://helloworld/test/A_s3_3CA_s3_3EA>"
示例3: test_decode_to_rdf_uri
# 需要导入模块: from askomics.libaskomics.ParamManager import ParamManager [as 别名]
# 或者: from askomics.libaskomics.ParamManager.ParamManager import encode_to_rdf_uri [as 别名]
def test_decode_to_rdf_uri(self):
r = ParamManager.encode_to_rdf_uri("@&###:::123%%%%!!!")
assert ParamManager.decode_to_rdf_uri(r) == "@&###:::123%%%%!!!"
示例4: test_encode_to_rdf_uri
# 需要导入模块: from askomics.libaskomics.ParamManager import ParamManager [as 别名]
# 或者: from askomics.libaskomics.ParamManager.ParamManager import encode_to_rdf_uri [as 别名]
def test_encode_to_rdf_uri(self):
r = ParamManager.encode_to_rdf_uri("@&###:::123%%%%!!!")
assert r != "@&###123%%%%!!!"
示例5: test_decode_to_rdf_uri
# 需要导入模块: from askomics.libaskomics.ParamManager import ParamManager [as 别名]
# 或者: from askomics.libaskomics.ParamManager.ParamManager import encode_to_rdf_uri [as 别名]
def test_decode_to_rdf_uri(self):
r = ParamManager.encode_to_rdf_uri("A",prefix="<http://helloworld/test/>")
assert ParamManager.decode_to_rdf_uri(r,prefix="http://helloworld/test/") == "A"
示例6: __init__
# 需要导入模块: from askomics.libaskomics.ParamManager import ParamManager [as 别名]
# 或者: from askomics.libaskomics.ParamManager.ParamManager import encode_to_rdf_uri [as 别名]
def __init__(self, identifier):
self.uri = ":" + ParamManager.encode_to_rdf_uri(identifier)
self.label = identifier
self.log = logging.getLogger(__name__)