query-314f9475fb8047eaf97825b9c2824d54

rq turtle/ttl

GerardM

Use at

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?positionLabel ?start ?end WHERE {
   {
  SELECT ?item ?position ?start ?end WHERE {
    ?item p:P39 [
      ps:P39 ?position;
      pq:P580 ?start;
      pq:P582 ?end
    ].
    FILTER(?start < "420-01-01"^^xsd:dateTime)
    FILTER(?end >= "421-01-01"^^xsd:dateTime)
  }
}
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?end"):::projected v4("?item"):::projected v3("?position") v2("?start"):::projected a1((" ")) c8(["bd:serviceParam"]):::iri c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["?end >= '421-01-01^^xsd:dateTime'"]] f0 --> v1 f1[["?start < '420-01-01^^xsd:dateTime'"]] f1 --> v2 a1 --"p:statement/P39"--> v3 a1 --"p:qualifier/P580"--> v2 a1 --"p:qualifier/P582"--> v1 v4 --"p:P39"--> a1 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end