views:

154

answers:

1

Hi,
Regarding to my previous post, now when I'm testing, progFields in below:

System.Reflection.FieldInfo[] progFields = typeof(Program).GetFields();

returns nothing. My ontology about Program is like this:

<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;
     <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#ResourceAuthor"/&gt;
     <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;
     <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>
      <owl:Class rdf:about="http://www.owl-ontologies.com/Ontology1243411901.owl#Project"/&gt;
     </owl:disjointWith>

and at the end of file, it's collection is defined:

<owl:AllDifferent>
     <owl:distinctMembers rdf:parseType="Collection">
      <Program rdf:about="http://www.owl-ontologies.com/Ontology1243411901.owl#Information_Technology"/&gt;
      <Program rdf:about="http://www.owl-ontologies.com/Ontology1243411901.owl#Software"/&gt;
      <Program rdf:about="http://www.owl-ontologies.com/Ontology1243411901.owl#Management"/&gt;
      <Program rdf:about="http://www.owl-ontologies.com/Ontology1243411901.owl#Literature"/&gt;
     </owl:distinctMembers>
    </owl:AllDifferent>

The ontology has been made by Protege. Could you please help in situation

+2  A: 

You get zero fields because your Program class is not an enumerated OWL class.

Root issue is that your ontology expresses what Program is NOT, instead of saying what it IS. This is not wrong, just not what you want. I am a human, I can figure out what you wanted (namely that you have 4 and only 4 programs and they are all different), but your ontology does not say that. What your ontology says is as follows:

  • There are Programs.
  • If an individual happens to be a Program then it is surely not Student, Teacher, etc.
  • Programs always have atGrade property.
  • If they happen to be either IT, SW, Mgmt, or Literature, they are not the same.

But you could have many other individuals, not only IT, SW, Mgmt,and Literature. Hence ROWLEX justly does not expose Program class as an enum class.

ROWLEX will generate you static fields if make your Program class a true enumerated OWL class.

ROWLEX Admin