Protégé本体论中的开放世界假设

时间:2015-03-25 16:01:41

标签: owl ontology protege protege4

我想在Protege中模拟电影系列的概念。

这是我的电影三部曲课程: Trilogy Class

以下是班级中个人的定义'电影系列': Film Series Individual

个人有三个拥有剧集'属性。 但是,开放世界的假设(OWA)阻止了这个人在“三部曲”课程中被推断出来。

可能的解决方案: 我可以给Film Series类中的每个人一个数据属性,指定系列中的电影数量。

但是,我更愿意使用' hasEpisode'对象属性(因为它们已经可用,这意味着更少的维护)。

1 个答案:

答案 0 :(得分:6)

你需要做的只是声明这三部电影不一样,并断言这些是该系列的三部电影。你可以说这些剧集都是不同的:

Episode1≠Episode2
Episode1≠Episode3
第2集≠第3集

并且三部曲只有 那些剧集:

{theTriology}⊑∀hasEpisode。{Episode1,Episode2,Episode3}

你需要两种类型的公理。普遍的公理说,系列的每一集都必须是第1集,第2集或第3集。这意味着该系列最多只有三个三集,但如果其中任何一个实际上是相同的话,它可能会更少。然后不平等说这些人都是截然不同的,这意味着该系列实际上至少有三集。由于至少三个且最多三个,因此它必须完全三个。

这就是Protege中的样子(注意 TheMatrix 被推断为三部曲):

screenshot from protege

这是本体论,如果你想看看:

@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>