views:

268

answers:

4

I am building an assembly from my OWL ontology, but when parsing ontology, it raises an error message at "datatype properties" where a type is declared and some values are given. I've written my ontology using Protege v3.4.

For example, one of the datatype properties that raises error is "Language" with the type "string" and values like "English & Farsi". The references are listed below, made by protege:

<rdf:RDF xml:base="http://www.owl-ontologies.com/Ontology1243411901.owl"
xmlns="http://www.owl-ontologies.com/Ontology1243411901.owl#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:protege="http://protege.stanford.edu/plugins/owl/protege#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:swrl="http://www.w3.org/2003/11/swrl#" 
xmlns:swrlb="http://www.w3.org/2003/11/swrlb#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" 
xmlns:xsp="http://www.owl-ontologies.com/2005/08/07/xsp.owl#"&gt;

And the "Language" property is mentioned below:

<owl:DatatypeProperty rdf:ID="language">
     <rdfs:range>
      <owl:DataRange>
       <owl:oneOf rdf:parseType="Resource">
        <rdf:rest rdf:parseType="Resource">
         <rdf:rest rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"/&gt;
         <rdf:first rdf:datatype="http://www.w3.org/2001/XMLSchema#string"&gt;Farsi&lt;/rdf:first&gt;
        </rdf:rest>
        <rdf:first rdf:datatype="http://www.w3.org/2001/XMLSchema#string"&gt;English&lt;/rdf:first&gt;
       </owl:oneOf>
      </owl:DataRange>
     </rdfs:range>
     <rdfs:domain>
      <owl:Class>
       <owl:unionOf rdf:parseType="Collection">
        <owl:Class rdf:about="#Teacher"/>
        <owl:Class rdf:about="#ClassOfCourse"/>
        <owl:Class rdf:about="#LearningResource"/>
        <owl:Class rdf:about="#Discussion"/>
        <owl:Class rdf:about="#Student"/>
       </owl:unionOf>
      </owl:Class>
     </rdfs:domain>
    </owl:DatatypeProperty>

I just add one ontology to OWLGrinder. This error is made when generating:

Assembly generation failed. 
OWL property 'http://www.owl-ontologies.com/Ontology1243411901.owl#language' has a range declaration that points to _:bnode10579059 but its definition is missing. 
Are you missing an ontology which declares this class?

The number in front of "_:bnode" changes each time I press the "Generate" button. By deleting the values from "Language" property, another error happens related to the next DataType property. It means that every DataType property that is defined (and have some values specified to it) is making error in OWLGrinder.

I was wondering if someone could guide me in handeling this error.

A: 

I've copy/pasted your ontology in http://www.mygrid.org.uk/OWL/Validator: it says that this ontology is (at least) not a OWL-lite ontology. It may be a problem for your Protege config ?

Pierre
Hello Pierre, Thank you very much for answering. I pasted my entire ontology in that validator site, and the site verified it as OWL-DL. Does OWLGrinder work just with OWL-Lite? Is there any other tool for making assembly from ontology?
Ehsan
+2  A: 

I'm not familiar with OWLGrinder, but you can try declaring a named class such as ExpectedLanguages (give your anonymous node a URI) and then use that as the range for your language predicate. An abbreviated example (in Turtle format):

:ExpectedLanguages
    a owl:DataRange ;
    owl:oneOf (
        "Farsi"^^xsd:string
        "English"^^xsd:string
    );
.

:languages
    rdfs:range :ExpectedLanguages ;
.

Your use of the OWL enumerated datatype requires that your code/parser/reasoner be OWL-DL compliant at a minimum.

The reason the _:bnodeXXX (blank node/anonymous node) has a new ID each time is because it is blank. However, for the purposes of identifying it within a RDF graph (model) in memory, an ID needs to be generated for each anonymous node when it is loaded so while the model is being analyzed each node (anonymous or named) can be uniquely identified so its incoming and outgoing references can be identified.

Phil M
Thank you very much Mr. Phil M. There is very much for me to learn from your answer.The problem is solved by creating one class for every datatype range.
Ehsan
+1  A: 

Currently ROWLEX OwlGrinder expects the range to be a literal or a regular class. I recommend to create a 'LanguageList' wrapper class that contains your enumeration inside assign that as a range. I did not test this, but I do expect it to work.

ROWLEX Admin
Thank you very much for the answer. The problem is solved by creating one class for every datatype range.
Ehsan
A: 

Intellidimension provides an SDK that can convert OWL-Lite, OWL-Full, or OWL-DL to .NET classes. You might want to take a look at that.

Sidenote
I think you are confusing the semantics of domain in your ontology. It appears that you are trying to say that "Language may only exist on Teacher, ClassOfCourse, LearningResource, Discussion, Student" when in fact you are saying "If language is used to describe an instance that instance can be inferred to be the UnionOf Teacher, ClassOfCourse, LearningResource, Discussion, and Student.". This is a common misinterpretation of the semantics of OWL as it feels like domain should be restricting a properties use when in fact that is not ever the function of OWL (schema/validation). OWL is used only to describe what should be inferred by usage, it does not prescribe usage.

Domain semantics described in OWL guide.

By using UnionOf in the domain of the language property you are saying that "Anything that is described using the language property is a Teacher, or a ClassOfCourse, or a LearningResource, or a Discussion, or a Student". I would argue that this is not typically meaningful.

UnionOf semantic described in OWL guide.

Range is similar in that if you define the range of a property to be of a specific type than it can be inferred that all literals/resources that are referred to by that property are of the type defined with the range declaration.

Range described in OWL guide.

spoon16