views:

306

answers:

1

Hello,
I have some owl classes which have instances. These classes also have properties which have value for each instance. I've made my ontology by Protege3.4, and made c# library by Rowlex from them.
For example the class 'Program', has an instance of 'Software' and 'atGrade' property. Property value for this instance is 'PHD' (atGrade is an object property that maps domain to Grade class). This is the OWL:

<owl:Class rdf:about="http://www.owl-ontologies.com/Ontology1243411901.owl#Program"&gt;
 <rdfs:subClassOf rdf:resource="http://www.w3.org/2002/07/owl#Thing"/&gt;
 <owl:disjointWith rdf:resource="http://www.owl-ontologies.com/Ontology1243411901.owl#Student"/&gt;
 <owl:disjointWith rdf:resource="http://www.owl-ontologies.com/Ontology1243411901.owl#Teacher"/&gt;
 <owl:disjointWith rdf:resource="http://www.owl-ontologies.com/Ontology1243411901.owl#Rank"/&gt;
 <rdfs:subClassOf>
  <owl:Restriction>
   <owl:onProperty>
    <owl:ObjectProperty rdf:about="http://www.owl-ontologies.com/Ontology1243411901.owl#atGrade"/&gt;
   </owl:onProperty>
   <owl:allValuesFrom rdf:resource="http://www.owl-ontologies.com/Ontology1243411901.owl#Grade"/&gt;
  </owl:Restriction>
 </rdfs:subClassOf>
 <owl:disjointWith rdf:resource="http://www.owl-ontologies.com/Ontology1243411901.owl#Course"/&gt;
 <owl:disjointWith>
  <owl:Class rdf:about="http://www.owl-ontologies.com/Ontology1243411901.owl#LearningResource"/&gt;
 </owl:disjointWith>
 <owl:disjointWith rdf:resource="http://www.owl-ontologies.com/Ontology1243411901.owl#Note"/&gt;
 <owl:disjointWith rdf:resource="http://www.owl-ontologies.com/Ontology1243411901.owl#ClassOfCourse"/&gt;
 <owl:equivalentClass>
  <owl:Class>
   <owl:oneOf rdf:parseType="Collection">
    <Program rdf:about="http://www.owl-ontologies.com/Ontology1243411901.owl#Management"&gt;
     <atGrade rdf:resource="http://www.owl-ontologies.com/Ontology1243411901.owl#PHD"/&gt;
    </Program>
    <Program rdf:about="http://www.owl-ontologies.com/Ontology1243411901.owl#Literature"&gt;
     <atGrade rdf:resource="http://www.owl-ontologies.com/Ontology1243411901.owl#PHD"/&gt;
    </Program>
    <Program rdf:about="http://www.owl-ontologies.com/Ontology1243411901.owl#Software"&gt;
     <atGrade rdf:resource="http://www.owl-ontologies.com/Ontology1243411901.owl#MasterOfResearch"/&gt;
    </Program>
    <Program rdf:about="http://www.owl-ontologies.com/Ontology1243411901.owl#Information_Technology"&gt;
     <atGrade rdf:resource="http://www.owl-ontologies.com/Ontology1243411901.owl#MasterOfScience"/&gt;
    </Program>
   </owl:oneOf>
  </owl:Class>
 </owl:equivalentClass>
 <owl:disjointWith>
  <owl:Class rdf:about="http://www.owl-ontologies.com/Ontology1243411901.owl#Project"/&gt;
 </owl:disjointWith>
 <owl:disjointWith rdf:resource="http://www.owl-ontologies.com/Ontology1243411901.owl#Grade"/&gt;
 <owl:disjointWith rdf:resource="http://www.owl-ontologies.com/Ontology1243411901.owl#ResourceType"/&gt;
 <owl:disjointWith rdf:resource="http://www.owl-ontologies.com/Ontology1243411901.owl#Language"/&gt;
 <rdfs:comment xml:lang="en">Study branch in which the members are working (e.g. MBA)</rdfs:comment>
 <owl:disjointWith>
  <owl:Class rdf:about="http://www.owl-ontologies.com/Ontology1243411901.owl#Discussion"/&gt;
 </owl:disjointWith>
 <owl:disjointWith rdf:resource="http://www.owl-ontologies.com/Ontology1243411901.owl#Question"/&gt;
</owl:Class>

The atGrade property is also defined in the ontology:

<owl:ObjectProperty rdf:about="http://www.owl-ontologies.com/Ontology1243411901.owl#atGrade"&gt;
 <rdfs:range rdf:resource="http://www.owl-ontologies.com/Ontology1243411901.owl#Grade"/&gt;
 <rdfs:domain>
  <owl:Class>
   <owl:unionOf rdf:parseType="Collection">
    <owl:Class rdf:about="http://www.owl-ontologies.com/Ontology1243411901.owl#Program"/&gt;
    <owl:Class rdf:about="http://www.owl-ontologies.com/Ontology1243411901.owl#Teacher"/&gt;
    <owl:Class rdf:about="http://www.owl-ontologies.com/Ontology1243411901.owl#Project"/&gt;
    <owl:Class rdf:about="http://www.owl-ontologies.com/Ontology1243411901.owl#Course"/&gt;
    <owl:Class rdf:about="http://www.owl-ontologies.com/Ontology1243411901.owl#Student"/&gt;
   </owl:unionOf>
  </owl:Class>
 </rdfs:domain>
</owl:ObjectProperty>

Now when I make one of the instances in c#, for example:

Program prog = new Program("http://www.owl-ontologies.com/Ontology1243411901.owl#Management", new RdfDocument());

the atGrade property returns null. I did the followings, but the problem didn't solve:
-made a full class (new Program_(...))
-entered an existing RDF file: new program (uri,new RdfDocument(uri)).
-deleted the 'rdfs:subClassOf' tag from ontology.

Any ideas how this problem may solve?
Maybe I should delete the instances from ontology and insert them in a RDF, then retrieve them from there?

A: 

Hello Ehsan,

You prescribe in your ontology that what individuals comply to your Program class. An individual is "Program" if its URI is one of your enumerated ones and it has an appropriate atGrade property.

When you create your RdfDocument and create a new Program instance, all you are going to get is a triple like "myUri typeof Program". ROWLEX will not fill out the defaults and add the extra atGrade property as you expect. That is why you get null when you retrieve the property. You will need to add the atGrade property to the individuals, otherwise it is not even a valid Program instance.

ROWLEX Admin
Thank you very much. So I had a misunderstanding of ontologies and now it is reformed. Thanks again
Ehsan