Query Service: Difference between revisions

From Swedish Museum
(test query)
 
No edit summary
Line 16: Line 16:
}
}
ORDER BY ?itemLabel
ORDER BY ?itemLabel
Ny fråga
PREFIX wd: <https://swedishmuseum.wikibase.cloud/entity/>
PREFIX wdt: <https://swedishmuseum.wikibase.cloud/prop/direct/>
SELECT ?konstverk ?konstverkLabel ?plats
WHERE {
  ?konstverk wdt:P3 wd:Q9 .
  ?konstverk wdt:P17 ?plats .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "sv" . }
}
LIMIT 100

Revision as of 18:37, 20 November 2023

PREFIX wd: <https://swedishmuseum.wikibase.cloud/entity/> PREFIX wdt: <https://swedishmuseum.wikibase.cloud/prop/direct/>

SELECT ?item ?itemLabel ?place ?placeLabel ?latitude ?longitude WHERE {

 ?item wdt:P3 wd:Q9 .
 OPTIONAL {
   ?item wdt:P17 ?place.
  
   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


Ny fråga

PREFIX wd: <https://swedishmuseum.wikibase.cloud/entity/> PREFIX wdt: <https://swedishmuseum.wikibase.cloud/prop/direct/>

SELECT ?konstverk ?konstverkLabel ?plats WHERE {

 ?konstverk wdt:P3 wd:Q9 .
 ?konstverk wdt:P17 ?plats .
 SERVICE wikibase:label { bd:serviceParam wikibase:language "sv" . }

} LIMIT 100