query-0404861bc0b5daf7f175d1cc54dc7fcd
find a string in the description that isn't in the label
SELECT ?search ?item ?itemLabel ?itemDescription ?instanceof ?instanceofLabel WHERE { VALUES ?text { "UNIQ" } BIND ( CONCAT(?text, ' hasdescription:en -inlabel:"', ?text, '"') as ?search ) SERVICE wikibase:mwapi # max. 10000 { bd:serviceParam wikibase:api "Search" . bd:serviceParam wikibase:endpoint "www.wikidata.org" . bd:serviceParam mwapi:srnamespace "0" . bd:serviceParam mwapi:srsearch ?search . ?item wikibase:apiOutputItem mwapi:title. } FILTER EXISTS { ?item schema:description ?desc . FILTER( lang(?desc)="en" && CONTAINS( ?desc, ?text) ) } OPTIONAL {?item wdt:P31 wd:instanceof } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .} } ORDER BY deSC(?check_text)
Use at
- https://query.wikidata.org/sparql
PREFIX mwapi: <http://wikiba.se/ontology#>
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 bd: <http://www.bigdata.com/rdf#>
# find a string in the description that isn't in the label
SELECT
?search
?item ?itemLabel ?itemDescription
?instanceof ?instanceofLabel
WHERE
{
VALUES ?text { "UNIQ" }
BIND ( CONCAT(?text, ' hasdescription:en -inlabel:"', ?text, '"') as ?search )
SERVICE wikibase:mwapi # max. 10000
{
bd:serviceParam wikibase:api "Search" .
bd:serviceParam wikibase:endpoint "www.wikidata.org" .
bd:serviceParam mwapi:srnamespace "0" .
bd:serviceParam mwapi:srsearch ?search .
?item wikibase:apiOutputItem mwapi:title.
}
FILTER EXISTS { ?item schema:description ?desc .
FILTER( lang(?desc)="en" && CONTAINS( ?desc, ?text) )
}
OPTIONAL {?item wdt:P31 wd:instanceof }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .}
}
ORDER BY deSC(?check_text)