當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。