query-1cd0f3c38237a44d1fd0ce537e4e1764

rq turtle/ttl

TODO

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?equip ?equipLabel ?posicio_equipLabel ?alcaria ?massa ?numero_esportiu ?partidos WHERE {
  BIND(2019 AS ?year) .
  ?item wdt:P641 ?esport .
  ?item p:P54 ?statement .
  ?statement ps:P54 ?equip; pq:P580 ?from .
  OPTIONAL { ?statement pq:P582 ?until } .
  OPTIONAL { ?statement pq:P1350 ?partidos } .
  FILTER( ?year >= YEAR( ?from ) && !( BOUND( ?until ) && YEAR( ?until ) < ?year ) ) .
  FILTER(?esport = wd:Q2736) .
  FILTER(?equip = wd:Q7156) .
  OPTIONAL { ?item wdt:P413 ?posicio_equip } .
  OPTIONAL { ?item wdt:P2048 ?alcaria } .
  OPTIONAL { ?item wdt:P2067 ?massa } .
  OPTIONAL { ?item wdt:P1618 ?numero_esportiu } .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" } .
}
LIMIT 100

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v10("?alcaria"):::projected v1("?equip"):::projected v2("?esport") v4("?from") v6("?item"):::projected v11("?massa"):::projected v12("?numero_esportiu"):::projected v8("?partidos"):::projected v9("?posicio_equip") v7("?statement") v5("?until") v6("?year") c14(["bd:serviceParam"]):::iri c16(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["?equip = 'wd:Q7156'"]] f0 --> v1 f1[["?esport = 'wd:Q2736'"]] f1 --> v2 f2[["?year >= year-from-dateTime(?from)not bound(?until)year-from-dateTime(?until) < ?year"]] f2 --> v6 f2 --> v4 f2 --> v5 bind3[/"'2019^^xsd:integer'"/] bind3 --as--o v6 v6 --"p:direct/P641"--> v2 v6 --"p:P54"--> v7 v7 --"p:statement/P54"--> v1 v7 --"p:qualifier/P580"--> v4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v7 -."p:qualifier/P582".-> v5 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v7 -."p:qualifier/P1350".-> v8 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v6 -."p:direct/P413".-> v9 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v6 -."p:direct/P2048".-> v10 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v6 -."p:direct/P2067".-> v11 end subgraph optional5["(optional)"] style optional5 fill:#bbf,stroke-dasharray: 5 5; v6 -."p:direct/P1618".-> v12 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c14 --"wikibase:language"--> c16 end