query-7df487a5bf5cade05953b58214743836
Propertiessubclass of (P279)properties for this type (P1963)
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#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
CONSTRUCT {
?class a owl:Class .
?class rdfs:subClassOf ?superclass .
?class rdfs:label ?classLabel .
?property rdfs:domain ?class .
?property rdfs:label ?classLabel .
}
WHERE {
BIND(wd:Q235557 AS ?mainClass) . # Q11344 chemical element; Q1420 automobile
# Pick one or the other of the following two triple patterns.
#?class wdt:P279* ?mainClass. # Find subclasses of the main class.
?mainClass wdt:P279* ?class. # Find superclasses of the main class.
?class wdt:P279 ?superclass . # So we can create rdfs:subClassOf triples
?class rdfs:label ?classLabel.
OPTIONAL {
?class wdt:P1963 ?property.
?property rdfs:label ?propertyLabel.
FILTER((LANG(?propertyLabel)) = "en")
}
FILTER((LANG(?classLabel)) = "en")
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v9("?_const_4592be07_uri")
v8("?_const_7e619dcc_uri")
v10("?_const_9285ccfc_uri"):::projected
v11("?_const_b15747bc_uri")
v7("?_const_f5e5585a_uri")
v4("?class"):::projected
v1("?classLabel"):::projected
v3("?mainClass"):::projected
v6("?property"):::projected
v2("?propertyLabel"):::projected
v5("?superclass"):::projected
f0[["?classLabel = 'en'"]]
f0 --> v1
bind1[/"'wd:Q235557'"/]
bind1 --as--o v3
v3 --"wdt:P279"--> v4
v4 --"wdt:P279"--> v5
v4 --"rdfs:label"--> v1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v4 -."wdt:P1963".-> v6
v6 --"rdfs:label"--> v2
end
bind2[/""a""/]
bind2 --as--o v7
bind3[/"'owl:Class'"/]
bind3 --as--o v8
bind4[/"'rdfs:subClassOf'"/]
bind4 --as--o v9
bind5[/"'rdfs:label'"/]
bind5 --as--o v10
bind6[/"'rdfs:domain'"/]
bind6 --as--o v11