3
votes

I'm learning about ontologies and the Protege tool. I created a basic ontology of 3 classes A, B and C.

I use Equivalence property to state that class A is equivalent to class B. Class B is equivalent to class C. Then I use the reasoner (Pellet) to determined class A is equivalent to class C.

This transitive relationship works perfectly in Protege. I can see in yellow that class A is equivalent to class C and vice-versa.

I want to export this inferred axiom from Protege tool. I go to "File -> Export Inferred Axioms as Ontology" and select all options on the first screen and do not select any option on the second screen. Finally, I save the file as OWL in RDF/XML syntax.

Now when I open this new file, I do not see any triple regarding the inferred axiom, i.e. class A is equivalent to class C. In fact, it is the exact same ontology as my original ontology.

I don't know what I'm missing. I also tried to import the exported file into my original ontology through the "active ontology tab" of Protege and then did "File -> Export Inferred Axioms as Ontology" but still the output file does not contain the inferred triple. When loaded in Protege and with reasoner, the inference works but I want Protege to export this inference in OWL file.

Is it possible? I've spent many hours on this and have looked around on the Internet but have not found any solution. Am I missing a step?

BTW, I used latest Protege version 5.2 and have also tried version 4.3 to see if there is a bug but the result has been the same.

Thanks

The ontology I use is this one.


///////////////////////////////////////////////////////////////////////////////////////
//
// Classes
//
///////////////////////////////////////////////////////////////////////////////////////





<!-- http://www.semanticweb.org/sesa388470/ontologies/2017/9/23/untitled-ontology-110#A -->

<owl:Class rdf:about="http://www.semanticweb.org/sesa388470/ontologies/2017/9/23/untitled-ontology-110#A">
    <owl:equivalentClass rdf:resource="http://www.semanticweb.org/sesa388470/ontologies/2017/9/23/untitled-ontology-110#B"/>
</owl:Class>

<!-- http://www.semanticweb.org/sesa388470/ontologies/2017/9/23/untitled-ontology-110#B -->

<owl:Class rdf:about="http://www.semanticweb.org/sesa388470/ontologies/2017/9/23/untitled-ontology-110#B">
    <owl:equivalentClass rdf:resource="http://www.semanticweb.org/sesa388470/ontologies/2017/9/23/untitled-ontology-110#C"/>
</owl:Class>

<!-- http://www.semanticweb.org/sesa388470/ontologies/2017/9/23/untitled-ontology-110#C -->

<owl:Class rdf:about="http://www.semanticweb.org/sesa388470/ontologies/2017/9/23/untitled-ontology-110#C"/>


UPDATE 1: If I select OWL/XML as ontology format in the last step of "File -> Export Inferred Axioms as Ontology" I can see the following in the resulting ontology file.

<Declaration>
    <Class IRI="#A"/>
</Declaration>
<Declaration>
    <Class IRI="#C"/>
</Declaration>
<Declaration>
    <Class IRI="#B"/>
</Declaration>
<EquivalentClasses>
    <Class IRI="#A"/>
    <Class IRI="#B"/>
    <Class IRI="#C"/>
</EquivalentClasses>

Previously I was exporting ontology in RDF/XML format. At least I can see that A, B and C are equivalent classes. Maybe it is RDF vs OWL issue?

UPDATE 2: I've received the following reply on Protege Dev list. It seems that the inferred axioms are not saved in RDF/XML format by design.

"OWL RDF/XML syntax does not support n-ary constructors like equivalent classes because everything should be represented using triplets (because of RDF). In your example, the inferred axiom EquivalentClasses(A B C) is serialised in RDF [1] (see Table 1) to

A owl:equivalentClass B .

B owl:equivalentClass C .

Other formats, like OWL/XML or OWL Functional-style syntax support n-ary axioms. This is in accordance to what you observe.

Also, on the related note, please take into account that the inferred axiom generator does not save all inferred axioms that is produced by the reasoner. For example, if your ontology has axioms A subClassOf B and B subClassOf C then the inferred axiom A subClassOf C will not be saved as it follows from other (inferred) axioms A subClassOf B and B subClassOf C. Only non-redundant inferred axioms (that do not follow from other inferred axioms) are saved. This is because that there can be way too many inferred axioms."

[1] https://www.w3.org/TR/owl2-mapping-to-rdf/#Translation_of_Axioms_without_Annotations

1
Works for me as expected. Can you share the ontology? Are you sure that there was no exception during reasoning (is there a red error indicator at the top right)?UninformedUser
@AKSW, I've updated the question with ontology. There is not exception. The Pellet reasoner works fine without any exception.binaryGuy
Now, I understand what you mean. You expect to see an equivalent class axiom between A and C in the exported ontology ,right?UninformedUser
Yes, this is what I want to see in resulting OWL file.binaryGuy
-> Protege mailing list. You could link to the issue here such they can answer here as well.UninformedUser

1 Answers

1
votes

I understand what you mean. You expect to see an equivalent class axiom between A and C in the exported ontology, right?

I can reproduce it. It looks like the Protege editor is assuming it to be already an asserted axiom. At least, when I open the ontology again, the editor renders it as such in the class hierarchy tree:

Input ontology:

@prefix : <http://www.semanticweb.org/user/ontologies/2017/9/untitled-ontology-3#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@base <http://www.semanticweb.org/user/ontologies/2017/9/untitled-ontology-3> .

<http://www.semanticweb.org/user/ontologies/2017/9/untitled-ontology-3> rdf:type owl:Ontology .

#################################################################
#    Classes
#################################################################

###  http://www.semanticweb.org/user/ontologies/2017/9/untitled-ontology-3#A
:A rdf:type owl:Class ;
   owl:equivalentClass :B .


###  http://www.semanticweb.org/user/ontologies/2017/9/untitled-ontology-3#B
:B rdf:type owl:Class ;
   owl:equivalentClass :C .


###  http://www.semanticweb.org/user/ontologies/2017/9/untitled-ontology-3#C
:C rdf:type owl:Class .


###  Generated by the OWL API (version 4.2.8.20170104-2310) https://github.com/owlcs/owlapi

After exporting the inferred axioms and re-opening in Protege:

enter image description here

It might either be a bug, or the expected behavior. You should ask on the Protege mailing list first.