query-6ae370415eccf5112de1da03682743a2

rq turtle/ttl

title:find UNESCO stuff for karthographer SELECT ?id ?geo (concat(?articleLink, '[[File:Wikidata-logo S.svg|16px|link=d:', substr(str(?id),32,13), ']]', (SAMPLE(?idBild))) as ?description) ('small' as ?marker_size) ?marker_color WHERE { ?id wdt:P17 ?country. VALUES ?country {wd:Q40}. # {wd:}.Q843 ?id wdt:P1435 wd:Q9259. ?id wdt:P757 []. ?id wdt:P625 ?geo. SERVICE wikibase:label { bd:serviceParam wikibase:language 'de,en' . ?id rdfs:label ?idLabel . } OPTIONAL { ?id wdt:P18 ?img .} BIND(IF(BOUND(?img), concat('\n', '[[File:', substr(str(?img), 52, 400), '|250px]]'), '') AS ?idBild) . OPTIONAL { ?id p:P1435 ?statement. ?statement ps:P1435 wd:Q9259. ?statement pq:P580 []. #VALUES ?year {1997}. } bind(if(BOUND(?img), if(BOUND(?end), '#80F080', '#008000'), if(BOUND(?end), '#F08080', '#800000')) as ?marker_color). optional { ?link schema:about ?id . ?link schema:isPartOf https://de.wikipedia.org/ . ?link schema:name ?lemma . } bind (if(Bound(?link), concat('[[:de:', ?lemma, '|',?idLabel,']]\n'), concat(?idLabel,'\n')) as ?articleLink). } GROUP BY ?id ?geo ?articleLink ?marker_color

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
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#>
#title:find UNESCO stuff for karthographer 
SELECT ?id ?geo 
                (concat(?articleLink, '[[File:Wikidata-logo S.svg|16px|link=d:', substr(str(?id),32,13), ']]', (SAMPLE(?idBild))) as ?description)
                ('small' as ?marker_size) ?marker_color
         WHERE { ?id wdt:P17 ?country.
                 VALUES ?country {wd:Q40}. # {wd:}.Q843
                 ?id wdt:P1435 wd:Q9259.
                 ?id wdt:P757 [].
                 ?id wdt:P625 ?geo.
                 SERVICE wikibase:label { bd:serviceParam wikibase:language 'de,en' .
                                          ?id rdfs:label ?idLabel . }
                 OPTIONAL { ?id wdt:P18 ?img .}
                 BIND(IF(BOUND(?img), concat('\\n', '[[File:', substr(str(?img), 52, 400), '|250px]]'), '') AS ?idBild) .
                 OPTIONAL {
                    ?id p:P1435 ?statement.
                    ?statement ps:P1435 wd:Q9259.
                    ?statement pq:P580 [].
                    #VALUES ?year {1997}.
                    }
                 bind(if(BOUND(?img), if(BOUND(?end), '#80F080', '#008000'), if(BOUND(?end), '#F08080', '#800000')) as ?marker_color).
                 optional {
                    ?link schema:about ?id .
                    ?link schema:isPartOf <https://de.wikipedia.org/> .
                    ?link schema:name ?lemma .
                 }
                    bind (if(Bound(?link), concat('[[:de:', ?lemma, '|',?idLabel,']]\\n'), concat(?idLabel,'\\n')) as ?articleLink).
               }
         GROUP BY ?id ?geo ?articleLink ?marker_color

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v12("?_anon_42b5416610844a34809f33a099ae9de141000"):::projected v11("?articleLink"):::projected v3("?country") v13("?description") v3("?geo"):::projected v1("?id"):::projected v6("?idBild") v4("?idLabel") v5("?img") v10("?lemma") v9("?link") v8("?marker_color"):::projected v14("?marker_size") v7("?statement") a1((" ")) a2((" ")) c17([https://de.wikipedia.org/]):::iri c7(["bd:serviceParam"]):::iri c9(["de,en"]):::literal c3(["wd:Q9259"]):::iri v1 --"p:direct/P17"--> v3 bind0[/VALUES ?country/] bind0-->v3 bind00(["wd:Q40"]) bind00 --> bind0 v1 --"p:direct/P1435"--> c3 v1 --"p:direct/P757"--> a1 v1 --"p:direct/P625"--> v3 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 v1 --"rdfs:label"--> v4 end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."p:direct/P18".-> v5 end bind1[/"if(bound(?img),concat('\n','#91;#91;File:',substring(str(?img),'52^^xsd:integer','400^^xsd:integer'),'|250px#93;#93;'),'')"/] v5 --o bind1 bind1 --as--o v6 subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v1 -."p:P1435".-> v7 v7 --"p:statement/P1435"--> c3 v7 --"p:qualifier/P580"--> a2 end bind2[/"if(bound(?img),if(bound(?end),'#80F080','#008000'),if(bound(?end),'#F08080','#800000'))"/] v5 --o bind2 null --o bind2 bind2 --as--o v8 subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v9 -."schema:about".-> v1 v9 --"schema:isPartOf"--> c17 v9 --"schema:name"--> v10 end bind3[/"if(bound(?link),concat('#91;#91;:de:',?lemma,'|',?idLabel,'#93;#93;\n'),concat(?idLabel,'\n'))"/] v9 --o bind3 v10 --o bind3 v4 --o bind3 bind3 --as--o v11 bind5[/"sample(?idBild)"/] v6 --o bind5 bind5 --as--o v12 bind6[/"concat(?articleLink,'#91;#91;File:Wikidata-logo S.svg|16px|link=d:',substring(str(?id),'32^^xsd:integer','13^^xsd:integer'),'#93;#93;',)"/] v11 --o bind6 v1 --o bind6 null --o bind6 bind6 --as--o v13 bind7[/"'small'"/] bind7 --as--o v14