如何使用 SPARQL CONSTRUCT 从包含 owl:intersectionOf、owl:equivalentClass、owl:restriction 等的复杂 OWL 图创建子图

问题描述

我想创建一个仅包含 SNOMED 的“disorder sub-hierarchy”的子图。我正在尝试使用 SPARQL CONSTRUCT 查询从完整的 SNOMED-OWL 图创建此子图。然而,由 owl:equivalentCLass/ owl:intersectionOf / owl:Restriction 组成的属性在创建的子图中显示一个空的 []。相同的查询在本体编辑器窗口中显示正确的结果。我是 SPARQL 和 OWL 的新手。有人可以帮助我遍历属性关系中复杂的 owl 公理,以便正确创建子图。 我使用了免费版 TopBraid 本体编辑器版本 6.0.1 (tbcfe-6.0.1) 中提供的 SPARQL 查询选项卡。这是我试过的查询。我之前在我的问题中提供了屏幕截图,但我猜它们不清晰可见。


    #select disorder concepts containing "and" and lenght <=4 words
    CONSTRUCT {?s ?p ?o}
    WHERE
    {
      ?s rdfs:label ?fsn
      bind(replace(?fsn,"\\S","") as ?space)
      bind(strlen(?space) as ?spacecount)
     FILTER(REGEX(?fsn," and ") && REGEX(?fsn,"(disorder)")) 
    FILTER(?spacecount<=3).
    ?s ?p ?o
    }
    ORDER BY ?spacecount

查询在 TopBraid 编辑器检索到的结果中显示了正确的输出,但是当我将它们导出到 .ttl 文件时,如果有像 owl:intersectionOf、owl:EquivalentClass、owl:restriction 这样的复杂 owl 公理,我就会得到一个空白 [],等

**Concept in original file**
<http://snomed.info/id/188487008> rdf:type owl:Class ;
                                  rdfs:subClassOf [ owl:intersectionOf ( <http://snomed.info/id/64572001>
                                                                         [ rdf:type owl:Restriction ;
                                                                           owl:onProperty <http://snomed.info/id/609096000> ;
                                                                           owl:someValuesFrom [ rdf:type owl:Restriction ;
                                                                                                owl:onProperty <http://snomed.info/id/116676008> ;
                                                                                                owl:someValuesFrom <http://snomed.info/id/128929007>
                                                                                              ]
                                                                         ]
                                                                       ) ;
                                                    rdf:type owl:Class
                                                  ] ;
                                  rdfs:label "Lymphosarcoma and reticulosarcoma (disorder)"@en ;
                                  skos:prefLabel "Lymphosarcoma and reticulosarcoma"@en .

**Concept created/exported in Subgraph**
:188487008  a            owl:Class ;
        rdfs:label       "Lymphosarcoma and reticulosarcoma (disorder)"@en ;
        rdfs:subClassOf  owl:Thing ;
        rdfs:subClassOf  []  ;
        skos:prefLabel   "Lymphosarcoma and reticulosarcoma"@en .

我已经提到了这个解决方案,但它似乎对我不起作用并且给出了一个空的结果集- (SPARQL: how to transfer owl:equivalentClass to rdfs:subClassOf (owl:Restriction) properties?) 截图 Ontology editor displays the ?o correctly Generated subgraph file has a blank [] for ?o

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)