query-b92df31979cd216298de34c8a3f2b27f

rq turtle/ttl

Traditional knowledge SELECT ?opera ?operaLabel ?composerLabel (YEAR(?inception) AS ?year) ?basedOn ?basedOnLabel ?firstPerformanceDate ?languageLabel ?librettistLabel ?fullWork ?dedicatedToLabel (URI(REPLACE(STR(?enwiki), "/wiki/", "/w/api.php?action=query&prop=extracts&format=json&exintro=&titles=")) AS ?synopsis) WHERE { ?opera wdt:P31/wdt:P279* wd:Q1344 . OPTIONAL {?opera wdt:P86 ?composer} OPTIONAL {?opera wdt:P571 ?inception} OPTIONAL {?opera wdt:P144 ?basedOn} OPTIONAL {?opera wdt:P1191 ?firstPerformanceDate} OPTIONAL {?opera wdt:P407 ?language} OPTIONAL {?opera wdt:P87 ?librettist} OPTIONAL {?opera wdt:P953 ?fullWork} ?enwiki schema:about ?opera; schema:isPartOf https://en.wikipedia.org/. OPTIONAL {?opera wdt:P825 ?dedicatedTo} SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }

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#>
# Traditional knowledge
SELECT ?opera ?operaLabel 
?composerLabel 
(YEAR(?inception) AS ?year) 
?basedOn ?basedOnLabel 
?firstPerformanceDate 
?languageLabel 
?librettistLabel 
?fullWork 
?dedicatedToLabel
(URI(REPLACE(STR(?enwiki), "/wiki/", "/w/api.php?action=query&prop=extracts&format=json&exintro=&titles=")) AS ?synopsis)
WHERE {
  ?opera wdt:P31/wdt:P279* wd:Q1344 .
  OPTIONAL {?opera wdt:P86 ?composer}
  OPTIONAL {?opera wdt:P571 ?inception}
  OPTIONAL {?opera wdt:P144 ?basedOn}
  OPTIONAL {?opera wdt:P1191 ?firstPerformanceDate}
  OPTIONAL {?opera wdt:P407 ?language}
  OPTIONAL {?opera wdt:P87 ?librettist}
  OPTIONAL {?opera wdt:P953 ?fullWork}
  ?enwiki schema:about ?opera;
          schema:isPartOf <https://en.wikipedia.org/>.
  OPTIONAL {?opera wdt:P825 ?dedicatedTo}
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?basedOn"):::projected v2("?composer") v10("?dedicatedTo") v9("?enwiki"):::projected v5("?firstPerformanceDate"):::projected v8("?fullWork"):::projected v3("?inception"):::projected v6("?language") v7("?librettist") v1("?opera"):::projected v12("?synopsis") v11("?year") a1((" ")) c13([https://en.wikipedia.org/]):::iri c16(["bd:serviceParam"]):::iri c18(["#91;AUTO_LANGUAGE#93;,en"]):::literal c3(["wd:Q1344"]):::iri v1 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P86".-> v2 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P571".-> v3 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P144".-> v4 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P1191".-> v5 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P407".-> v6 end subgraph optional5["(optional)"] style optional5 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P87".-> v7 end subgraph optional6["(optional)"] style optional6 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P953".-> v8 end v9 --"schema:about"--> v1 v9 --"schema:isPartOf"--> c13 subgraph optional7["(optional)"] style optional7 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P825".-> v10 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c16 --"wikibase:language"--> c18 end bind0[/"year-from-dateTime(?inception)"/] v3 --o bind0 bind0 --as--o v11 bind1[/"replace(str(?enwiki),'/wiki/','/w/api.php?action=query&prop=extracts&format=json&exintro=&titles=')"/] v9 --o bind1 bind1 --as--o v12