query-406a72eeb56ef92fdf330967ef03b070

rq turtle/ttl

Canciones

Use at

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#>
select
  ?song
  (sample(?songLabel) as ?songLabel)
  (group_concat(distinct ?genreLabel; separator = "; ") as ?genres)
  (group_concat(distinct ?composerLabel; separator = "; ") as ?composers)
  (group_concat(distinct ?lyricistLabel; separator = "; ") as ?lyricists)
  (year(min(?date)) as ?firstYear)
  (sample(?mbID) as ?mbID)
  (sample(?ttID) as ?ttID)
  (sample(?audio) as ?audio)
where {
  ?song wdt:P31 / wdt:P279* wd:Q2188189 . # musical work
  {
    { ?song wdt:P136 wd:Q14390274 . } # tango
    union
    { ?song wdt:P136 wd:Q942955 . } # milonga
    union
    { ?song wdt:P136 wd:Q61891621 . } # vals
  }
  optional { ?song rdfs:label ?songLabel . filter(lang(?songLabel) = "es") }
  optional { ?song wdt:P136 / rdfs:label ?genreLabel . filter(lang(?genreLabel) = "es") }
  optional { ?song wdt:P86 / rdfs:label ?composerLabel . filter (lang(?composerLabel) = "es") }
  optional { ?song wdt:P676 / rdfs:label ?lyricistLabel . filter (lang(?lyricistLabel) = "es") }
  optional { ?song wdt:P577 ?date . }
  optional { ?song wdt:P435 ?mbID . }
  optional { ?song wdt:P4932 ?ttID . }
  optional { ?song wdt:P51 ?audio . }
}
group by ?song
order by ?firstYear

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v14("?audio"):::projected v3("?composerLabel"):::projected v12("?composers") v7("?date") v14("?firstYear") v4("?genreLabel"):::projected v11("?genres") v2("?lyricistLabel"):::projected v13("?lyricists") v14("?mbID"):::projected v6("?song"):::projected v11("?songLabel"):::projected v14("?ttID"):::projected a1((" ")) a2((" ")) a3((" ")) a4((" ")) c7(["wd:Q942955"]):::iri c6(["wd:Q14390274"]):::iri c4(["wd:Q2188189"]):::iri c8(["wd:Q61891621"]):::iri v6 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c4 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; v6 --"wdt:P136"--> c8 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v6 --"wdt:P136"--> c7 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v6 --"wdt:P136"--> c6 end union0r <== or ==> union0l end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v6 -."rdfs:label".-> v11 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v6 -."wdt:P136".-> a2 a2 --"rdfs:label"--> v4 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v6 -."wdt:P86".-> a3 a3 --"rdfs:label"--> v3 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v6 -."wdt:P676".-> a4 a4 --"rdfs:label"--> v2 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v6 -."wdt:P577".-> v7 end subgraph optional5["(optional)"] style optional5 fill:#bbf,stroke-dasharray: 5 5; v6 -."wdt:P435".-> v14 end subgraph optional6["(optional)"] style optional6 fill:#bbf,stroke-dasharray: 5 5; v6 -."wdt:P4932".-> v14 end subgraph optional7["(optional)"] style optional7 fill:#bbf,stroke-dasharray: 5 5; v6 -."wdt:P51".-> v14 end bind8[/"sample(?songLabel)"/] v11 --o bind8 bind8 --as--o v11 bind9[/"?genreLabel"/] v4 --o bind9 bind9 --as--o v11 bind10[/"?composerLabel"/] v3 --o bind10 bind10 --as--o v12 bind11[/"?lyricistLabel"/] v2 --o bind11 bind11 --as--o v13 bind12[/"year-from-dateTime()"/] null --o bind12 bind12 --as--o v14 bind13[/"sample(?mbID)"/] v14 --o bind13 bind13 --as--o v14 bind14[/"sample(?ttID)"/] v14 --o bind14 bind14 --as--o v14 bind15[/"sample(?audio)"/] v14 --o bind15 bind15 --as--o v14