query-4223775a39ead33e5ff6286f31ed8a28
TODO
Use at
- https://query.wikidata.org/sparql
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 (YEAR(COALESCE(?date1, ?date2)) AS ?year) 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 ?date1 } . # date of publication...
OPTIONAL { ?item wdt:P1191 ?date2 } . # ... 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("?date1"):::projected
v5("?date2"):::projected
v2("?item"):::projected
v7("?linkcount"):::projected
v3("?maker")
v6("?nationality"):::projected
v1("?wfr")
v8("?year")
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;
v2 -."wdt:P577".-> v4
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P1191".-> v5
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P27".-> v6
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wikibase:sitelinks".-> v7
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c16 --"wikibase:language"--> c18
end
bind1[/"year-from-dateTime(?date1?date2)"/]
v4 --o bind1
v5 --o bind1
bind1 --as--o v8