query-aa0120349f12a7ade4405ede3d9f5c28
The following query precisely gives me Apple Inc, which I'm looking for -
Use at
- https://query.wikidata.org/sparql
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?itemLabel ?typeOfOrg ?typeOfOrgLabel ?desc WHERE {
?item wdt:P31 ?typeOfOrg .
?typeOfOrg wdt:P31/wdt:P279* ?superclasses.
?item ?label "Apple"@en .
VALUES ?superclasses { wd:Q17197366 wd:Q43229 wd:Q4830453 wd:Q431289 }
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en".
?item rdfs:label ?itemLabel .
?typeOfOrg rdfs:label ?typeOfOrgLabel .
?item schema:description ?desc .
}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v7("?desc"):::projected
v1("?item"):::projected
v5("?itemLabel"):::projected
v4("?label")
v5("?superclasses")
v2("?typeOfOrg"):::projected
v6("?typeOfOrgLabel"):::projected
a1((" "))
c3([sApple^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#langString>"]):::literal
c5(["bd:serviceParam"]):::iri
c7(["en"]):::literal
v1 --"wdt:P31"--> v2
v2 --"wdt:P31"--> a1
a1 --"wdt:P279"--> v5
v1 -->v4--> c3
bind0[/VALUES ?superclasses/]
bind0-->v5
bind00(["wd:Q17197366"])
bind00 --> bind0
bind01(["wd:Q43229"])
bind01 --> bind0
bind02(["wd:Q4830453"])
bind02 --> bind0
bind03(["wd:Q431289"])
bind03 --> bind0
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c5 --"wikibase:language"--> c7
v1 --"rdfs:label"--> v5
v2 --"rdfs:label"--> v6
v1 --"schema:description"--> v7
end