query-80f94adf1102e1cf52b25c6b3e2c3677
21:16, 9 July 2019 (UTC) dosisEpì, it appears in two rows. Would it be possible forcing the same ?item to appear only in one row, separating in the cells the multiple values with commas? Thank you very much, --(P6862)digilibLT author ID and (P6941)PHI Latin Texts author ID have more than one value, so the same ?item is repeted in two or more rows; moreover, when an item has both (P214)VIAF ID and (P648)Open Library ID , (P4223)Treccani's Enciclopedia Italiana ID In some cases
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel
(GROUP_CONCAT(DISTINCT ?phi1; separator=", ") as ?phi)
(GROUP_CONCAT(DISTINCT ?digilib1; separator=", ") as ?digilib)
(GROUP_CONCAT(DISTINCT ?treccani1; separator=", ") as ?treccani)
(GROUP_CONCAT(DISTINCT ?ei1; separator=", ") as ?ei)
(GROUP_CONCAT(DISTINCT ?ol1; separator=", ") as ?ol)
(GROUP_CONCAT(DISTINCT ?viaf1; separator=", ") as ?viaf)
WHERE
{
{ ?item wdt:P6941 ?phi1 . } UNION { ?item wdt:P6862 ?digilib1 . }
OPTIONAL { ?item wdt:P3365 ?treccani1 . }
OPTIONAL { ?item wdt:P4223 ?ei1 . }
OPTIONAL { ?item wdt:P648 ?ol1 . }
OPTIONAL { ?item wdt:P214 ?viaf1 }
SERVICE wikibase:label { bd:serviceParam wikibase:language "it,en" }
}
GROUP BY ?item ?itemLabel
ORDER BY ?itemLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v10("?digilib")
v4("?digilib1"):::projected
v12("?ei")
v6("?ei1"):::projected
v2("?item"):::projected
v1("?itemLabel"):::projected
v13("?ol")
v7("?ol1"):::projected
v9("?phi")
v3("?phi1"):::projected
v11("?treccani")
v5("?treccani1"):::projected
v14("?viaf")
v8("?viaf1"):::projected
c8(["bd:serviceParam"]):::iri
c10(["it,en"]):::literal
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v2 --"wdt:P6862"--> v4
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v2 --"wdt:P6941"--> v3
end
union0r <== or ==> union0l
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P3365".-> v5
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P4223".-> v6
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P648".-> v7
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P214".-> v8
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end
bind6[/"?phi1"/]
v3 --o bind6
bind6 --as--o v9
bind7[/"?digilib1"/]
v4 --o bind7
bind7 --as--o v10
bind8[/"?treccani1"/]
v5 --o bind8
bind8 --as--o v11
bind9[/"?ei1"/]
v6 --o bind9
bind9 --as--o v12
bind10[/"?ol1"/]
v7 --o bind10
bind10 --as--o v13
bind11[/"?viaf1"/]
v8 --o bind11
bind11 --as--o v14