之间是否存在差异(在性能,对标准的尊重或其他方面):
select distinct ?planeWithoutPassengers where {
?planeWithoutPassengers a <http://example.org/plane> .
filter not exists {
?planeWithoutPassengers <http://example.org/hasPassenger> ?passenger .
}
}
并且:
select distinct ?planeWithoutPassengers where {
?planeWithoutPassengers a <http://example.org/plane> .
optional {
?planeWithoutPassengers <http://example.org/hasPassenger> ?passenger .
}
filter (!bound(?passenger)).
}
答案 0 :(得分:2)
没有真正的区别。第二个是较旧的版本,它也可以在SPARQL 1.0引擎上使用。但是,第一个是首选,因为它读起来更直观。