Protégé 中的开放世界假设 Ontology
Open World Assumption in Protégé Ontology
我想在 Protege 中模拟电影系列的概念。
这是我的电影三部曲class:
下面是class'Film Series'中个人的定义:
此人具有三个 'hasEpisode' 属性。
但是开放世界假设 (OWA) 阻止了这个人在 class 'Trilogy'.
下被推断出来
可能的解决方案:
我可以给电影系列 class 中的每个人一个数据 属性,指定系列中电影的数量。
但是,我更愿意使用 'hasEpisode' 对象属性的数量(因为它们已经可用并且意味着更少的维护)。
您需要做的就是声明这三部电影不同,并断言这些是该系列中仅有的 三部电影。你可以通过说剧集都不同来做到这一点:
第 1 集 ≠ 第 2 集
Episode1 ≠ Episode3
Episode2 ≠ Episode3
而且三部曲只有那些情节:
{theTriology} ⊑ ∀ hasEpisode.{Episode1, Episode2, Episode3}
你需要两种类型的公理。通用公理表示该系列的每一集都必须是第 1 集、第 2 集或第 3 集。这意味着该系列最多 三集,但如果其中任何一个人实际上是相同的,它可能会更少。然后不等式表示这些人都是不同的,这意味着该系列实际上有 至少 三集。因为它有至少三个和最多三个,所以它必须有正好三个。
这是它在 Protege 中的样子(注意 TheMatrix 被推断为三部曲):
这是ontology,如果你想看的话:
@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>
我想在 Protege 中模拟电影系列的概念。
这是我的电影三部曲class:
下面是class'Film Series'中个人的定义:
此人具有三个 'hasEpisode' 属性。 但是开放世界假设 (OWA) 阻止了这个人在 class 'Trilogy'.
下被推断出来可能的解决方案: 我可以给电影系列 class 中的每个人一个数据 属性,指定系列中电影的数量。
但是,我更愿意使用 'hasEpisode' 对象属性的数量(因为它们已经可用并且意味着更少的维护)。
您需要做的就是声明这三部电影不同,并断言这些是该系列中仅有的 三部电影。你可以通过说剧集都不同来做到这一点:
第 1 集 ≠ 第 2 集
Episode1 ≠ Episode3
Episode2 ≠ Episode3
而且三部曲只有那些情节:
{theTriology} ⊑ ∀ hasEpisode.{Episode1, Episode2, Episode3}
你需要两种类型的公理。通用公理表示该系列的每一集都必须是第 1 集、第 2 集或第 3 集。这意味着该系列最多 三集,但如果其中任何一个人实际上是相同的,它可能会更少。然后不等式表示这些人都是不同的,这意味着该系列实际上有 至少 三集。因为它有至少三个和最多三个,所以它必须有正好三个。
这是它在 Protege 中的样子(注意 TheMatrix 被推断为三部曲):
这是ontology,如果你想看的话:
@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>