query-fd0fb191b131c310f86d1f3a98ee7b4d

rq turtle/ttl

Arquitecte i estil i més enllaçats SELECT DISTINCT ?item ?itemLabel ?detall ?arqEtiq ?arqLink ?arqNet ?estilEtiq ?estilLink ?estilNet WHERE { ?item wdt:P17 wd:Q29. ?item wdt:P131+ wd:Q1765582.

OPTIONAL { ?item wdt:P84 ?arq. ?arq rdfs:label ?arqEtiq. FILTER(LANG(?arqEtiq)="ca") OPTIONAL {
?arqLink schema:isPartOf https://ca.wikipedia.org/; schema:about ?arq. BIND (REPLACE(REPLACE(wikibase:decodeUri(STR(?arqLink)), "https://ca.wikipedia.org/wiki/", "", "i"), "_", " ") as ?arqEnll) BIND (CONCAT("[[",str(?arqEnll),"]]") as ?arqWiki)
} BIND(COALESCE(?arqWiki, ?arqEtiq) as ?arqNet) }

OPTIONAL { ?item wdt:P149 ?estil. ?estil rdfs:label ?estilEtiq. FILTER(LANG(?estilEtiq)="ca") OPTIONAL {
?estilLink schema:isPartOf https://ca.wikipedia.org/; schema:about ?estil. BIND (REPLACE(REPLACE(wikibase:decodeUri(STR(?estilLink)), "https://ca.wikipedia.org/wiki/", "", "i"), "_", " ") as ?estilEnll) BIND (CONCAT("[[",str(?estilEnll),"]]") as ?estilWiki)
} BIND(COALESCE(?estilWiki, ?estilEtiq) as ?estilNet) }

OPTIONAL { ?item wdt:P170 ?creador. ?creador rdfs:label ?creadorEtiq. FILTER(LANG(?creadorEtiq)="ca") OPTIONAL {
?creadorLink schema:isPartOf https://ca.wikipedia.org/; schema:about ?creador. BIND (REPLACE(REPLACE(wikibase:decodeUri(STR(?creadorLink)), "https://ca.wikipedia.org/wiki/", "", "i"), "_", " ") as ?creadorEnll) BIND (CONCAT("[[",str(?creadorEnll),"]]") as ?creadorWiki)
} BIND(COALESCE(?creadorWiki, ?creadorEtiq) as ?creadorNet) }

OPTIONAL { ?item wdt:P10241 ?taxon. ?taxon rdfs:label ?taxonEtiq. FILTER(LANG(?taxonEtiq)="ca") OPTIONAL {
?taxonLink schema:isPartOf https://ca.wikipedia.org/; schema:about ?taxon. BIND (REPLACE(REPLACE(wikibase:decodeUri(STR(?taxonLink)), "https://ca.wikipedia.org/wiki/", "", "i"), "_", " ") as ?taxonEnll) BIND (CONCAT("[[",str(?taxonEnll),"]]") as ?taxonWiki)
} BIND(COALESCE(?taxonWiki, ?taxonEtiq) as ?taxonNet) }

OPTIONAL { ?item wdt:P5816 ?cons. ?cons rdfs:label ?consEtiq. FILTER(LANG(?consEtiq)="ca") OPTIONAL {
?consLink schema:isPartOf https://ca.wikipedia.org/; schema:about ?cons. BIND (REPLACE(REPLACE(wikibase:decodeUri(STR(?consLink)), "https://ca.wikipedia.org/wiki/", "", "i"), "_", " ") as ?consEnll) BIND (CONCAT("[[",str(?consEnll),"]]") as ?consWiki)
} BIND(COALESCE(?consWiki, ?consEtiq) as ?consNet) }

BIND(CONCAT(IF(BOUND(?taxonEtiq),CONCAT("Tàxon: ",?taxonNet,""),""), IF(BOUND(?creadorEtiq),CONCAT("Creador: ",?creadorNet,""),""), IF(BOUND(?arqEtiq),CONCAT("Arquitecte: ",?arqNet,""),""), IF(BOUND(?estilEtiq),CONCAT("Estil: ",?estilNet,""),""), IF(BOUND(?consEtiq),CONCAT("Estat: ",?consNet),"")) as ?detall) SERVICE wikibase:label {bd:serviceParam wikibase:language "ca,en" .} } ORDER BY ?itemLabel

Use at

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#>
# Arquitecte i estil i més enllaçats
SELECT DISTINCT ?item ?itemLabel ?detall ?arqEtiq ?arqLink ?arqNet ?estilEtiq ?estilLink ?estilNet WHERE {
  ?item wdt:P17 wd:Q29.
  ?item wdt:P131+ wd:Q1765582.

  OPTIONAL {
  ?item wdt:P84 ?arq.
  ?arq rdfs:label ?arqEtiq.
  FILTER(LANG(?arqEtiq)="ca")
    OPTIONAL {  
      ?arqLink schema:isPartOf <https://ca.wikipedia.org/>;
      schema:about ?arq.
      BIND (REPLACE(REPLACE(wikibase:decodeUri(STR(?arqLink)), "https://ca.wikipedia.org/wiki/", "", "i"), "_", " ") as ?arqEnll)
      BIND (CONCAT("[[",str(?arqEnll),"]]") as ?arqWiki)   
    }
    BIND(COALESCE(?arqWiki, ?arqEtiq) as ?arqNet)
  }

  OPTIONAL {
  ?item wdt:P149 ?estil.
  ?estil rdfs:label ?estilEtiq.
  FILTER(LANG(?estilEtiq)="ca")
    OPTIONAL {  
      ?estilLink schema:isPartOf <https://ca.wikipedia.org/>;
      schema:about ?estil.
      BIND (REPLACE(REPLACE(wikibase:decodeUri(STR(?estilLink)), "https://ca.wikipedia.org/wiki/", "", "i"), "_", " ") as ?estilEnll)
      BIND (CONCAT("[[",str(?estilEnll),"]]") as ?estilWiki)   
    }
    BIND(COALESCE(?estilWiki, ?estilEtiq) as ?estilNet)
  }

  OPTIONAL {
  ?item wdt:P170 ?creador.
  ?creador rdfs:label ?creadorEtiq.
  FILTER(LANG(?creadorEtiq)="ca")
    OPTIONAL {  
      ?creadorLink schema:isPartOf <https://ca.wikipedia.org/>;
      schema:about ?creador.
      BIND (REPLACE(REPLACE(wikibase:decodeUri(STR(?creadorLink)), "https://ca.wikipedia.org/wiki/", "", "i"), "_", " ") as ?creadorEnll)
      BIND (CONCAT("[[",str(?creadorEnll),"]]") as ?creadorWiki)   
    }
    BIND(COALESCE(?creadorWiki, ?creadorEtiq) as ?creadorNet)
  }

  OPTIONAL {
  ?item wdt:P10241 ?taxon.
  ?taxon rdfs:label ?taxonEtiq.
  FILTER(LANG(?taxonEtiq)="ca")
    OPTIONAL {  
      ?taxonLink schema:isPartOf <https://ca.wikipedia.org/>;
      schema:about ?taxon.
      BIND (REPLACE(REPLACE(wikibase:decodeUri(STR(?taxonLink)), "https://ca.wikipedia.org/wiki/", "", "i"), "_", " ") as ?taxonEnll)
      BIND (CONCAT("[[",str(?taxonEnll),"]]") as ?taxonWiki)   
    }
    BIND(COALESCE(?taxonWiki, ?taxonEtiq) as ?taxonNet)
  }

  OPTIONAL {
  ?item wdt:P5816 ?cons.
  ?cons rdfs:label ?consEtiq.
  FILTER(LANG(?consEtiq)="ca")
    OPTIONAL {  
      ?consLink schema:isPartOf <https://ca.wikipedia.org/>;
      schema:about ?cons.
      BIND (REPLACE(REPLACE(wikibase:decodeUri(STR(?consLink)), "https://ca.wikipedia.org/wiki/", "", "i"), "_", " ") as ?consEnll)
      BIND (CONCAT("[[",str(?consEnll),"]]") as ?consWiki)   
    }
    BIND(COALESCE(?consWiki, ?consEtiq) as ?consNet)
  }

  BIND(CONCAT(IF(BOUND(?taxonEtiq),CONCAT("Tàxon: ",?taxonNet,"</br>"),""), 
              IF(BOUND(?creadorEtiq),CONCAT("Creador: ",?creadorNet,"</br>"),""), 
              IF(BOUND(?arqEtiq),CONCAT("Arquitecte: ",?arqNet,"</br>"),""), 
              IF(BOUND(?estilEtiq),CONCAT("Estil: ",?estilNet,"</br>"),""), 
              IF(BOUND(?consEtiq),CONCAT("Estat: ",?consNet),"")) as ?detall)
  SERVICE wikibase:label {bd:serviceParam wikibase:language "ca,en" .}
}
ORDER BY ?itemLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v8("?arq") v10("?arqEnll") v6("?arqEtiq"):::projected v9("?arqLink"):::projected v12("?arqNet"):::projected v11("?arqWiki") v28("?cons") v30("?consEnll") v2("?consEtiq") v29("?consLink") v32("?consNet") v31("?consWiki") v18("?creador") v20("?creadorEnll") v4("?creadorEtiq") v19("?creadorLink") v22("?creadorNet") v21("?creadorWiki") v33("?detall"):::projected v13("?estil") v15("?estilEnll") v5("?estilEtiq"):::projected v14("?estilLink"):::projected v17("?estilNet"):::projected v16("?estilWiki") v7("?item"):::projected v1("?itemLabel"):::projected v23("?taxon") v25("?taxonEnll") v3("?taxonEtiq") v24("?taxonLink") v27("?taxonNet") v26("?taxonWiki") c18(["ca,en"]):::literal c5(["wd:Q1765582"]):::iri c9([https://ca.wikipedia.org/]):::iri c3(["wd:Q29"]):::iri c16(["bd:serviceParam"]):::iri v7 --"wdt:P17"--> c3 v7 --"wdt:P131"--> c5 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v7 -."wdt:P84".-> v8 v8 --"rdfs:label"--> v6 subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v9 -."schema:isPartOf".-> c9 v9 --"schema:about"--> v8 bind0[/"replace(replace(http://wikiba.se/ontology#decodeUri(str(?arqLink)),'https://ca.wikipedia.org/wiki/','','i'),'_',' ')"/] v9 --o bind0 bind0 --as--o v10 bind1[/"concat('#91;#91;',str(?arqEnll),'#93;#93;')"/] v10 --o bind1 bind1 --as--o v11 end bind2[/"?arqWiki?arqEtiq"/] v11 --o bind2 v6 --o bind2 bind2 --as--o v12 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v7 -."wdt:P149".-> v13 v13 --"rdfs:label"--> v5 subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v14 -."schema:isPartOf".-> c9 v14 --"schema:about"--> v13 bind3[/"replace(replace(http://wikiba.se/ontology#decodeUri(str(?estilLink)),'https://ca.wikipedia.org/wiki/','','i'),'_',' ')"/] v14 --o bind3 bind3 --as--o v15 bind4[/"concat('#91;#91;',str(?estilEnll),'#93;#93;')"/] v15 --o bind4 bind4 --as--o v16 end bind5[/"?estilWiki?estilEtiq"/] v16 --o bind5 v5 --o bind5 bind5 --as--o v17 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v7 -."wdt:P170".-> v18 v18 --"rdfs:label"--> v4 subgraph optional5["(optional)"] style optional5 fill:#bbf,stroke-dasharray: 5 5; v19 -."schema:isPartOf".-> c9 v19 --"schema:about"--> v18 bind6[/"replace(replace(http://wikiba.se/ontology#decodeUri(str(?creadorLink)),'https://ca.wikipedia.org/wiki/','','i'),'_',' ')"/] v19 --o bind6 bind6 --as--o v20 bind7[/"concat('#91;#91;',str(?creadorEnll),'#93;#93;')"/] v20 --o bind7 bind7 --as--o v21 end bind8[/"?creadorWiki?creadorEtiq"/] v21 --o bind8 v4 --o bind8 bind8 --as--o v22 end subgraph optional6["(optional)"] style optional6 fill:#bbf,stroke-dasharray: 5 5; v7 -."wdt:P10241".-> v23 v23 --"rdfs:label"--> v3 subgraph optional7["(optional)"] style optional7 fill:#bbf,stroke-dasharray: 5 5; v24 -."schema:isPartOf".-> c9 v24 --"schema:about"--> v23 bind9[/"replace(replace(http://wikiba.se/ontology#decodeUri(str(?taxonLink)),'https://ca.wikipedia.org/wiki/','','i'),'_',' ')"/] v24 --o bind9 bind9 --as--o v25 bind10[/"concat('#91;#91;',str(?taxonEnll),'#93;#93;')"/] v25 --o bind10 bind10 --as--o v26 end bind11[/"?taxonWiki?taxonEtiq"/] v26 --o bind11 v3 --o bind11 bind11 --as--o v27 end subgraph optional8["(optional)"] style optional8 fill:#bbf,stroke-dasharray: 5 5; v7 -."wdt:P5816".-> v28 v28 --"rdfs:label"--> v2 subgraph optional9["(optional)"] style optional9 fill:#bbf,stroke-dasharray: 5 5; v29 -."schema:isPartOf".-> c9 v29 --"schema:about"--> v28 bind12[/"replace(replace(http://wikiba.se/ontology#decodeUri(str(?consLink)),'https://ca.wikipedia.org/wiki/','','i'),'_',' ')"/] v29 --o bind12 bind12 --as--o v30 bind13[/"concat('#91;#91;',str(?consEnll),'#93;#93;')"/] v30 --o bind13 bind13 --as--o v31 end bind14[/"?consWiki?consEtiq"/] v31 --o bind14 v2 --o bind14 bind14 --as--o v32 end bind15[/"concat(if(bound(?taxonEtiq),concat('Tàxon: ',?taxonNet,'</br>'),''),if(bound(?creadorEtiq),concat('Creador: ',?creadorNet,'</br>'),''),if(bound(?arqEtiq),concat('Arquitecte: ',?arqNet,'</br>'),''),if(bound(?estilEtiq),concat('Estil: ',?estilNet,'</br>'),''),if(bound(?consEtiq),concat('Estat: ',?consNet),''))"/] v3 --o bind15 v27 --o bind15 v4 --o bind15 v22 --o bind15 v6 --o bind15 v12 --o bind15 v5 --o bind15 v17 --o bind15 v2 --o bind15 v32 --o bind15 bind15 --as--o v33 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c16 --"wikibase:language"--> c18 end