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

reg*_*gie 4 owl ontology protege4 protege

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

这是我的电影三部曲课: 三部曲课

以下是"电影系列"中个人的定义: 电影系列个人

该人有三个'hasEpisode'属性.但是开放世界的假设(OWA)阻止了这个人在"三部曲"课程下被推断出来.

可能的解决方案:我可以为Film Series类中的每个人提供一个数据属性,用于指定系列中的电影数量.

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

Jos*_*lor 6

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

        Episode1≠Episode2
        Episode1≠Episode3
        Episode2≠Episode3

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

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

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

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

来自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 .
Run Code Online (Sandbox Code Playgroud)
<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>
Run Code Online (Sandbox Code Playgroud)