关联数据和端点

发布于 2024-09-03 11:40:31 字数 796 浏览 2 评论 0原文

为什么终点对查询的最终结果如此重要。

对于此查询:


SELECT ?episode,?chalkboard_gag WHERE {
  ?episode skos:subject 
    http://dbpedia.org/resource/Category:The_Simpsons_episodes%2C_season_12.
  ?episode dbpedia2:blackboard ?chalkboard_gag
}

The endpoint "OpenLink Virtuoso SPARQL protocol" returns 1 result.
"http://dbpedia.org/snorql" ("http://dbpedia.org/sparql", i am using jena also) produces 4 results, which is the correct, since only 4 of the episodes have blackboard information created.

Why the diferences?

Why does the end point matters so much to the end results of the query.

For this query:


SELECT ?episode,?chalkboard_gag WHERE {
  ?episode skos:subject 
    http://dbpedia.org/resource/Category:The_Simpsons_episodes%2C_season_12.
  ?episode dbpedia2:blackboard ?chalkboard_gag
}

The endpoint "OpenLink Virtuoso SPARQL protocol" returns 1 result.
"http://dbpedia.org/snorql" ("http://dbpedia.org/sparql", i am using jena also) produces 4 results, which is the correct, since only 4 of the episodes have blackboard information created.

Why the diferences?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

玉环 2024-09-10 11:40:31

对于第一个端点,您的意思是 http://lod.openlinksw.com/sparql 吗?我没有看到它和 http://dbpedia.org/sparql 之间的不同结果。例如,这个查询在您的查询上扩展,似乎从两个端点返回相同的内容(如果它们确实是不同的服务器;我无法告诉)。

prefix skos: <http://www.w3.org/2004/02/skos/core#>
prefix category: <http://dbpedia.org/resource/Category:>
prefix dbpedia2: <http://dbpedia.org/property/>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>

SELECT DISTINCT ?airdate ?chalkboard_gag ?episode
WHERE {
  ?episode skos:subject ?cat .
  ?cat skos:broader category:The_Simpsons_episodes .
  ?episode dbpedia2:airdate ?airdate .
  ?episode dbpedia2:blackboard ?chalkboard_gag .
  FILTER langMatches( lang(?chalkboard_gag), 'en') .
  FILTER xsd:dateTime(?airdate)
}
ORDER BY ?airdate

我知道会产生不同结果的一件事是查询超时。 Virtuoso 可以在查询运行一定时间后切断查询,并且当您尝试查询时,不同的端点可能处于不同的负载下,和/或配置了不同的超时。

 
顺便说一句,我注意到,如果此数据位于 Needle 中,并在 Thread 而不是 SPARQL 中查询,则此查询可以简单如下:

Episode:(.Subject:<~The Simpsons)^Airdate|Airdate,Blackboard

除了在 Needle 中,您可能实际上会像电视节目一样对电视节目进行建模,而不是依赖于通用 SKOS 主题/更广泛的抽象级别,因此实际上可能具有:

Show:=The Simpsons.Season.Episode|Airdate,Blackboard

For the first endpoint, do you mean http://lod.openlinksw.com/sparql? I'm not seeing different results between that and http://dbpedia.org/sparql. For example, this query, expanding on yours, seems to return the same stuff from both endpoints (if indeed they're actually different servers; I can't tell).

prefix skos: <http://www.w3.org/2004/02/skos/core#>
prefix category: <http://dbpedia.org/resource/Category:>
prefix dbpedia2: <http://dbpedia.org/property/>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>

SELECT DISTINCT ?airdate ?chalkboard_gag ?episode
WHERE {
  ?episode skos:subject ?cat .
  ?cat skos:broader category:The_Simpsons_episodes .
  ?episode dbpedia2:airdate ?airdate .
  ?episode dbpedia2:blackboard ?chalkboard_gag .
  FILTER langMatches( lang(?chalkboard_gag), 'en') .
  FILTER xsd:dateTime(?airdate)
}
ORDER BY ?airdate

The one thing I know of that would produce different results would be query timeouts. Virtuoso can cut off queries after they've been running for a certain amount of time, and your different endpoints might have been under different loads when you tried them, and/or configured with different timeouts.

 
I note, parenthetically, that if this data were in Needle, and queried in Thread instead of SPARQL, this query could be as simple as:

Episode:(.Subject:<~The Simpsons)^Airdate|Airdate,Blackboard

Except in Needle you'd probably actually model TV shows like TV shows, rather than relying on levels of generic SKOS subject/broader abstractions, and thus might actually have:

Show:=The Simpsons.Season.Episode|Airdate,Blackboard
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文