微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

如何解决如何使用 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 举报,一经查实,本站将立刻删除。

相关推荐


Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其他元素将获得点击?
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。)
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbcDriver发生异常。为什么?
这是用Java进行XML解析的最佳库。
Java的PriorityQueue的内置迭代器不会以任何特定顺序遍历数据结构。为什么?
如何在Java中聆听按键时移动图像。
Java“Program to an interface”。这是什么意思?