通过 SPARQL 1.1 使实例参与 OWL 限制 类

Getting instance involved in OWL Restriction classes through SPARQL 1.1

我正在创建两个 classes BookPerson,以及一个对象 属性 hasAuthor:

我正在使用 OWL 限制创建 Book 的另一个子类 Book_With_Atleast_One_Male_Author,如下所示:

:Book_With_Atleast_One_Male_Author rdfs:subClassOf [
  rdf:type owl:Class ;
  owl:intersectionOf (
                      :Book 
                      [ a owl:Restriction ;
                        owl:onProperty bf:hasAuthor ;
                        owl:someValuesFrom :Male ]
                      )
] .

现在我创建了一些 BookPerson 的实例以及关系:

:Hard_bounded_book1 rdf:type :Hard_bounded_book .
:Hard_bounded_book2 rdf:type :Hard_bounded_book .
:Soft_bounded_book1 rdf:type :Soft_bounded_book .
:Soft_bounded_book2 rdf:type :Soft_bounded_book .
:Male1 rdf:type :Male .
:Male2 rdf:type :Male .
:Female1 rdf:type :Female .
:Female2 rdf:type :Female .
:Hard_bounded_book1 :hasAuthor :Male1
:Hard_bounded_book1 :hasAuthor :Male2
:Hard_bounded_book1 :hasAuthor :Female1
:Hard_bounded_book1 :hasAuthor :Female2
:Soft_bounded_book1 :hasAuthor :Male1
:Soft_bounded_book2 :hasAuthor :Female1

当我编写 SPARQL 查询来获取 class Book_With_Atleast_One_Male_Author 的实例时,我没有得到任何东西。 如果您知道发生了什么,请告诉我?

谢谢。

你当然不会得到!您将 :Book_With_Atleast_One_Male_Author 定义为 Bookrestriction 之间交集的 subClassOf

subClassOf 语义:

Sub subClassOf Super

表示Sub的每个实例都是Super的实例。

这意味着 :Book_With_Atleast_One_Male_Author 的实例必须遵循您定义的 restriction,但这并不意味着遵循此限制的任意个体都是 Book_With_Atleast_One_Male_Author.[=28 的实例=]

您可以将 :Book_With_Atleast_One_Male_Author 定义为 Bookrestriction 的匿名 class 之间交集的等效 class你创造了。因此,每个既 Book 又满足 restriction 的个体将(使用推理机 运行)class 化为 :Book_With_Atleast_One_Male_Author

这里是你如何做到的:

:Book_With_Atleast_One_Male_Author rdf:type owl:Class ;
                               owl:equivalentClass [ owl:intersectionOf (  :Book :EquivalentToBookAndHasMaleAuthor ) ;rdf:type owl:Class ] .

:EquivalentToBookAndHasMaleAuthor rdf:type owl:Class ;
                              owl:equivalentClass [ rdf:type owl:Restriction; owl:onProperty  :hasAuthor ; owl:someValuesFrom :Male] .