Project:SPARQL/examples: Difference between revisions

From MetaBase
Jump to navigation Jump to search
(Created page with "<SPARQL> PREFIX wb: <https://metabase.wikibase.cloud/entity/> PREFIX wbt: <https://metabase.wikibase.cloud/prop/direct/> SELECT ?item ?itemLabel ?same_wikidata ?wikidata_iri ?url WHERE { ?item wbt:P5 wb:Q23 . ?item wbt:P1 ?same_wikidata. BIND(URI(concat("http://www.wikidata.org/entity/",?same_wikidata)) AS ?wikidata_iri) SERVICE <https://query.wikidata.org/sparql> { ?wikidata_iri wdt:P856 ?url } SERVICE wikibase:label { bd:serviceParam wikibase:language "sv,en". } }...")
 
No edit summary
Line 1: Line 1:
<SPARQL>
<SPARQL tryit="1">
PREFIX wb: <https://metabase.wikibase.cloud/entity/>
PREFIX wb: <https://metabase.wikibase.cloud/entity/>
PREFIX wbt: <https://metabase.wikibase.cloud/prop/direct/>
PREFIX wbt: <https://metabase.wikibase.cloud/prop/direct/>

Revision as of 14:34, 24 April 2023

PREFIX wb: <https://metabase.wikibase.cloud/entity/>
PREFIX wbt: <https://metabase.wikibase.cloud/prop/direct/>

SELECT ?item ?itemLabel ?same_wikidata ?wikidata_iri ?url
WHERE
{
?item wbt:P5 wb:Q23 .
?item wbt:P1 ?same_wikidata.

BIND(URI(concat("http://www.wikidata.org/entity/",?same_wikidata)) AS ?wikidata_iri)

SERVICE <https://query.wikidata.org/sparql> {
 ?wikidata_iri wdt:P856 ?url
}

SERVICE wikibase:label { bd:serviceParam wikibase:language "sv,en". }
}

Try it!