首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >基于SKOS的SPARQL推理

基于SKOS的SPARQL推理
EN

Stack Overflow用户
提问于 2021-06-01 09:41:29
回答 1查看 271关注 0票数 0

我们试图用链接数据来展示推理。

这个简单的图形看起来像下面的海龟格式:

代码语言:javascript
复制
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ex: <http://schema.example.com/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>

ex:Places rdf:type skos:ConceptScheme .

ex:Localities rdf:type skos:Concept .
ex:Localities skos:prefLabel "Localities" .
ex:Localities skos:inScheme ex:Places.

ex:Countries rdf:type skos:Concept .
ex:Countries skos:prefLabel "Countries" .
ex:Countries skos:inScheme ex:Places.

ex:Continents rdf:type skos:Concept .
ex:Continents skos:prefLabel "Continents" .
ex:Continents skos:inScheme ex:Places.

ex:Persons rdf:type skos:Concept .
ex:Persons skos:prefLabel "Persons" .

ex:livesIn a rdf:Property .

ex:isPartOf a rdf:Property .

ex:Localities skos:broader ex:Countries .
ex:Countries skos:broader ex:Continents .

ex:Europe a ex:Continents .

ex:Switzerland a ex:Countries .
ex:Switzerland ex:isPartOf ex:Europe.

ex:France a ex:Countries .
ex:France ex:isPartOf ex:Europe.

ex:Bern a ex:Localities .
ex:Bern skos:prefLabel "Bern".
ex:Bern ex:isPartOf ex:Switzerland.
 
ex:Thun a ex:Localities .
ex:Thun skos:prefLabel "Thun".
ex:Thun ex:isPartOf ex:Switzerland.

ex:Paris a ex:Localities .
ex:Paris skos:prefLabel "Paris".
ex:Paris ex:isPartOf ex:France.

ex:Hans a ex:Persons.
ex:Hans skos:prefLabel "Hans".
ex:Hans ex:livesIn ex:Bern.

ex:Fritz a ex:Persons.
ex:Frits skos:prefLabel "Fritz".
ex:Fritz ex:livesIn ex:Thun.

ex:Jaques a ex:Persons.
ex:Jaques skos:prefLabel "Jaques".
ex:Jaques ex:livesIn ex:Paris.

这样做的目的是在SPARQL中执行以下查询:

代码语言:javascript
复制
PREFIX ex: <http://schema.example.com/>
ASK where { ex:Hans ex:livesIn ex:Switzerland }

它应该返回是,但它返回否。

是否有可能对数据进行建模,这个问题陈述可以用“是”来回答?

就推论而言,这应该是真实的,因为ex:Bern是前:地点,这是一个skos: ex:Countries,它是ex:瑞士。

我还没有找到任何很好的例子,如建模和推理。我们希望使用skos:概念,而不是rdfs子类。因为它应该展示在某些情况下对概念的推断,在这种情况下,您不能对所有的内容进行子类化。

我正在使用:

  • GraphDB 9.5.0 EE
  • OWL2-RL - Ruleset
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-06-08 06:32:38

为了完成这个问题,我把我上面的评论作为答案.

要使其工作,您需要对属性ex:isPartOfex:livesIn定义一些意义。建议使ex:isPartOf传递,然后将ex:livesIn定义为ex:isPartOf上的一个属性链,例如:

代码语言:javascript
复制
ex:isPartOf a owl:TransitiveProperty . 
ex:livesIn rdf:type owl:ObjectProperty;              
    owl:propertyChainAxiom( ex:livesIn ex:isPartOf) . 
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67786448

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档