我可以使用SPARQL查询Wikidata中与实体相关的Wikimedia图像吗?
我知道我可以从Wikidata中查询Wikipedia页面,如下所示:我可以使用SPARQL查询Wikidata中与实体相关的Wikimedia图像吗?,sparql,wikidata,wikimedia,Sparql,Wikidata,Wikimedia,我知道我可以从Wikidata中查询Wikipedia页面,如下所示: SELECT ?place ?article WHERE { SERVICE wikibase:box { ?place wdt:P625 ?location . # looks like cornerwest must be south of cornereast # otherwise you go around the globe # this is lng lat bd:s
SELECT ?place ?article WHERE {
SERVICE wikibase:box {
?place wdt:P625 ?location .
# looks like cornerwest must be south of cornereast
# otherwise you go around the globe
# this is lng lat
bd:serviceParam wikibase:cornerWest "Point(1 12)"^^geo:wktLiteral .
bd:serviceParam wikibase:cornerEast "Point(2 13)"^^geo:wktLiteral .
}
?article schema:about ?place .
?article schema:isPartOf [ wikibase:wikiGroup "wikipedia" ] .
}
https://pl.wikipedia.org/w/api.php?action=query&titles=Pearl_Harbor&format=json&prop=images
我知道,给定一篇文章的标题,我可以使用Wikipedia API查询它的图像,如下所示:
SELECT ?place ?article WHERE {
SERVICE wikibase:box {
?place wdt:P625 ?location .
# looks like cornerwest must be south of cornereast
# otherwise you go around the globe
# this is lng lat
bd:serviceParam wikibase:cornerWest "Point(1 12)"^^geo:wktLiteral .
bd:serviceParam wikibase:cornerEast "Point(2 13)"^^geo:wktLiteral .
}
?article schema:about ?place .
?article schema:isPartOf [ wikibase:wikiGroup "wikipedia" ] .
}
https://pl.wikipedia.org/w/api.php?action=query&titles=Pearl_Harbor&format=json&prop=images
(以结果为准)
我想一次完成-可能吗?您是否尝试使用Wikidata图像属性
wdt:P18
?@UninformedUser是-但它只提供了我所能看到的一个图像。我的目标是获取与页面相关的所有图像OK,是的,珍珠港的Wikidata实体只有一个图像:-但公平地说,Wikidata不是Wikipedia。在Wikiedata本身中,数据很可能不包含,但有一些生成器:-不确定,是否可以组合使用