Skip to content

Ejemplos queries WikiData

Uniovi283728 edited this page Mar 1, 2024 · 1 revision

Pillar respuesta correcta (Capital de Francia)

SELECT DISTINCT ?item ?itemLabel # if only the number is needed WHERE { ?item wdt:P1376 wd:Q142. # capitalof France ?item wdt:P31 wd:Q5119. # instanceof capital SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }

Pillar lista incorrectas (capitales no de Francia)

SELECT DISTINCT ?item ?itemLabel # if only the number is needed WHERE { minus{?item wdt:P1376 wd:Q142.} #minus capitalof France ?item wdt:P31 wd:Q5119.# instanceof capital SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }

Pillar lista incorrectas (ciudades de Francia que no son capitales)

SELECT DISTINCT ?item ?itemLabel # if only the number is needed WHERE { ?item wdt:P17 wd:Q142. # country France minus{?item wdt:P31 wd:Q5119.} #minus instanceof capital ?item wdt:P31 wd:Q1549591. #instanceof big city SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }

Clone this wiki locally