使用 OWL2 表示条件

Representing conditionality using OWL2

我正在构建一个 ontology 来 class 验证数据库中的记录。它将迭代数据库的更新版本。因此它需要考虑潜在的变化。

这是我的用例:

一个人服用了 3 剂 DrugA(每个事件表示为 drugA1 被 dose1Person 服用为 dose1,drugA2 被 dose2Person 服用为 dose2,依此类推)。 classes 和条件描述:

CompletePerson:如果此人已服用全部 3 剂 IncompletePerson:如果此人服用了第 1 剂 and/or 第 2 剂

如果我将 'Incomplete' class 表示为:

((dose1 or dose2) and (not dose3)),即使数据库记录显示我应该,我也没有得到 class 的推断个体。

这可能是因为开放世界假设。在ontology,我说一个人接受了某某剂量,而不是说这个人没有接受什么。

如果我为 class 创建这个公理:

dose1 or dose2

class 成为 CompletePerson 的超class(它又是 dose1Person、dose2Person 和 dose3Person 的子class)。我应该如何表示 IncompletePerson 的公理,以便它不会被推断为 CompletePerson 的超 class。

In the ontology, I say a person has received such and such dose, not what the person has not received.

这才是真正的问题所在。如果您不说出他们没有收到什么,那么您就没有办法知道他们没有收到给定的剂量。例如,如果我告诉你约翰服用了 dose1 和 dose2,但不告诉你他是否服用了 dose3,你无法知道 John 实际上是一个 CompletePerson 还是一个 IncompletePerson .

您需要做出断言,说明 John 拿走了哪些东西,还没有拿走哪些东西。例如,除了

约翰服用了第 1 剂。
约翰服用了第 2 剂。

你也会断言

约翰:(只服用了 {dose1 dose2})

那么,只要知道dose1≠dose3,dose2≠dose3,就可以推断John是一个不完整的人,因为John没有服用dose3。

现在,您将这个想法表述为条件“如果一个人服用了所有三剂,那么他们是一个完整的人",但我认为您真的希望它是定义性的,即等价物:"a person took all three doeses id and only if they are a CompletePerson"。你需要这种等价性,因为否则一个人可能会因为其他原因而变得完整,而你想排除这种可能性。

完成后,您可以说 Person 是 CompletePerson 和 IncompletePerson 的不相交并集。

这是具有 class 层次结构的 OWL ontology:

Person         (disjoint union of Incomplete and Complete)
  Incomplete   
  Complete == (took value dose1) and (took value dose2) and (took value dose3)

和个人:

John : Person, (took only {dose1, dose2}), took dose1, took dose2
Mary : Person, took dose1, dose2, dose3
dose1 : ≠ dose2, ≠ dose3
dose2 : ≠ dose1, ≠ dose3
dose3 : ≠ dose1, ≠ dose2

您将能够推断出玛丽是完整的而约翰是不完整的。

在Turtle连载中,您可以下载并在Protege中打开。

@prefix :      <http://www.semanticweb.org/user/ontologies/2016/2/untitled-ontology-58#> .
@prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix owl:   <http://www.w3.org/2002/07/owl#> .
@prefix xsd:   <http://www.w3.org/2001/XMLSchema#> .
@prefix untitled-ontology-58: <http://www.semanticweb.org/taylorj/ontologies/2016/2/untitled-ontology-58#> .
@prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .

_:b0    a               owl:Restriction ;
        owl:hasValue    untitled-ontology-58:dose2 ;
        owl:onProperty  untitled-ontology-58:took .

<http://www.semanticweb.org/taylorj/ontologies/2016/2/untitled-ontology-58>
        a       owl:Ontology .

[ a                    owl:AllDifferent ;
  owl:distinctMembers  ( untitled-ontology-58:dose1 untitled-ontology-58:dose2 untitled-ontology-58:dose3 )
] .

untitled-ontology-58:took
        a       owl:ObjectProperty .

untitled-ontology-58:Incomplete
        a                owl:Class ;
        rdfs:subClassOf  untitled-ontology-58:Person .

_:b1    a               owl:Restriction ;
        owl:hasValue    untitled-ontology-58:dose3 ;
        owl:onProperty  untitled-ontology-58:took .

untitled-ontology-58:dose3
        a       owl:Thing , owl:NamedIndividual .

untitled-ontology-58:Mary
        a                          owl:Thing , untitled-ontology-58:Person , owl:NamedIndividual ;
        untitled-ontology-58:took  untitled-ontology-58:dose1 , untitled-ontology-58:dose2 , untitled-ontology-58:dose3 .

untitled-ontology-58:Complete
        a                    owl:Class ;
        rdfs:subClassOf      untitled-ontology-58:Person ;
        owl:equivalentClass  [ a                   owl:Class ;
                               owl:intersectionOf  ( _:b2 _:b0 _:b1 )
                             ] .

untitled-ontology-58:Person
        a                    owl:Class ;
        owl:disjointUnionOf  ( untitled-ontology-58:Complete untitled-ontology-58:Incomplete ) .

untitled-ontology-58:dose2
        a       owl:Thing , owl:NamedIndividual .

untitled-ontology-58:John
        a                          owl:Thing , untitled-ontology-58:Person , owl:NamedIndividual ;
        a                          [ a                  owl:Restriction ;
                                     owl:allValuesFrom  [ a          owl:Class ;
                                                          owl:oneOf  ( untitled-ontology-58:dose2 untitled-ontology-58:dose1 )
                                                        ] ;
                                     owl:onProperty     untitled-ontology-58:took
                                   ] ;
        untitled-ontology-58:took  untitled-ontology-58:dose1 , untitled-ontology-58:dose2 .

_:b2    a               owl:Restriction ;
        owl:hasValue    untitled-ontology-58:dose1 ;
        owl:onProperty  untitled-ontology-58:took .

untitled-ontology-58:dose1
        a       owl:Thing , owl:NamedIndividual .

另请参阅

  • Representing if-then sentence using OWL?