query-83dadb68319300925924624b8d27e518
SERVICE wikibase:mwapiGet the creation date of a Wikidata item using
Use at
- https://query.wikidata.org/sparql
PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?created {
BIND(wd:Q18517638 AS ?item).
BIND(SUBSTR(STR(?item), 32) AS ?title).
SERVICE wikibase:mwapi {
bd:serviceParam
wikibase:endpoint "www.wikidata.org";
wikibase:api "Generator";
wikibase:limit "once";
mwapi:generator "allpages";
mwapi:gaplimit 1;
mwapi:prop "revisions";
mwapi:gapfrom ?title;
mwapi:gapto ?title;
mwapi:rvprop "timestamp";
mwapi:rvdir "newer".
?created wikibase:apiOutput 'revisions/rev/@timestamp'.
}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?created"):::projected
v1("?item"):::projected
v2("?title")
c4(["www.wikidata.org"]):::literal
c20(["newer"]):::literal
c12(["1^^xsd:integer"]):::literal
c2(["bd:serviceParam"]):::iri
c8(["once"]):::literal
c10(["allpages"]):::literal
c22(["revisions/rev/@timestamp"]):::literal
c14(["revisions"]):::literal
c6(["Generator"]):::literal
c18(["timestamp"]):::literal
bind0[/"'wd:Q18517638'"/]
bind0 --as--o v1
bind1[/"substring(str(?item),'32^^xsd:integer')"/]
v1 --o bind1
bind1 --as--o v2
subgraph s1["http://wikiba.se/ontology#mwapi"]
style s1 stroke-width:4px;
c2 --"mwapi:endpoint"--> c4
c2 --"mwapi:api"--> c6
c2 --"mwapi:limit"--> c8
c2 --"mwapi:generator"--> c10
c2 --"mwapi:gaplimit"--> c12
c2 --"mwapi:prop"--> c14
c2 --"mwapi:gapfrom"--> v2
c2 --"mwapi:gapto"--> v2
c2 --"mwapi:rvprop"--> c18
c2 --"mwapi:rvdir"--> c20
v3 --"mwapi:apiOutput"--> c22
end