Rdf Protege/Turtle/OWL难以使具体化语句的对象属性正常工作

Rdf Protege/Turtle/OWL难以使具体化语句的对象属性正常工作,rdf,owl,protege,rdfs,turtle-rdf,Rdf,Owl,Protege,Rdfs,Turtle Rdf,假设我想代表比尔每周锻炼一次。随着我越来越熟悉在owl中构建本体并在turtle中制定它们,我想探索在owl中表示这一点的各种方法。我很乐意听到其他的表达方式,但这里是我想要的: ActivityType是一个类 练习是该类的一个实例 比尔是人类(a类)的一个实例,他进行锻炼活动 然后,我想把比尔的表现定义为每周发生一次 为此,我创建了一个频率类和一个名为OnceAWeek的实例 然后我想具体化比尔的练习,并将具体化的猫头鹰句子与每周一次的频率联系起来 下面是我如何尝试的(我将省略一些上层本体的

假设我想代表比尔每周锻炼一次。随着我越来越熟悉在owl中构建本体并在turtle中制定它们,我想探索在owl中表示这一点的各种方法。我很乐意听到其他的表达方式,但这里是我想要的:

  • ActivityType是一个类
  • 练习是该类的一个实例
  • 比尔是人类(a类)的一个实例,他进行锻炼活动
  • 然后,我想把比尔的表现定义为每周发生一次
  • 为此,我创建了一个频率类和一个名为OnceAWeek的实例
  • 然后我想具体化比尔的练习,并将具体化的猫头鹰句子与每周一次的频率联系起来
  • 下面是我如何尝试的(我将省略一些上层本体的东西,但这不应该是任何问题所在):

    问题是:当我这样做时,我无法通过在Protege中查看这个来验证我是否添加了预期的知识。我可以验证我是否创建/具体化了正确的公理,因为我可以潜入“rdfs:label”之类的东西,比如“他一周做一次”,它对断言进行注释,并且在我在Protege中打开.owl文件时可见。但是我找不到一种方法来验证我是否对(Bill performsActivityType练习)句子提出了:performsWithFrequency声明

    帮忙


    (同样,我们也欢迎大家提出更好的方法来实现这种代表性,不过如果可能的话,我仍然想学习如何处理这一点)。

    啊。我想我看到了问题所在。我需要使:performsWithFrequency成为owl:AnnotationProperty,而不是owl:ObjectProperty。一旦我做出改变,事情就会如预期的那样进行


    不过,我很欣赏大家对这种方法的进一步想法。或者,如果我误解了对象属性和注释属性在这里的工作方式。

    当您设计本体时,根据您想要做出的推论进行思考通常是有帮助的。在您的案例中,假设我们希望能够根据人们的活动水平对他们进行分类。我们可以做到以下几点:

    :hasExerciseFrequency rdf:type owl:DatatypeProperty ;
                          rdfs:range xsd:integer .
    
    :HighlyActivePerson rdf:type owl:Class ;
                        owl:equivalentClass [ rdf:type owl:Restriction ;
                                              owl:onProperty :hasExerciseFrequency ;
                                              owl:someValuesFrom [ rdf:type rdfs:Datatype ;
                                                                   owl:onDatatype xsd:integer ;
                                                                   owl:withRestrictions ( [ xsd:minInclusive 7
                                                                                          ]
                                                                                        )
                                                                 ]
                                            ] ;
                        rdfs:subClassOf :Person .
    
    
    :ModeratelyActivePerson rdf:type owl:Class ;
                            owl:equivalentClass [ rdf:type owl:Restriction ;
                                                  owl:onProperty :hasExerciseFrequency ;
                                                  owl:someValuesFrom [ rdf:type rdfs:Datatype ;
                                                                       owl:onDatatype xsd:integer ;
                                                                       owl:withRestrictions ( [ xsd:minInclusive 3
                                                                                              ]
                                                                                              [ xsd:maxInclusive 6
                                                                                              ]
                                                                                            )
                                                                     ]
                                                ] ;
                            rdfs:subClassOf :Person .
    
    :Person rdf:type owl:Class ;
            owl:equivalentClass [ rdf:type owl:Restriction ;
                                  owl:onProperty :hasExerciseFrequency ;
                                  owl:someValuesFrom xsd:integer
                                ] .
    
    :SedentaryPerson rdf:type owl:Class ;
                     owl:equivalentClass [ rdf:type owl:Restriction ;
                                           owl:onProperty :hasExerciseFrequency ;
                                           owl:someValuesFrom [ rdf:type rdfs:Datatype ;
                                                                owl:onDatatype xsd:integer ;
                                                                owl:withRestrictions ( [ xsd:maxInclusive 0
                                                                                       ]
                                                                                     )
                                                              ]
                                         ] ;
                     rdfs:subClassOf :Person .
    
    :SlightlyActivePerson rdf:type owl:Class ;
                          owl:equivalentClass [ rdf:type owl:Restriction ;
                                                owl:onProperty :hasExerciseFrequency ;
                                                owl:someValuesFrom [ rdf:type rdfs:Datatype ;
                                                                     owl:onDatatype xsd:integer ;
                                                                     owl:withRestrictions ( [ xsd:minInclusive 1
                                                                                            ]
                                                                                            [ xsd:maxInclusive 2
                                                                                            ]
                                                                                          )
                                                                   ]
                                              ] ;
                          rdfs:subClassOf :Person .
    
    :ann rdf:type owl:NamedIndividual ;
         :hasExerciseFrequency 10 .
    
    :dave rdf:type owl:NamedIndividual ;
          :hasExerciseFrequency 0 .
    
    :pete rdf:type owl:NamedIndividual ;
          :hasExerciseFrequency 3 .
    
    [ rdf:type owl:AllDisjointClasses ;
      owl:members ( :HighlyActivePerson
                    :ModeratelyActivePerson
                    :SedentaryPerson
                  )
    ] .
    
    如果您将其加载并运行推理机,它将把
    ann
    归类为高度活跃,
    pete
    归类为中度活跃,
    dave
    归类为久坐


    我在我的论文中讨论了实现这一点的方法,你可以从中下载。

    你能澄清一下这个海龟代码是由工具生成的还是由你自己手工编写的吗?我对
    [rdf:type owl:NamedIndividual,owl:Axiom;
    -用于注释目的的具体化公理不应该也有
    NamedIndividual
    类型(并且在该文件中表示为空白节点),因此我怀疑相应的三元组实际上被忽略了,一些工具可能会将其视为无效而拒绝。我亲手编写了它。我将看看删除该部分时会发生什么。不过,正如我在下面的注释中所指出的:当我将:performsWIthFrequency设置为注释属性时,它将与上面看到的表示形式的其余部分一起工作。如果不是注释属性,它不会被标准的OWL推理器使用-因此您所做的是错误的方向。您应该删除的是
    rdfs:Domain OWL:Axiom;
    ,谢谢。为什么rdfs:Domain会导致问题?说我希望我的关系应用于句子难道不是正确的吗?
    :hasExerciseFrequency rdf:type owl:DatatypeProperty ;
                          rdfs:range xsd:integer .
    
    :HighlyActivePerson rdf:type owl:Class ;
                        owl:equivalentClass [ rdf:type owl:Restriction ;
                                              owl:onProperty :hasExerciseFrequency ;
                                              owl:someValuesFrom [ rdf:type rdfs:Datatype ;
                                                                   owl:onDatatype xsd:integer ;
                                                                   owl:withRestrictions ( [ xsd:minInclusive 7
                                                                                          ]
                                                                                        )
                                                                 ]
                                            ] ;
                        rdfs:subClassOf :Person .
    
    
    :ModeratelyActivePerson rdf:type owl:Class ;
                            owl:equivalentClass [ rdf:type owl:Restriction ;
                                                  owl:onProperty :hasExerciseFrequency ;
                                                  owl:someValuesFrom [ rdf:type rdfs:Datatype ;
                                                                       owl:onDatatype xsd:integer ;
                                                                       owl:withRestrictions ( [ xsd:minInclusive 3
                                                                                              ]
                                                                                              [ xsd:maxInclusive 6
                                                                                              ]
                                                                                            )
                                                                     ]
                                                ] ;
                            rdfs:subClassOf :Person .
    
    :Person rdf:type owl:Class ;
            owl:equivalentClass [ rdf:type owl:Restriction ;
                                  owl:onProperty :hasExerciseFrequency ;
                                  owl:someValuesFrom xsd:integer
                                ] .
    
    :SedentaryPerson rdf:type owl:Class ;
                     owl:equivalentClass [ rdf:type owl:Restriction ;
                                           owl:onProperty :hasExerciseFrequency ;
                                           owl:someValuesFrom [ rdf:type rdfs:Datatype ;
                                                                owl:onDatatype xsd:integer ;
                                                                owl:withRestrictions ( [ xsd:maxInclusive 0
                                                                                       ]
                                                                                     )
                                                              ]
                                         ] ;
                     rdfs:subClassOf :Person .
    
    :SlightlyActivePerson rdf:type owl:Class ;
                          owl:equivalentClass [ rdf:type owl:Restriction ;
                                                owl:onProperty :hasExerciseFrequency ;
                                                owl:someValuesFrom [ rdf:type rdfs:Datatype ;
                                                                     owl:onDatatype xsd:integer ;
                                                                     owl:withRestrictions ( [ xsd:minInclusive 1
                                                                                            ]
                                                                                            [ xsd:maxInclusive 2
                                                                                            ]
                                                                                          )
                                                                   ]
                                              ] ;
                          rdfs:subClassOf :Person .
    
    :ann rdf:type owl:NamedIndividual ;
         :hasExerciseFrequency 10 .
    
    :dave rdf:type owl:NamedIndividual ;
          :hasExerciseFrequency 0 .
    
    :pete rdf:type owl:NamedIndividual ;
          :hasExerciseFrequency 3 .
    
    [ rdf:type owl:AllDisjointClasses ;
      owl:members ( :HighlyActivePerson
                    :ModeratelyActivePerson
                    :SedentaryPerson
                  )
    ] .