query-e198fda14d6788773ef289b0acaf7db3

rq turtle/ttl

Categories de premis SELECT DISTINCT ?premi ?catpral ?categoriapral ?catpremiats ?categoriapremiats WHERE { ?persona wdt:P166 ?premi. ?premi wdt:P910|wdt:P2517 ?cat. ?categoria schema:about ?cat. ?categoria schema:isPartOf https://ca.wikipedia.org/. OPTIONAL { ?premi wdt:P910 ?catpral. OPTIONAL { ?categoriapral schema:about ?catpral. ?categoriapral schema:isPartOf https://ca.wikipedia.org/. } } OPTIONAL { ?premi wdt:P2517 ?catpremiats. OPTIONAL { ?categoriapremiats schema:about ?catpremiats. ?categoriapremiats schema:isPartOf https://ca.wikipedia.org/. } } }

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX schema: <http://schema.org/>
# Categories de premis
SELECT DISTINCT ?premi ?catpral ?categoriapral ?catpremiats ?categoriapremiats
WHERE {
  ?persona wdt:P166 ?premi.
  ?premi wdt:P910|wdt:P2517 ?cat.
    ?categoria schema:about ?cat.
    ?categoria schema:isPartOf <https://ca.wikipedia.org/>.
  OPTIONAL {
    ?premi wdt:P910 ?catpral.
  OPTIONAL {
    ?categoriapral schema:about ?catpral.
    ?categoriapral schema:isPartOf <https://ca.wikipedia.org/>.
  }
    }
  OPTIONAL {
    ?premi wdt:P2517 ?catpremiats.
  OPTIONAL {
    ?categoriapremiats schema:about ?catpremiats.
    ?categoriapremiats schema:isPartOf <https://ca.wikipedia.org/>.
  }
    }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?cat") v4("?categoria") v6("?categoriapral"):::projected v8("?categoriapremiats"):::projected v5("?catpral"):::projected v7("?catpremiats"):::projected v1("?persona") v2("?premi"):::projected c6([https://ca.wikipedia.org/]):::iri v1 --"wdt:P166"--> v2 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P2517"--> v3 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P910"--> v3 end union0r <== or ==> union0l end v4 --"schema:about"--> v3 v4 --"schema:isPartOf"--> c6 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P910".-> v5 subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v6 -."schema:about".-> v5 v6 --"schema:isPartOf"--> c6 end end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P2517".-> v7 subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v8 -."schema:about".-> v7 v8 --"schema:isPartOf"--> c6 end end