I have an object property partOf
which is transitive.
And I want to say that:
a partOf Year
thena
is aTerm
b partOf Term
thenb
is aCourse
And simultaneously:
a partOf Knowledge_Group
thena
is aKnowledge_Area
b partOf Knowledge_Area
thenb
is aCourse
For that I'm using this to say b partOf Term or Knowledge_Area
then b
is a Course
:
:Course rdf:type owl:Class ;
owl:equivalentClass [ rdf:type owl:Restriction ;
owl:onProperty :partOf ;
owl:someValuesFrom [ rdf:type owl:Class ;
owl:unionOf ( :Knowledge_Area
:Term
)
]
] .
But when I run the reasoner I get all the courses listed as instances of the class Term
and same for Knowledge_Area
:
If I don't use the or
and set that Course is equivalent only to partOf some Term
or partOf some Knowledge_Area
(separately and one at a time) I don't get this issue.
Is there a way I can say what I explained at the beginning and not get the courses inferred to be of type Term
?
Here there is a minimal example:
@prefix : <http://www.semanticweb.org/lucia/ontologies/2018/5/untitled-ontology-27#> .
@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/lucia/ontologies/2018/5/untitled-ontology-27> .
<http://www.semanticweb.org/lucia/ontologies/2018/5/untitled-ontology-27> rdf:type owl:Ontology .
#################################################################
# Object Properties
#################################################################
### http://www.semanticweb.org/lucia/ontologies/2018/5/untitled-ontology-27#partOf
:partOf rdf:type owl:ObjectProperty ,
owl:TransitiveProperty .
#################################################################
# Classes
#################################################################
### http://www.semanticweb.org/lucia/ontologies/2018/5/untitled-ontology-27#Course
:Course rdf:type owl:Class ;
owl:equivalentClass [ rdf:type owl:Restriction ;
owl:onProperty :partOf ;
owl:someValuesFrom [ rdf:type owl:Class ;
owl:unionOf ( :Knowledge_Area
:Term
)
]
] .
### http://www.semanticweb.org/lucia/ontologies/2018/5/untitled-ontology-27#Knowledge_Area
:Knowledge_Area rdf:type owl:Class ;
owl:equivalentClass [ rdf:type owl:Restriction ;
owl:onProperty :partOf ;
owl:someValuesFrom :Knowledge_Group
] .
### http://www.semanticweb.org/lucia/ontologies/2018/5/untitled-ontology-27#Knowledge_Group
:Knowledge_Group rdf:type owl:Class ;
owl:disjointWith :Year .
### http://www.semanticweb.org/lucia/ontologies/2018/5/untitled-ontology-27#Term
:Term rdf:type owl:Class ;
owl:equivalentClass [ rdf:type owl:Restriction ;
owl:onProperty :partOf ;
owl:someValuesFrom :Year
] .
### http://www.semanticweb.org/lucia/ontologies/2018/5/untitled-ontology-27#Year
:Year rdf:type owl:Class .
#################################################################
# Individuals
#################################################################
### http://www.semanticweb.org/lucia/ontologies/2018/5/untitled-ontology-27#Course_1
:Course_1 rdf:type owl:NamedIndividual ;
:partOf :Knowledge_Area_1 ,
:Term_1 .
### http://www.semanticweb.org/lucia/ontologies/2018/5/untitled-ontology-27#Knowledge_Area_1
:Knowledge_Area_1 rdf:type owl:NamedIndividual ;
:partOf :Knowledge_Group_1 .
### http://www.semanticweb.org/lucia/ontologies/2018/5/untitled-ontology-27#Knowledge_Group_1
:Knowledge_Group_1 rdf:type owl:NamedIndividual ,
:Knowledge_Group .
### http://www.semanticweb.org/lucia/ontologies/2018/5/untitled-ontology-27#Term_1
:Term_1 rdf:type owl:NamedIndividual ;
:partOf :Year_1 .
### http://www.semanticweb.org/lucia/ontologies/2018/5/untitled-ontology-27#Year_1
:Year_1 rdf:type owl:NamedIndividual ,
:Year .
### Generated by the OWL API (version 4.2.8.20170104-2310) https://github.com/owlcs/owlapi