query-bf8bc57fa5c1b4dddb6d1450bf1a1dbb
Help: Query to get the creation date (when the entity was created on Wikidata) for a particular countryHello, I would like to get Wikidata entities created in a certain month in a certain location and for that, I need the creation date. I tried something with mwapi but could not succeed.
Use at
- https://query.wikidata.org/sparql
PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT * WHERE { 
BIND(wd:Q42 AS ?item)
  #?item wdt:P17 wd:Q183.
  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:rvprop "timestamp";
                    mwapi:rvdir "newer".
    ?contentmodel wikibase:apiOutput 'revisions/rev/@timestamp'.
  }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v2("?contentmodel"):::projected 
  v1("?item"):::projected 
  c4(["www.wikidata.org"]):::literal 
  c18(["newer"]):::literal 
  c12(["1^^xsd:integer"]):::literal 
  c2(["bd:serviceParam"]):::iri 
  c8(["once"]):::literal 
  c10(["allpages"]):::literal 
  c20(["revisions/rev/@timestamp"]):::literal 
  c14(["revisions"]):::literal 
  c6(["Generator"]):::literal 
  c16(["timestamp"]):::literal 
  bind0[/"'wd:Q42'"/]
  bind0 --as--o v1
  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:rvprop"-->  c16
    c2 --"mwapi:rvdir"-->  c18
    v2 --"mwapi:apiOutput"-->  c20
  end