query-01d95fa476f6ec4012d68f00d429436a
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?created (IF(xsd:dateTime(?created) <= "2015-01-01"^^xsd:date, "yes", "no") AS ?existed_before_given_date)
WHERE
{
SERVICE wikibase:mwapi
{
bd:serviceParam wikibase:endpoint "www.wikidata.org".
bd:serviceParam wikibase:api "Generator".
bd:serviceParam wikibase:limit "1".
bd:serviceParam mwapi:generator "revisions".
bd:serviceParam mwapi:titles "Q1346018".
bd:serviceParam mwapi:prop "revisions".
bd:serviceParam mwapi:grvprop "timestamp".
bd:serviceParam mwapi:grvdir "newer".
bd:serviceParam mwapi:grvlimit "1".
?item wikibase:apiOutputItem mwapi:title.
?created wikibase:apiOutput "revisions/rev/@timestamp".
}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?created"):::projected
v3("?existed_before_given_date")
v1("?item"):::projected
c4(["www.wikidata.org"]):::literal
c12(["Q1346018"]):::literal
c17(["newer"]):::literal
c8(["1"]):::literal
c2(["bd:serviceParam"]):::iri
c22(["revisions/rev/@timestamp"]):::literal
c10(["revisions"]):::literal
c20(["mwapi:title"]):::iri
c6(["Generator"]):::literal
c15(["timestamp"]):::literal
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:titles"--> c12
c2 --"mwapi:prop"--> c10
c2 --"mwapi:grvprop"--> c15
c2 --"mwapi:grvdir"--> c17
c2 --"mwapi:grvlimit"--> c8
v1 --"mwapi:apiOutputItem"--> c20
v2 --"mwapi:apiOutput"--> c22
end
bind0[/"if(http://www.w3.org/2001/XMLSchema#dateTime(?created) <= '2015-01-01^^xsd:date','yes','no')"/]
v2 --o bind0
bind0 --as--o v3