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


Python ParamManager.encode_to_rdf_uri方法代码示例

本文整理汇总了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__)
开发者ID:abretaud,项目名称:askomics,代码行数:34,代码来源:AbstractedRelation.py

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

示例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%%%%!!!"
开发者ID:ofilangi,项目名称:askomics,代码行数:5,代码来源:ParamManager_test.py

示例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%%%%!!!"
开发者ID:ofilangi,项目名称:askomics,代码行数:5,代码来源:ParamManager_test.py

示例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"
开发者ID:askomics,项目名称:askomics,代码行数:5,代码来源:ParamManager_test.py

示例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__)
开发者ID:ofilangi,项目名称:askomics,代码行数:7,代码来源:AbstractedEntity.py


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