query-9f89ef771c6e1f92f293a57870cb2302
Filter output by just one column column. ?editor field. Basically applying DISTINCT but only for the ?editorI'm looking to filter the output of this query to remove duplicates in the
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?layer ?editor ?editorLabel ?employer ?employerLabel ?coord ?image WHERE {
# Fetch data
?WikiJournal wdt:P123 wd:Q28953974 . # journals in WJ user group
?WikiJournal p:P5769|p:P98 ?editorstm. # journal's current editor(s) & EiC(s)
?editorstm ps:P5769|ps:P98 ?editor .
?editor wdt:P551 ?residence. ?residence wdt:P625 ?coord. # editor's current resicence(s) if stated
# Fetch lables
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". ?WikiJournal rdfs:label ?layer.}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?WikiJournal")
v5("?coord"):::projected
v3("?editor"):::projected
v2("?editorstm")
v6("?layer"):::projected
v4("?residence")
c2(["wd:Q28953974"]):::iri
c10(["bd:serviceParam"]):::iri
c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal
v1 --"p:direct/P123"--> c2
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v1 --"p:P98"--> v2
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v1 --"p:P5769"--> v2
end
union0r <== or ==> union0l
end
subgraph union1[" Union "]
subgraph union1l[" "]
style union1l fill:#abf,stroke-dasharray: 3 3;
v2 --"p:statement/P98"--> v3
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
v2 --"p:statement/P5769"--> v3
end
union1r <== or ==> union1l
end
v3 --"p:direct/P551"--> v4
v4 --"p:direct/P625"--> v5
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
v1 --"rdfs:label"--> v6
end