2016-11-07 93 views
1

一些维基百科文章在信息框精确的时间,像这样:让所有的维基百科文章与精确的时间

https://en.wikipedia.org/wiki/Apollo_11

(成立日期:1969年7月16日13时32分00秒UTC)

或:

https://en.wikipedia.org/wiki/Remembrance_Day_bombing

(日期:1987年10:43 11月8日(GMT))

有没有办法让所有类似的文章的列表?似乎可能与SPARQL

+1

你可以看看DBpedia中的资源,并看到有从维基百科的信息框提取没有这样的属性:http://dbpedia.org/resource/Apollo_11 – AKSW

回答

1

AFAIK这是可能的,但它需要知道什么维基财产链接到信息框的日期(或日期时间)字段;让我用一个例子解释:

PREFIX : <http://dbpedia.org/resource/> 
PREFIX time-of-spacecraft-launch: <http://www.wikidata.org/entity/P619c> 
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> 

SELECT ?entity_label, ?property_label, ?time_of_spacecraft_launch WHERE { 
    :Apollo_11 owl:sameAs ?wikidata_entity . 
    ?wikidata_entity time-of-spacecraft-launch: ?time_of_spacecraft_launch . 
    ?wikidata_entity rdfs:label ?entity_label . 
    ?wke_prop ?property_rel time-of-spacecraft-launch:. 
    ?wke_prop rdfs:label ?property_label . 
    FILTER (LANG(?property_label)='en' && LANG(?entity_label)='it') 
} 

click here to se the result

现在我们可以凝胶都用同一种信息的文章简单地通过Apollo_11去除where条件:

PREFIX : <http://dbpedia.org/resource/> 
PREFIX time-of-spacecraft-launch: <http://www.wikidata.org/entity/P619c> 
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> 
SELECT ?entity_label, ?property_label, ?time_of_spacecraft_launch WHERE { 
    ?wikidata_entity time-of-spacecraft-launch: ?time_of_spacecraft_launch . 
    ?wikidata_entity rdfs:label ?entity_label . 
    ?wke_prop ?property_rel time-of-spacecraft-launch:. 
    ?wke_prop rdfs:label ?property_label . 
    FILTER (LANG(?property_label)='en' && LANG(?entity_label)='it') 
} 

see the result here风云

在某些情况下可能有助于简化查询:

PREFIX : <http://dbpedia.org/resource/> 
PREFIX time-of-spacecraft-launch: <http://www.wikidata.org/entity/P619c> 
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> 

SELECT * WHERE { 
    ?wikidata_entity time-of-spacecraft-launch: ?time_of_spacecraft_launch . 
    ?wikidata_entity rdfs:label ?entity_label . 
    FILTER (LANG(?entity_label)='en') 
} 
ORDER BY DESC(?time_of_spacecraft_launch) 

see the result here