query-8c70ea4326ca162c5a2a4df0ec7ee109
Mitja dotzena de variables, enllaçades sense repeticions SELECT DISTINCT ?item ?itemLabel ?detall WHERE { ?item wdt:P17 wd:Q29. ?item wdt:P131+ wd:Q1765582.
OPTIONAL {
{ { { { {
?item wdt:P84 ?dada.
?dada rdfs:label ?dadaEtiq.
FILTER(LANG(?dadaEtiq)="ca")
OPTIONAL {
?dadaLink schema:isPartOf https://ca.wikipedia.org/;
schema:about ?dada.
BIND (REPLACE(REPLACE(wikibase:decodeUri(STR(?dadaLink)), "https://ca.wikipedia.org/wiki/", "", "i"), "", " ") as ?dadaEnll)
BIND (CONCAT("[[",str(?dadaEnll),"]]") as ?dadaWiki)
}
BIND(COALESCE(?dadaWiki, ?dadaEtiq) as ?dadaNet)
BIND(CONCAT("Arquitecte: ",?dadaNet) as ?detall)
}
UNION
{
?item wdt:P170 ?dada.
?dada rdfs:label ?dadaEtiq.
FILTER(LANG(?dadaEtiq)="ca")
OPTIONAL {
?dadaLink schema:isPartOf https://ca.wikipedia.org/;
schema:about ?dada.
BIND (REPLACE(REPLACE(wikibase:decodeUri(STR(?dadaLink)), "https://ca.wikipedia.org/wiki/", "", "i"), "", " ") as ?dadaEnll)
BIND (CONCAT("[[",str(?dadaEnll),"]]") as ?dadaWiki)
}
BIND(COALESCE(?dadaWiki, ?dadaEtiq) as ?dadaNet)
BIND(CONCAT("Creador: ",?dadaNet) as ?detall)
} }
UNION
{
?item wdt:P149 ?dada.
?dada rdfs:label ?dadaEtiq.
FILTER(LANG(?dadaEtiq)="ca")
OPTIONAL {
?dadaLink schema:isPartOf https://ca.wikipedia.org/;
schema:about ?dada.
BIND (REPLACE(REPLACE(wikibase:decodeUri(STR(?dadaLink)), "https://ca.wikipedia.org/wiki/", "", "i"), "", " ") as ?dadaEnll)
BIND (CONCAT("[[",str(?dadaEnll),"]]") as ?dadaWiki)
}
BIND(COALESCE(?dadaWiki, ?dadaEtiq) as ?dadaNet)
BIND(CONCAT("Estil: ",?dadaNet) as ?detall)
} }
UNION
{
?item wdt:P135 ?dada.
?dada rdfs:label ?dadaEtiq.
FILTER(LANG(?dadaEtiq)="ca")
OPTIONAL {
?dadaLink schema:isPartOf https://ca.wikipedia.org/;
schema:about ?dada.
BIND (REPLACE(REPLACE(wikibase:decodeUri(STR(?dadaLink)), "https://ca.wikipedia.org/wiki/", "", "i"), "", " ") as ?dadaEnll)
BIND (CONCAT("[[",str(?dadaEnll),"]]") as ?dadaWiki)
}
BIND(COALESCE(?dadaWiki, ?dadaEtiq) as ?dadaNet)
BIND(CONCAT("Estil artístic: ",?dadaNet) as ?detall)
} }
UNION
{
?item wdt:P5816 ?dada.
?dada rdfs:label ?dadaEtiq.
FILTER(LANG(?dadaEtiq)="ca")
OPTIONAL {
?dadaLink schema:isPartOf https://ca.wikipedia.org/;
schema:about ?dada.
BIND (REPLACE(REPLACE(wikibase:decodeUri(STR(?dadaLink)), "https://ca.wikipedia.org/wiki/", "", "i"), "", " ") as ?dadaEnll)
BIND (CONCAT("[[",str(?dadaEnll),"]]") as ?dadaWiki)
}
BIND(COALESCE(?dadaWiki, ?dadaEtiq) as ?dadaNet)
BIND(CONCAT("Estat: ",?dadaNet) as ?detall)
} }
UNION
{
?item wdt:P10241 ?dada.
?dada rdfs:label ?dadaEtiq.
FILTER(LANG(?dadaEtiq)="ca")
OPTIONAL {
?dadaLink schema:isPartOf https://ca.wikipedia.org/;
schema:about ?dada.
BIND (REPLACE(REPLACE(wikibase:decodeUri(STR(?dadaLink)), "https://ca.wikipedia.org/wiki/", "", "i"), "", " ") as ?dadaEnll)
BIND (CONCAT("[[",str(?dadaEnll),"]]") as ?dadaWiki)
}
BIND(COALESCE(?dadaWiki, ?dadaEtiq) as ?dadaNet)
BIND(CONCAT("Tàxon: ",?dadaNet) as ?detall)
}
} SERVICE wikibase:label {bd:serviceParam wikibase:language "ca,en" .} } ORDER BY ?itemLabel
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 schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
# Mitja dotzena de variables, enllaçades sense repeticions
SELECT DISTINCT ?item ?itemLabel ?detall WHERE {
?item wdt:P17 wd:Q29.
?item wdt:P131+ wd:Q1765582.
OPTIONAL {
{ { { { {
?item wdt:P84 ?dada.
?dada rdfs:label ?dadaEtiq.
FILTER(LANG(?dadaEtiq)="ca")
OPTIONAL {
?dadaLink schema:isPartOf <https://ca.wikipedia.org/>;
schema:about ?dada.
BIND (REPLACE(REPLACE(wikibase:decodeUri(STR(?dadaLink)), "https://ca.wikipedia.org/wiki/", "", "i"), "_", " ") as ?dadaEnll)
BIND (CONCAT("[[",str(?dadaEnll),"]]") as ?dadaWiki)
}
BIND(COALESCE(?dadaWiki, ?dadaEtiq) as ?dadaNet)
BIND(CONCAT("Arquitecte: ",?dadaNet) as ?detall)
}
UNION
{
?item wdt:P170 ?dada.
?dada rdfs:label ?dadaEtiq.
FILTER(LANG(?dadaEtiq)="ca")
OPTIONAL {
?dadaLink schema:isPartOf <https://ca.wikipedia.org/>;
schema:about ?dada.
BIND (REPLACE(REPLACE(wikibase:decodeUri(STR(?dadaLink)), "https://ca.wikipedia.org/wiki/", "", "i"), "_", " ") as ?dadaEnll)
BIND (CONCAT("[[",str(?dadaEnll),"]]") as ?dadaWiki)
}
BIND(COALESCE(?dadaWiki, ?dadaEtiq) as ?dadaNet)
BIND(CONCAT("Creador: ",?dadaNet) as ?detall)
} }
UNION
{
?item wdt:P149 ?dada.
?dada rdfs:label ?dadaEtiq.
FILTER(LANG(?dadaEtiq)="ca")
OPTIONAL {
?dadaLink schema:isPartOf <https://ca.wikipedia.org/>;
schema:about ?dada.
BIND (REPLACE(REPLACE(wikibase:decodeUri(STR(?dadaLink)), "https://ca.wikipedia.org/wiki/", "", "i"), "_", " ") as ?dadaEnll)
BIND (CONCAT("[[",str(?dadaEnll),"]]") as ?dadaWiki)
}
BIND(COALESCE(?dadaWiki, ?dadaEtiq) as ?dadaNet)
BIND(CONCAT("Estil: ",?dadaNet) as ?detall)
} }
UNION
{
?item wdt:P135 ?dada.
?dada rdfs:label ?dadaEtiq.
FILTER(LANG(?dadaEtiq)="ca")
OPTIONAL {
?dadaLink schema:isPartOf <https://ca.wikipedia.org/>;
schema:about ?dada.
BIND (REPLACE(REPLACE(wikibase:decodeUri(STR(?dadaLink)), "https://ca.wikipedia.org/wiki/", "", "i"), "_", " ") as ?dadaEnll)
BIND (CONCAT("[[",str(?dadaEnll),"]]") as ?dadaWiki)
}
BIND(COALESCE(?dadaWiki, ?dadaEtiq) as ?dadaNet)
BIND(CONCAT("Estil artístic: ",?dadaNet) as ?detall)
} }
UNION
{
?item wdt:P5816 ?dada.
?dada rdfs:label ?dadaEtiq.
FILTER(LANG(?dadaEtiq)="ca")
OPTIONAL {
?dadaLink schema:isPartOf <https://ca.wikipedia.org/>;
schema:about ?dada.
BIND (REPLACE(REPLACE(wikibase:decodeUri(STR(?dadaLink)), "https://ca.wikipedia.org/wiki/", "", "i"), "_", " ") as ?dadaEnll)
BIND (CONCAT("[[",str(?dadaEnll),"]]") as ?dadaWiki)
}
BIND(COALESCE(?dadaWiki, ?dadaEtiq) as ?dadaNet)
BIND(CONCAT("Estat: ",?dadaNet) as ?detall)
} }
UNION
{
?item wdt:P10241 ?dada.
?dada rdfs:label ?dadaEtiq.
FILTER(LANG(?dadaEtiq)="ca")
OPTIONAL {
?dadaLink schema:isPartOf <https://ca.wikipedia.org/>;
schema:about ?dada.
BIND (REPLACE(REPLACE(wikibase:decodeUri(STR(?dadaLink)), "https://ca.wikipedia.org/wiki/", "", "i"), "_", " ") as ?dadaEnll)
BIND (CONCAT("[[",str(?dadaEnll),"]]") as ?dadaWiki)
}
BIND(COALESCE(?dadaWiki, ?dadaEtiq) as ?dadaNet)
BIND(CONCAT("Tàxon: ",?dadaNet) as ?detall)
}
}
SERVICE wikibase:label {bd:serviceParam wikibase:language "ca,en" .}
}
ORDER BY ?itemLabel