query-aa3f1404f558472f08dfe63943a674ed

rq turtle/ttl

Topics that are studied by both a discipline and a specialisation of that discipline

SELECT distinct ?topic ?discipline ?subdiscipline ?topicLabel ?disciplineLabel ?subdisciplineLabel WHERE {

?topic wdt:P2578|^wdt:P2579 ?discipline,?subdiscipline. SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } ?subdiscipline (wdt:P361)+|(wdt:P279)+ ?discipline . }

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# Topics that are studied by both a discipline and a specialisation of that discipline

SELECT distinct ?topic ?discipline  ?subdiscipline ?topicLabel ?disciplineLabel ?subdisciplineLabel WHERE {

  ?topic wdt:P2578|^wdt:P2579 ?discipline,?subdiscipline.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  ?subdiscipline (wdt:P361)+|(wdt:P279)+ ?discipline .
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?discipline"):::projected v3("?subdiscipline"):::projected v1("?topic"):::projected c4(["bd:serviceParam"]):::iri c6(["#91;AUTO_LANGUAGE#93;,en"]):::literal subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P2579"--> v1 v3 --"wdt:P2579"--> v1 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P2578"--> v2 v1 --"wdt:P2578"--> v3 end union0r <== or ==> union0l end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c4 --"wikibase:language"--> c6 end subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; v3 --"wdt:P279"--> v2 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v3 --"wdt:P361"--> v2 end union1r <== or ==> union1l end