2013-02-28 113 views
1

我需要将我的RDF图形文档转换为Protege 3.x识别的OWL(1或2)。有一个用于映射OWL 2 Web Ontology Language Mapping to RDF Graphs的W3C推荐标准,其中说要从RDF图声明对象属性,应该添加rdf:type owl:ObjectProperty元素。我已经发现了下面的代码表达具有RDF图形式化OWL对象属性的问题:如何将RDF图形属性转换为OWL对象属性?

<rdf:Property rdf:about="&uni;isTaughtBy"> 
     <rdf:type rdf:resource="&owl;ObjectProperty"/> 
     <rdfs:domain rdf:resource="&uni;Course"/> 
     <rdfs:range rdf:resource="&uni;Proffessor"/> 
</rdf:Property> 

用下面指定的名称空间:

xmlns:uni="http://www.mydomain.org/uni-ns#" 
xmlns:owl="http://www.w3.org/2002/07/owl#" 

不幸的是,上上述代码不被识别,因此示出在Protege 3.x IDE中。

回答

1

以下代码可由Protege 4(推荐版本)读取。复制粘贴块,并将其保存在一个新的文件,你应该再能够与门徒来阅读:

<?xml version="1.0"?> 
<!DOCTYPE rdf:RDF [ 
    <!ENTITY owl "http://www.w3.org/2002/07/owl#" > 
    <!ENTITY uni-ns "http://www.mydomain.org/uni-ns#" > 
    <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" > 
    <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" > 
    <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" > 
]> 
<rdf:RDF xmlns="http://www.mydomain.org/uni-ns#" 
xml:base="http://www.mydomain.org/uni-ns" 
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" 
xmlns:uni-ns="http://www.mydomain.org/uni-ns#" 
xmlns:owl="http://www.w3.org/2002/07/owl#" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema#" 
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> 
<owl:Ontology rdf:about="http://www.mydomain.org/uni-ns#"/> 
<owl:ObjectProperty rdf:about="&uni-ns;isTaughtBy"> 
    <rdfs:domain rdf:resource="&uni-ns;Course"/> 
    <rdfs:range rdf:resource="&uni-ns;Professor"/> 
</owl:ObjectProperty> 
<owl:Class rdf:about="&uni-ns;Course"/> 
<owl:Class rdf:about="&uni-ns;Professor"> 
    <rdfs:subClassOf rdf:resource="&owl;Thing"/> 
</owl:Class> 
</rdf:RDF> 
+0

我需要RDF图码在门徒环境来表示,因为它是由生产[D2R服务器] (http://d2rq.org/),它不支持OWL代码生成。顺便说一句,我的意图是将SQL映射到OWL。但是生成的OWL代码必须在Protege 3.x中受支持。 – Edi 2013-03-02 12:03:39

+0

你可以用Protege 3读这个文件吗? – loopasam 2013-03-02 12:22:14

+0

是的,您的代码在Protege 3中读取。但是,我生成的代码不是通过OWL语法表达的,而是基于RDF。 – Edi 2013-03-03 21:15:35

相关问题