query-3a6acf33581e5c6ea7e2d132f3d97154

rq turtle/ttl

TODO

Use at

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
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 DISTINCT ?entity ?entityLabel ?starttime ?endtime  (SAMPLE(?image_) as ?image)
            where
            {
            ?entity wdt:P31 wd:Q5 .
            ?entity p:P551 ?statement . 
            ?statement ps:P551 wd:Q90 .
            OPTIONAL {?statement pq:P580 ?starttime . }
            OPTIONAL {?statement pq:P582 ?endtime  . }                 
            OPTIONAL { ?entity wdt:P18 ?image_ . }
            FILTER((?starttime <= "1977-09-01"^^xsd:date && "1977-10-01"^^xsd:date <= ?endtime) || ("1977-09-01"^^xsd:date <= ?starttime && ?starttime <= "1977-10-01"^^xsd:dat) || ("1977-09-01"^^xsd:date <= ?endtime && ?endtime <= "1977-10-01"^^xsd:dat))
              SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
            } GROUP BY ?entity ?entityLabel ?starttime ?endtime 
            ORDER BY ?starttime

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?endtime"):::projected v3("?entity"):::projected v6("?image") v5("?image_"):::projected v1("?starttime"):::projected v4("?statement") c8(["wd:Q90"]):::iri c15(["en"]):::literal c13(["bd:serviceParam"]):::iri c5(["wd:Q5"]):::iri f0[["(?starttime <= '1977-09-01^^xsd:date''1977-10-01^^xsd:date' <= ?endtime || ('1977-09-01^^xsd:date' <= ?starttime?starttime <= s1977-10-01^^<http://www.w3.org/2001/XMLSchema#dat>' || '1977-09-01^^xsd:date' <= ?endtime?endtime <= s1977-10-01^^<http://www.w3.org/2001/XMLSchema#dat>'))"]] f0 --> v1 f0 --> v2 v3 --"p:direct/P31"--> c5 v3 --"p:P551"--> v4 v4 --"p:statement/P551"--> c8 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v4 -."p:qualifier/P580".-> v1 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v4 -."p:qualifier/P582".-> v2 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:direct/P18".-> v5 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c13 --"wikibase:language"--> c15 end bind2[/"sample(?image_)"/] v5 --o bind2 bind2 --as--o v6