Query Service: Difference between revisions

From Swedish Museum
(test query)
 
No edit summary
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
<sparql tryit="1">
#defaultView:Map
#title:Gumman i Visby
PREFIX wd: <https://swedishmuseum.wikibase.cloud/entity/>
PREFIX wd: <https://swedishmuseum.wikibase.cloud/entity/>
PREFIX wdt: <https://swedishmuseum.wikibase.cloud/prop/direct/>
PREFIX wdt: <https://swedishmuseum.wikibase.cloud/prop/direct/>


SELECT ?item ?itemLabel ?place ?placeLabel ?latitude ?longitude
SELECT ?konstverk ?konstverkLabel ?geografiska_koordinater
WHERE {
WHERE {
   ?item wdt:P3 wd:Q9 .
   ?konstverk wdt:P3 wd:Q9 .
   OPTIONAL {
   ?konstverk wdt:P17 ?geografiska_koordinater .
    ?item wdt:P17 ?place.
   SERVICE wikibase:label { bd:serviceParam wikibase:language "sv,en" . }
 
    BIND (xsd:double(strbefore(strafter(str(?coordinates), "("), " ")) AS ?latitude)
    BIND (xsd:double(strbefore(strbefore(strafter(str(?coordinates), " "), ")"), " ")) AS ?longitude)
  }
   SERVICE wikibase:label {
    bd:serviceParam wikibase:language "sv".
  }
}
}
ORDER BY ?itemLabel
LIMIT 100
</sparql>

Latest revision as of 22:29, 21 November 2023

#defaultView:Map
#title:Gumman i Visby
PREFIX wd: <https://swedishmuseum.wikibase.cloud/entity/>
PREFIX wdt: <https://swedishmuseum.wikibase.cloud/prop/direct/>

SELECT ?konstverk ?konstverkLabel ?geografiska_koordinater
WHERE {
  ?konstverk wdt:P3 wd:Q9 .
  ?konstverk wdt:P17 ?geografiska_koordinater .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "sv,en" . }
}
LIMIT 100

Try it!