I want to model the concept of a movie series in Protege.
Here's my movie trilogy class:
Here is the definition of an individual in the class 'Film Series':
The individual has three 'hasEpisode' properties. But the open world assumption (OWA) prevents this individual to be inferred under the class 'Trilogy'.
Possible solution: I could give each individual in the Film Series class a data property that specifies the amount of movies in the series.
However, I would rather like to use the number of 'hasEpisode' object properties (because they are already available and it would mean less maintenance).
All you need to do is declare that those three films are not the same, and assert that those are the only three films that the series has. You can do that by saying that the episodes are all different:
Episode1 ≠ Episode2
Episode1 ≠ Episode3
Episode2 ≠ Episode3
and that the triology has only those episodes:
{theTriology} ⊑ ∀ hasEpisode.{Episode1, Episode2, Episode3}
You need both types of axioms. The universal axiom says that every episode of the series must be either episode1, episode2, or episode3. That means that the series has at most three episodes, but it could have fewer, if any of those individuals are actually the same. Then the inequalities say that those individuals are all distinct, which means that the series actually has at least three episodes. Since it has at least three and at most three, it must have exactly three.
Here's what it looks like in Protege (note that TheMatrix is inferred to be a Trilogy):
Here's the ontology, in case you want to take a look:
@prefix : <http://www.semanticweb.org/taylorj/ontologies/2015/2/untitled-ontology-38#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix untitled-ontology-38: <http://www.semanticweb.org/taylorj/ontologies/2015/2/untitled-ontology-38#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
untitled-ontology-38:Triology
a owl:Class ;
owl:equivalentClass [ a owl:Class ;
owl:intersectionOf ( untitled-ontology-38:FilmSeries _:b0 )
] .
untitled-ontology-38:FilmSeries
a owl:Class .
_:b0 a owl:Restriction ;
owl:cardinality "3"^^xsd:nonNegativeInteger ;
owl:onProperty untitled-ontology-38:hasEpisode .
untitled-ontology-38:hasEpisode
a owl:ObjectProperty .
<http://www.semanticweb.org/taylorj/ontologies/2015/2/untitled-ontology-38>
a owl:Ontology .
untitled-ontology-38:TheMatrixRevolution
a owl:Thing , owl:NamedIndividual .
untitled-ontology-38:TheMatrixReloaded
a owl:Thing , owl:NamedIndividual .
untitled-ontology-38:TheMatrix
a owl:Thing , owl:NamedIndividual .
[ a owl:AllDifferent ;
owl:distinctMembers ( untitled-ontology-38:TheMatrix untitled-ontology-38:TheMatrixReloaded untitled-ontology-38:TheMatrixRevolution )
] .
untitled-ontology-38:Matrix
a owl:NamedIndividual , untitled-ontology-38:FilmSeries ;
a [ a owl:Restriction ;
owl:allValuesFrom [ a owl:Class ;
owl:oneOf ( untitled-ontology-38:TheMatrixReloaded untitled-ontology-38:TheMatrix untitled-ontology-38:TheMatrixRevolution )
] ;
owl:onProperty untitled-ontology-38:hasEpisode
] ;
untitled-ontology-38:hasEpisode
untitled-ontology-38:TheMatrix , untitled-ontology-38:TheMatrixReloaded , untitled-ontology-38:TheMatrixRevolution .
<rdf:RDF
xmlns:untitled-ontology-38="http://www.semanticweb.org/taylorj/ontologies/2015/2/untitled-ontology-38#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#">
<owl:Ontology rdf:about="http://www.semanticweb.org/taylorj/ontologies/2015/2/untitled-ontology-38"/>
<owl:Class rdf:about="http://www.semanticweb.org/taylorj/ontologies/2015/2/untitled-ontology-38#FilmSeries"/>
<owl:Class rdf:about="http://www.semanticweb.org/taylorj/ontologies/2015/2/untitled-ontology-38#Triology">
<owl:equivalentClass>
<owl:Class>
<owl:intersectionOf rdf:parseType="Collection">
<owl:Class rdf:about="http://www.semanticweb.org/taylorj/ontologies/2015/2/untitled-ontology-38#FilmSeries"/>
<owl:Restriction>
<owl:onProperty>
<owl:ObjectProperty rdf:about="http://www.semanticweb.org/taylorj/ontologies/2015/2/untitled-ontology-38#hasEpisode"/>
</owl:onProperty>
<owl:cardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#nonNegativeInteger"
>3</owl:cardinality>
</owl:Restriction>
</owl:intersectionOf>
</owl:Class>
</owl:equivalentClass>
</owl:Class>
<owl:NamedIndividual rdf:about="http://www.semanticweb.org/taylorj/ontologies/2015/2/untitled-ontology-38#Matrix">
<rdf:type rdf:resource="http://www.semanticweb.org/taylorj/ontologies/2015/2/untitled-ontology-38#FilmSeries"/>
<rdf:type>
<owl:Restriction>
<owl:onProperty rdf:resource="http://www.semanticweb.org/taylorj/ontologies/2015/2/untitled-ontology-38#hasEpisode"/>
<owl:allValuesFrom>
<owl:Class>
<owl:oneOf rdf:parseType="Collection">
<owl:Thing rdf:about="http://www.semanticweb.org/taylorj/ontologies/2015/2/untitled-ontology-38#TheMatrixReloaded">
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
</owl:Thing>
<owl:Thing rdf:about="http://www.semanticweb.org/taylorj/ontologies/2015/2/untitled-ontology-38#TheMatrix">
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
</owl:Thing>
<owl:Thing rdf:about="http://www.semanticweb.org/taylorj/ontologies/2015/2/untitled-ontology-38#TheMatrixRevolution">
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
</owl:Thing>
</owl:oneOf>
</owl:Class>
</owl:allValuesFrom>
</owl:Restriction>
</rdf:type>
<untitled-ontology-38:hasEpisode rdf:resource="http://www.semanticweb.org/taylorj/ontologies/2015/2/untitled-ontology-38#TheMatrix"/>
<untitled-ontology-38:hasEpisode rdf:resource="http://www.semanticweb.org/taylorj/ontologies/2015/2/untitled-ontology-38#TheMatrixReloaded"/>
<untitled-ontology-38:hasEpisode rdf:resource="http://www.semanticweb.org/taylorj/ontologies/2015/2/untitled-ontology-38#TheMatrixRevolution"/>
</owl:NamedIndividual>
<owl:AllDifferent>
<owl:distinctMembers rdf:parseType="Collection">
<owl:Thing rdf:about="http://www.semanticweb.org/taylorj/ontologies/2015/2/untitled-ontology-38#TheMatrix"/>
<owl:Thing rdf:about="http://www.semanticweb.org/taylorj/ontologies/2015/2/untitled-ontology-38#TheMatrixReloaded"/>
<owl:Thing rdf:about="http://www.semanticweb.org/taylorj/ontologies/2015/2/untitled-ontology-38#TheMatrixRevolution"/>
</owl:distinctMembers>
</owl:AllDifferent>
</rdf:RDF>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With