1

I need to convert my RDF graph document into OWL (1 or 2) recognized by Protege 3.x. There is a W3C Recommendation for mapping OWL 2 Web Ontology Language Mapping to RDF Graphs which says that to declare Object Properties from RDF graphs one should add the rdf:type owl:ObjectProperty element. I have found problems for expressing OWL object properties with RDF graph formalisms in the following code:

<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> 

With the following specified namespaces:

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

Unfortunately, the upper mentioned code is not recognized and thus shown in the Protege 3.x IDE.

Edi
  • 109
  • 11

1 Answers1

1

The following code is readable by Protege 4 (recommended version). Copy paste the block and save it in a new file, you should then be able to read it with Protege:

<?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>
loopasam
  • 3,027
  • 2
  • 21
  • 22
  • I need RDF graph code to be represented in Protege environment, because it is produced by [d2r server](http://d2rq.org/), which does not support OWL code generation. By the way, my intention is to map SQL to OWL. But the generated OWL code must be supported in Protege 3.x. – Edi Mar 02 '13 at 12:03
  • Yes your code is read in Protege 3. But my generated code is not expressed through OWL syntax, rather it is based on RDF. – Edi Mar 03 '13 at 21:15
  • the code is serialised in RDF/XML syntax, it doesn't get closer to RDF than that. – loopasam Mar 03 '13 at 23:42
  • The Protege 3.x supports your code which is OWL/XML not RDF/XML as is my code. So, I need to convert `` to the following `` – Edi Mar 04 '13 at 13:24