query-8fc01099799d0aa61a27cb875083b4c1

rq turtle/ttl

08:55, 5 December 2022 (UTC)) talk (Theklan : You cannot do additional filters on a label SERVICE as far as I know, the service outputs only one (first available) label based on the sorted language tags "eu,es,fr,en". You can retrieve the eu label like thisTheklan@ ]reply[08:55, 5 December 2022 (UTC)) talk (Theklan : You cannot do additional filters on a label SERVICE as far as I know, the service outputs only one (first available) label based on the sorted language tags "eu,es,fr,en". You can retrieve the eu label like thisTheklan@

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#>
#defaultView:BarChart
SELECT ?year (COUNT(?herrialdea) AS ?count) (SAMPLE(?herrialdeaLabel) AS ?label) WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "eu,es,fr,en". }
  ?Bertsosaio wdt:P31 wd:Q8247090.
  ?Bertsosaio wdt:P710 ?bertsolari.
  ?bertsolari wdt:P19 ?jaiolekua.
  ?jaiolekua (wdt:P131*) ?herrialdea.
  {?herrialdea wdt:P31 wd:Q162620.}
  UNION
  {?herrialdea wdt:P31 wd:Q34876.}
  ?Bertsosaio wdt:P582 ?data.
  BIND(STR(YEAR(?data)) AS ?year)
  ?herrialdea rdfs:label ?herrialdeaLabel FILTER((LANG(?herrialdeaLabel)) = "eu") .
}
GROUP BY ?herrialdeaLabel ?year

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?Bertsosaio") v3("?bertsolari") v8("?count") v6("?data") v5("?herrialdea"):::projected v1("?herrialdeaLabel"):::projected v4("?jaiolekua") v9("?label") v7("?year"):::projected c7(["wd:Q8247090"]):::iri c11(["wd:Q162620"]):::iri c3(["bd:serviceParam"]):::iri c5(["eu,es,fr,en"]):::literal c12(["wd:Q34876"]):::iri f0[["?herrialdeaLabel = 'eu'"]] f0 --> v1 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c3 --"wikibase:language"--> c5 end v2 --"wdt:P31"--> c7 v2 --"wdt:P710"--> v3 v3 --"wdt:P19"--> v4 v4 --"wdt:P131"--> v5 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v5 --"wdt:P31"--> c12 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v5 --"wdt:P31"--> c11 end union0r <== or ==> union0l end v2 --"wdt:P582"--> v6 bind1[/"str(year-from-dateTime(?data))"/] v6 --o bind1 bind1 --as--o v7 v5 --"rdfs:label"--> v1 bind4[/"count(?herrialdea)"/] v5 --o bind4 bind4 --as--o v8 bind5[/"sample(?herrialdeaLabel)"/] v1 --o bind5 bind5 --as--o v9