query-a3b5c3bbfc898f892a242f86dc87e9aa
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX gas: <http://www.bigdata.com/rdf/gas#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Graph
SELECT DISTINCT ?philosopher ?philosopherLabel ?rgb ?student ?studentLabel
WHERE {
SERVICE gas:service {
gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.BFS";
gas:in wd:Q913;
gas:linkType wdt:P802;
gas:traversalDirection "Undirected";
gas:out ?philosopher ;
gas:out1 ?depth ;
gas:out2 ?student .
}
?philosopher wdt:P106 wd:Q4964182 . #restricts the query to students that ended up philosophers themselves
?philosopher wdt:P135 ?school .
BIND (
COALESCE(
IF(?school = wd:Q193589, "FF1700", 1/0), # platonism
IF(?school = wd:Q194414, "33FF3B", 1/0), # peripatetician
IF(?school = wd:Q1126340, "BEFAFF", 1/0), # pyrrhonism
IF(?school = wd:Q179541, "C2CFFF", 1/0), # epicurism
IF(?school = wd:Q1395219, "134d83", 1/0), # scepticism
IF(?school = wd:Q48235, "57FFD2", 1/0), # stoicism
IF(?school = wd:Q1145454, "19A2A2", 1/0), # megarism
IF(?school = wd:Q750192, "F5FE66", 1/0), # cyrenaism
IF(?school = wd:Q485459, "D69A00", 1/0), # cynism
IF(?school = wd:Q1350056, "35A219", 1/0), # eretrian school
IF(?school = wd:Q191359, "976031", 1/0), # pythagorism
IF(?school = wd:Q214577, "913194", 1/0), # eleatics
IF(?school = wd:Q178540, "140714", 1/0), # presocratics (same as pluralists)
IF(?school = wd:Q1275113, "140714", 1/0), # pluralists (same as presocratics
IF(?school = wd:Q178668, "d8a31c", 1/0), # atomists
IF(?school = wd:Q3345153, "1c51d8", 1/0), # New Academy
"FFFFFF"
) AS ?rgb
)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
- https://www.wikidata.org/wiki/Wikidata:WikiProject_Ancient_Greece/Queries
- https://www.wikidata.org/wiki/Wikidata:WikiProject_Antiquity
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?depth")
v1("?philosopher"):::projected
v5("?rgb"):::projected
v4("?school")
v3("?student"):::projected
c2(["gas:program"]):::iri
c8(["wdt:P802"]):::iri
c6(["wd:Q913"]):::iri
c15(["wd:Q4964182"]):::iri
c4(["com.bigdata.rdf.graph.analytics.BFS"]):::literal
c18(["bd:serviceParam"]):::iri
c10(["Undirected"]):::literal
c20(["#91;AUTO_LANGUAGE#93;,en"]):::literal
subgraph s1["http://www.bigdata.com/rdf/gas#service"]
style s1 stroke-width:4px;
c2 --"gas:gasClass"--> c4
c2 --"gas:in"--> c6
c2 --"gas:linkType"--> c8
c2 --"gas:traversalDirection"--> c10
c2 --"gas:out"--> v1
c2 --"gas:out1"--> v2
c2 --"gas:out2"--> v3
end
v1 --"wdt:P106"--> c15
v1 --"wdt:P135"--> v4
bind0[/"if(?school = 'wd:Q193589','FF1700','1^^xsd:integer' / '0^^xsd:integer')if(?school = 'wd:Q194414','33FF3B','1^^xsd:integer' / '0^^xsd:integer')if(?school = 'wd:Q1126340','BEFAFF','1^^xsd:integer' / '0^^xsd:integer')if(?school = 'wd:Q179541','C2CFFF','1^^xsd:integer' / '0^^xsd:integer')if(?school = 'wd:Q1395219','134d83','1^^xsd:integer' / '0^^xsd:integer')if(?school = 'wd:Q48235','57FFD2','1^^xsd:integer' / '0^^xsd:integer')if(?school = 'wd:Q1145454','19A2A2','1^^xsd:integer' / '0^^xsd:integer')if(?school = 'wd:Q750192','F5FE66','1^^xsd:integer' / '0^^xsd:integer')if(?school = 'wd:Q485459','D69A00','1^^xsd:integer' / '0^^xsd:integer')if(?school = 'wd:Q1350056','35A219','1^^xsd:integer' / '0^^xsd:integer')if(?school = 'wd:Q191359','976031','1^^xsd:integer' / '0^^xsd:integer')if(?school = 'wd:Q214577','913194','1^^xsd:integer' / '0^^xsd:integer')if(?school = 'wd:Q178540','140714','1^^xsd:integer' / '0^^xsd:integer')if(?school = 'wd:Q1275113','140714','1^^xsd:integer' / '0^^xsd:integer')if(?school = 'wd:Q178668','d8a31c','1^^xsd:integer' / '0^^xsd:integer')if(?school = 'wd:Q3345153','1c51d8','1^^xsd:integer' / '0^^xsd:integer')'FFFFFF'"/]
v4 --o bind0
bind0 --as--o v5
subgraph s2["http://wikiba.se/ontology#label"]
style s2 stroke-width:4px;
c18 --"wikibase:language"--> c20
end