SPARQL 1.1包含机制和FROM子句查询

编程入门 行业动态 更新时间:2024-10-24 01:55:29
本文介绍了SPARQL 1.1包含机制和FROM子句查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我目前正在记录/测试有关SPARQL 1.1蕴含机制的建议,该建议一再声明

I'm currently documenting/testing about SPARQL 1.1 entailment regimes and the recommendation repeatedly states that

作用域图与活动图等效.

The scoping graph is graph-equivalent to the active graph

,但没有指定活动图形所指的是什么:它是查询中使用的数据集吗?商店中所有图的并集?

but it does not specifies what is the active graph referring to : is it the data-set used in the query ? a union of all graphs in the store ?

作为确定这一点的测试,我在带有RDF Schema和直接类型推断存储(v2.7.14)的芝麻内存存储中将此图URI化为<www.example/>

As a test to determine this , I got this graph URIed <www.example/> in a Sesame Memory store with RDF Schema and direct type inferencing store (v2.7.14)

@prefix ex:<www.example/> . ex:book1 rdf:type ex:Publication . ex:book2 rdf:type ex:Article . ex:Article rdfs:subClassOf ex:Publication . ex:publishes rdfs:range ex:Publication . ex:MITPress ex:publishes ex:book3 .

我一直在尝试以下查询(这意味着使用默认图形,从而使用推理引擎)

I've been trying the following query (which means using the default graph thus the inference engine)

SELECT ?s WHERE { ?s a ex:Publication . }

如预期的那样,它返回了我所有的三个实例

As expected, it returns me all three instances

<www.example/book1> <www.example/book2> <www.example/book3>

查询时:

SELECT ?s FROM ex: WHERE { ?s a ex:Publication . }

仅返回

<www.example/book1>

在上述情况下,两个结果不应该相同吗?

Under the said circumstances, shouldn't both results be the same?

如果将数据和架构在存储中的两个图之间进行拆分(如<urn:rdfs-schema>和<urn:data>,甚至散布在更多图上),并且查询使用了两个图(或一个FROM子句中的模式相关图的子集),而不是默认图?

What should happen (according to the recommendation) if data and schema are split between two graphs in the store (like <urn:rdfs-schema> and <urn:data>, or even scattered across more graphs) and the query uses both graphs (or a subset of schema-related graphs) in the FROM clause instead of the default graph ?

含义应该是整个商店中的全局推断,还是取决于查询数据集?

Meaning should the inferencing be global throughout the store or does it depend on the query dataset ?

或者建议是否足够宽松以使其成为依赖于实现的问题?

Or maybe is the recommendation loose enough to make this an implementation dependent issue ?

感谢您的照明,

最大

编辑,此问题已重定向到 SPARQL 1.1包含机制和FROM子句查询(后续)

EDIT this question is being redirected to SPARQL 1.1 entailment regimes and query with FROM clause (follow-up)

推荐答案

第二个查询仅返回book1,因为在Sesame的RDFS推断器中,将包含的语句插入到 default 图中,而不是在命名前提所来自的命名图.因此,所查询的图形中根本就不会出现所包含的结果.

Your second query only returns only book1 because in Sesame's RDFS inferencer, entailed statements are inserted in the default graph, not in the named graph(s) from which the premises for the entailment come. So the entailed results are simply not present in the graph you are querying.

之所以选择这种设计,至少部分是出于历史原因,因为Sesame RDFS推理引擎早于W3C蕴涵机制概念.当时的基本原理是,在对多个命名图进行推断的情况下(例如,一个前提来自图A,另一前提来自图B),则在默认图中插入(而不是在A或B中,或在这两者中)最简单,混淆最少.

The reason for this design choice is at least partly historic, as the Sesame RDFS inference engine predates the W3C notion of entailment regimes. The rationale at the time was that in the case of inferencing over several named graphs (where e.g. one premise comes from graph A and another from B), insertion in the default graph (rather than in either A, or B, or both) was simplest with the least amount for confusion.

Sesame当前不明确支持W3C蕴含机制规范.但是,如果您认为可以通过简单的改进使其更兼容,则一定要登录功能请求.

Sesame currently does not explicitly support the W3C entailment regimes specification. However, if you feel that a simple improvement would be possible to make it more compatible, by all means log a feature request.

(公开:芝麻开发者)

更多推荐

SPARQL 1.1包含机制和FROM子句查询

本文发布于:2023-11-23 01:21:04,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1619599.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:子句   机制   SPARQL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!