query-f24ce6afbbe4faf55641a1aa53d363bb

rq turtle/ttl

Two questions dates for some operas? bothHow can I show only the year of the date in the results to this query? And why is it giving me

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 bd: <http://www.bigdata.com/rdf#>
SELECT distinct ?item ?itemLabel ?linkcount ?nationality ?date WHERE { 
  ?item wdt:P31 wd:Q1344 . # instance of opera
  ?item (wdt:P86|wdt:P87) ?maker . # either the composer or the librettist of the opera
  ?maker wdt:P21 wd:Q6581072 . # maker is female
  ?maker wdt:P31 wd:Q5 . # maker is human 
  OPTIONAL {?item wdt:P577|wdt:P1191 ?date .} # date of publication or of first performance
  OPTIONAL {?maker wdt:P27 ?nationality .} # get the nationality of the maker
  OPTIONAL {?item wikibase:sitelinks ?linkcount .} # count of sitelinks
  FILTER NOT EXISTS { ?wfr schema:about ?item . ?wfr schema:isPartOf <https://en.wikipedia.org/>.} 
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } .
} LIMIT 5000

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?date"):::projected v2("?item"):::projected v6("?linkcount"):::projected v3("?maker") v5("?nationality"):::projected v1("?wfr") c9(["wd:Q6581072"]):::iri c3([https://en.wikipedia.org/]):::iri c16(["bd:serviceParam"]):::iri c10(["wd:Q5"]):::iri c18(["#91;AUTO_LANGUAGE#93;,en"]):::literal c5(["wd:Q1344"]):::iri f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"schema:about"--> e0v2 e0v1 --"schema:isPartOf"--> e0c3 e0v2("?item"):::projected e0v1("?wfr"):::projected e0c3([https://en.wikipedia.org/]):::iri end f0--EXISTS--> f0e0 f0 --> v1 f0 --> c1 f0 --> v2 f0 --> c2 f0 --> c3 v1 --"schema:about"--> v2 v1 --"schema:isPartOf"--> c3 v2 --"wdt:P31"--> c5 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P87"--> v3 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P86"--> v3 end union0r <== or ==> union0l end v3 --"wdt:P21"--> c9 v3 --"wdt:P31"--> c10 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; v2 -."wdt:P1191".-> v4 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P577"--> v4 end union1r <== or ==> union1l end end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P27".-> v5 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v2 -."wikibase:sitelinks".-> v6 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c16 --"wikibase:language"--> c18 end