query-181980d8bb5082d477acc8fbf621467c

rq turtle/ttl

cementiris de la Catalunya Nord (label ca i fr) SELECT ?item ?itemLabelca ?itemLabelfr ?mun ?munLabelca ?munLabelfr WHERE {
?com wdt:P31 wd:Q3573632. {?item wdt:P17 wd:Q142. ?com wdt:P150 ?mun. {?item wdt:P131 ?mun.} UNION {?mun wdt:P206 ?item.} } UNION { {?com wdt:P206 ?item} UNION {?item wdt:P131 ?com} } ?item wdt:P31 wd:Q39614. SERVICE wikibase:label { bd:serviceParam wikibase:language "ca" . ?item rdfs:label ?itemLabelca. ?mun rdfs:label ?munLabelca. } SERVICE wikibase:label { bd:serviceParam wikibase:language "fr". ?item rdfs:label ?itemLabelfr. ?mun rdfs:label ?munLabelfr. } }

Use at

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 bd: <http://www.bigdata.com/rdf#>
# cementiris de la Catalunya Nord (label ca i fr)
SELECT ?item ?itemLabelca ?itemLabelfr ?mun ?munLabelca ?munLabelfr WHERE {   
  ?com wdt:P31 wd:Q3573632.
  {?item wdt:P17 wd:Q142.
  ?com wdt:P150 ?mun.
  {?item wdt:P131* ?mun.}
   UNION
   {?mun wdt:P206 ?item.}
  }
   UNION
   {
   {?com wdt:P206 ?item}
   UNION 
   {?item wdt:P131* ?com}
  }
  ?item wdt:P31 wd:Q39614.
SERVICE wikibase:label {
bd:serviceParam wikibase:language "ca" .
?item rdfs:label ?itemLabelca.
?mun rdfs:label ?munLabelca.
}
SERVICE wikibase:label {
bd:serviceParam wikibase:language "fr".
?item  rdfs:label ?itemLabelfr.
?mun rdfs:label ?munLabelfr.
}
  }

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?com") v2("?item"):::projected v4("?itemLabelca"):::projected v6("?itemLabelfr"):::projected v3("?mun"):::projected v5("?munLabelca"):::projected v7("?munLabelfr"):::projected c14(["fr"]):::literal c2(["wd:Q3573632"]):::iri c10(["bd:serviceParam"]):::iri c8(["wd:Q39614"]):::iri c12(["ca"]):::literal c4(["wd:Q142"]):::iri v1 --"wdt:P31"--> c2 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P131"--> v1 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P206"--> v2 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P17"--> c4 v1 --"wdt:P150"--> v3 subgraph union2[" Union "] subgraph union2l[" "] style union2l fill:#abf,stroke-dasharray: 3 3; v3 --"wdt:P206"--> v2 end subgraph union2r[" "] style union2r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P131"--> v3 end union2r <== or ==> union2l end end union0r <== or ==> union0l end v2 --"wdt:P31"--> c8 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 --"wikibase:language"--> c12 v2 --"rdfs:label"--> v4 v3 --"rdfs:label"--> v5 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 --"wikibase:language"--> c14 v2 --"rdfs:label"--> v6 v3 --"rdfs:label"--> v7 end