query-4c3631fcdcebfd8af20d6fe3f7fecee0
Possible to search to return list of items, as per website search box?I was wondering if it is possible to use the query service to replicate the search box found on the website. This will return results simple enough - but the ordering needs to be there.
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT distinct ?item ?itemLabel ?itemDescription WHERE {
?item ?label "Michael Jackson"@en.
?article schema:about ?item .
?article schema:inLanguage "en" .
?article schema:isPartOf <https://en.wikipedia.org/>.
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?article")
v1("?item"):::projected
v2("?label")
c1([sMichael Jackson^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#langString>"]):::literal
c6([https://en.wikipedia.org/]):::iri
c8(["bd:serviceParam"]):::iri
c4(["en"]):::literal
v1 -->v2--> c1
v3 --"schema:about"--> v1
v3 --"schema:inLanguage"--> c4
v3 --"schema:isPartOf"--> c6
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c4
end