Rdf 使用SPARQL查找活着的人(选择没有优势的项目)
下面的sparql查询将给出死亡人员Rdf 使用SPARQL查找活着的人(选择没有优势的项目),rdf,sparql,freebase,dbpedia,virtuoso,Rdf,Sparql,Freebase,Dbpedia,Virtuoso,下面的sparql查询将给出死亡人员 select distinct ?item{ ?item <http://freebase.com/ns/common/topic/notable_types> <http://freebase.com/ns/people/person> . ?item <http://freebase.com/ns/people/deceased_person/date_of_death> ?y . } selectdistinct?
select distinct ?item{
?item <http://freebase.com/ns/common/topic/notable_types> <http://freebase.com/ns/people/person> .
?item <http://freebase.com/ns/people/deceased_person/date_of_death> ?y .
}
selectdistinct?项{
?项目。
?项目?y。
}
我想抓住所有活着的人。
如何用SPARQL语法来表达这一点?
这更像是问,给我所有没有特定边缘的节点。
在SPARQL中可能吗
提前谢谢。
非常感谢您的帮助。当然。您可以使用以下构造:
SELECT DISTINCT ?item {
?item <http://freebase.com/ns/common/topic/notable_types> <http://freebase.com/ns/people/person> .
OPTIONAL {?item <http://freebase.com/ns/people/deceased_person/date_of_death> ?y}
FILTER (!BOUND(?y))
}
selectdistinct?项{
?项目。
可选{?项?y}
滤子(!界(?y))
}
SPARQL 1.1中的
SELECT DISTINCT ?item {
?item <http://freebase.com/ns/common/topic/notable_types> <http://freebase.com/ns/people/person> .
FILTER NOT EXISTS { ?item <http://freebase.com/ns/people/deceased_person/date_of_death> ?y}
}
selectdistinct?项{
?项目。
筛选器不存在{?项?y}
}
这同样有效!不幸的是,我不能接受两个答案。所以,给我一票。谢谢。在哪里可以找到SPARQL和SPARQL 1.1上所有可能的内容的文档?如果有好的教程,请告诉我。请注意,这不会给你唯一活着的人。它只给你那些在freebase中没有记录死亡日期的人。