Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/apache-spark/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Rdf 使用SPARQL查找活着的人(选择没有优势的项目)_Rdf_Sparql_Freebase_Dbpedia_Virtuoso - Fatal编程技术网

Rdf 使用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?

下面的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?项{
?项目。
?项目?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中没有记录死亡日期的人。