query-ad91212caa6fc753fe8543c1c500507e

rq turtle/ttl

Literary works with citation for reference to place of action

Use at

PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Map
prefix pr: <http://www.wikidata.org/prop/reference/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX v: <http://www.wikidata.org/prop/statement/>
PREFIX q: <http://www.wikidata.org/prop/qualifier/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX prov: <http://www.w3.org/ns/prov#>

SELECT ?workLabel ?authorLabel ?locationLabel ?geo ?citat WHERE {
  { ?work (wdt:P31/wdt:P279*) wd:Q7725634 } union { ?work wdt:P31 wd:Q571 }
  ?work wdt:P50 ?author .
  ?work p:P840 ?location_statement .
  ?location_statement v:P840 ?location .
  ?location wdt:P17 wd:Q35 .
  ?location wdt:P625 ?geo . 
  OPTIONAL {
    ?location_statement prov:wasDerivedFrom ?ref .
    ?ref pr:P1683 ?citat .
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "da,en" . }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?author") v7("?citat"):::projected v5("?geo"):::projected v4("?location") v3("?location_statement") v6("?ref") v1("?work") a1((" ")) c3(["wd:Q7725634"]):::iri c9(["wd:Q35"]):::iri c14(["bd:serviceParam"]):::iri c16(["da,en"]):::literal c4(["wd:Q571"]):::iri subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v1 --"p:direct/P31"--> c4 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v1 --"p:direct/P31"--> a1 a1 --"p:direct/P279"--> c3 end union0r <== or ==> union0l end v1 --"p:direct/P50"--> v2 v1 --"p:P840"--> v3 v3 --"p:statement/P840"--> v4 v4 --"p:direct/P17"--> c9 v4 --"p:direct/P625"--> v5 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."prov:wasDerivedFrom".-> v6 v6 --"p:reference/P1683"--> v7 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c14 --"wikibase:language"--> c16 end