query-5fdc229846469d45a1d4ce4dcc7d4b46
De-duplication help neededI have not properly learned to de-duplicate SPARQL query results where several properties have several values, so I am asking for help. Here's the query with no de-duplication efforts at all:
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 bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?rkyid ?type ?mjid ?rpid ?rprid ?coords ?ark ?arkLabel ?loc ?locLabel ?pof ?pofLabel ?img ?her ?herLabel ?vtjprt WHERE {
?item (wdt:P1435/wdt:P279*) wd:Q55845509.
?item wdt:P1435 ?her.
OPTIONAL { ?item wdt:P31 ?type. }
OPTIONAL { ?item wdt:P4009 ?rkyid. }
OPTIONAL { ?item wdt:P18 ?img. }
OPTIONAL { ?item wdt:P4106 ?mjid. }
OPTIONAL { ?item wdt:P5310 ?rpid. }
OPTIONAL { ?item wdt:P5313 ?rprid. }
OPTIONAL { ?item wdt:P361 ?pof. }
OPTIONAL { ?item wdt:P3824 ?vtjprt. }
OPTIONAL { ?item wdt:P131 ?loc. }
OPTIONAL { ?item wdt:P625 ?coords. }
OPTIONAL { ?item wdt:P84 ?ark. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "fi". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v13("?ark"):::projected
v12("?coords"):::projected
v2("?her"):::projected
v5("?img"):::projected
v1("?item"):::projected
v11("?loc"):::projected
v6("?mjid"):::projected
v9("?pof"):::projected
v4("?rkyid"):::projected
v7("?rpid"):::projected
v8("?rprid"):::projected
v3("?type"):::projected
v10("?vtjprt"):::projected
a1((" "))
c18(["fi"]):::literal
c16(["bd:serviceParam"]):::iri
c3(["wd:Q55845509"]):::iri
v1 --"wdt:P1435"--> a1
a1 --"wdt:P279"--> c3
v1 --"wdt:P1435"--> v2
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P31".-> v3
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P4009".-> v4
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P18".-> v5
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P4106".-> v6
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P5310".-> v7
end
subgraph optional5["(optional)"]
style optional5 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P5313".-> v8
end
subgraph optional6["(optional)"]
style optional6 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P361".-> v9
end
subgraph optional7["(optional)"]
style optional7 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P3824".-> v10
end
subgraph optional8["(optional)"]
style optional8 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P131".-> v11
end
subgraph optional9["(optional)"]
style optional9 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P625".-> v12
end
subgraph optional10["(optional)"]
style optional10 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P84".-> v13
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c16 --"wikibase:language"--> c18
end