query-64262ad8e191918879da6d97a9774cbd
How to get all categories of a string literal in wikidata?Hi I am trying to find all categories of a string literal using wikidata. Example "Jaguar" shows in category section "British | brandsCar | brandsJaguar | CarsJaguar | vehicles". So is there a way that I can type in a string literal and it can give me the categories. 22:16, 12 June 2018 (UTC)) talk (Tagishsimon might do what you want, but I'm sufficiently unfamiliar with it to be of little use. --quarryWikidata does not have any data on the categories of a wikipedia article. So nothing doing here, I'm afraid. It's possible that a report in If in what you are interested is just in category labels, as I figure, your query is near to:
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?item ?txtcat WHERE {
?item wdt:P31 wd:Q4167836 .
?item rdfs:label ?txtcat .
FILTER(CONTAINS(STR(?txtcat), "Jaguar")) .
}
LIMIT 50
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?item"):::projected
v1("?txtcat"):::projected
c3(["wd:Q4167836"]):::iri
f0[["contains(str(?txtcat),'Jaguar')"]]
f0 --> v1
v2 --"wdt:P31"--> c3
v2 --"rdfs:label"--> v1