为什么可以通过以下查询获得结果:
SELECT *
WHERE {
?person rdfs:label "Kirk Douglas"@en;
dbo:birthPlace ?place. # With dbp: too
}
但没有另一个:
SELECT *
WHERE {
?person rdfs:label "Kirk Douglas"@en;
dbo:starring ?film.
}
我正在关注中的标签https://dbpedia.org/page/Kirk_Douglas
了解它的一些技巧。
Thx!
在dbr:Kirk_Douglas中,您可以读取:
dbo:birthPlace dbr:Amsterdam_(city),_New_York
...
is dbo:starring of dbr:The_Light_at_the_Edge_of_the_World
dbr:Cast_a_Giant_Shadow
dbr:Two-Fisted_Tales_(film)
...
其中CCD_ 1是模拟CCD_ 2的逆性质的一种方式。
事实上,在dbo:主演你可以阅读:
rdfs:domain dbo:Work
...
rdfs:range dbo:Actor
这意味着您不应该构建像?actor dbo:starring ?work
这样的三元组,而?work dbo:starring ?actor
是一个有效的三元组。
所以你的查询应该是这样的:
SELECT *
WHERE {
?person rdfs:label "Kirk Douglas"@en .
?film dbo:starring ?person .
}