即使有数据,结果也会被过滤掉 [英] Results filtered out even though the data is there

查看:111
本文介绍了即使有数据,结果也会被过滤掉的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的查询:

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> 
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 
PREFIX foaf: <http://xmlns.com/foaf/0.1/> 
PREFIX : <http://dbpedia.org/resource/> 
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

SELECT DISTINCT ?resource ?parentOrSpouse
WHERE { 
?resource a dbo:Royalty ; 
rdfs:label ?label ; 
dbo:parent ?parent ; 
dbo:birthDate ?bd ; 
dbo:birthPlace ?bp . 
?bp dbo:isPartOf :England . 
FILTER(?bd < '1900-01-01'^^xsd:dateTime) . 
FILTER(?bd > '1800-01-01'^^xsd:dateTime) . 
FILTER(LANGMATCHES(LANG(?label), 'en')) . 
{ ?resource dbo:parent ?parentOrSpouse } UNION { ?resource dbo:spouse ?parentOrSpouse }
?parentOrSpouse dbo:birthPlace ?psbp .
?psbp dbo:isPartOf :England . 
}
ORDER BY(?bd)

此搜索所有出生的王室成员

This searches for all royals born in England between 1800 and 1900 that have a spouse or parent that is born in England.

结果

在结果列表中,我得到

http://dbpedia.org/page/George_V http://dbpedia.org/page/Mary_o f_Teck 被列为配偶,但George显然出生于英格兰时未列出Mary_of_Teck。

In the result list I get
http://dbpedia.org/page/George_V with http://dbpedia.org/page/Mary_of_Teck listed as a spouse, but not Mary_of_Teck listed while George is clearly born in England.

玛丽为什么失踪?当我查看数据时,还有很多其他人正在消失,这些人显然应该在列表中。

Why is Mary disappearing? There are a lot of other people disappearing that should clearly be on the list when I look at the data.

推荐答案

因此,解决方案玛丽不露面的原因是使用 dbo:parent | dbo:spouse / dbo:wikiPageRedirects?,因为玛丽是通过重定向来引用乔治的。

So the solution to Mary not showing up is to use dbo:parent|dbo:spouse/dbo:wikiPageRedirects?, since George is refered by Mary via a redirect.

另一个问题是 dbo:birthPlace / dbo:location?/ dbo:isPartOf dbr:England 抛出可能是(?)的错误与编译器中的错误有关。使用?parentOrSpouse dbo:birthPlace | dbo:birthPlace / dbo:location / dbo:isPartOf:England。似乎可以正常工作。

The other problem was dbo:birthPlace/dbo:location?/dbo:isPartOf dbr:England throwing an error that is probably(?) related to a bug in the compiler. Using ?parentOrSpouse dbo:birthPlace|dbo:birthPlace/dbo:location/dbo:isPartOf :England . instead seems to work fine.

信用转到@AKSW。

这篇关于即使有数据,结果也会被过滤掉的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆