Submissions for LinkedMusic

Description

A federated graph of 14 music databases, including The Global Jukebox, Dig That Lick, The Sessions, RISM, MusicBrainz and more

7 of 7 submissions
#250

Natural Language Question

Find all compositions in DIAMM that are composed by Guillaume de Machaut

SPARQL Query

PREFIX rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

PREFIX rdfs:  <http://www.w3.org/2000/01/rdf-schema#>

PREFIX wd:    <http://www.wikidata.org/entity/>

PREFIX wdt:   <http://www.wikidata.org/prop/direct/>

PREFIX diamm: <https://linkedmusic.ca/graphs/diamm/>

SELECT DISTINCT ?composition ?compositionLabel

WHERE {

  GRAPH <https://linkedmusic.ca/graphs/diamm/> {

    ?composer wdt:P2888 wd:Q200580 .

    ?composition wdt:P86 ?composer .

    OPTIONAL { ?composition rdfs:label ?compositionLabel . }

  }

}
#251

Natural Language Question

Find all the different time signatures for jigs in The Session

SPARQL Query

PREFIX rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs:  <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd:    <http://www.wikidata.org/entity/>
PREFIX wdt:   <http://www.wikidata.org/prop/direct/>

PREFIX diamm: <https://linkedmusic.ca/graphs/diamm/>
PREFIX dtl:   <https://linkedmusic.ca/graphs/dig-that-lick/>
PREFIX ts:    <https://linkedmusic.ca/graphs/thesession/>
PREFIX gj:    <https://linkedmusic.ca/graphs/theglobaljukebox/>
PREFIX mb:    <https://linkedmusic.ca/graphs/musicbrainz/>

SELECT DISTINCT ?timeSignature
WHERE {
  ?tune a ts:Tune .
  ?tune wdt:P747 ?tuneSetting .
  ?tuneSetting wdt:P136 wd:Q1079270 .
  ?tuneSetting wdt:P3440 ?timeSignature .
}
ORDER BY ?timeSignature
#252

Natural Language Question

Find the capital city of the country with the most sessions

SPARQL Query

PREFIX rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs:  <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd:    <http://www.wikidata.org/entity/>
PREFIX wdt:   <http://www.wikidata.org/prop/direct/>

PREFIX diamm: <https://linkedmusic.ca/graphs/diamm/>
PREFIX dtl:   <https://linkedmusic.ca/graphs/dig-that-lick/>
PREFIX ts:    <https://linkedmusic.ca/graphs/thesession/>
PREFIX gj:    <https://linkedmusic.ca/graphs/theglobaljukebox/>
PREFIX mb:    <https://linkedmusic.ca/graphs/musicbrainz/>
SELECT ?capitalCity ?capitalCityLabel
WHERE {
  {
    SELECT ?country
    WHERE {
      GRAPH <https://linkedmusic.ca/graphs/thesession/> {
        ?session a ts:Session .
        ?session wdt:P17 ?country .
      }
    }
    GROUP BY ?country
    ORDER BY DESC(COUNT(?session))
    LIMIT 1
  }

  SERVICE <https://query.wikidata.org/sparql> {
    ?country wdt:P36 ?capitalCity .
    ?capitalCity rdfs:label ?capitalCityLabel .
    FILTER (LANG(?capitalCityLabel) = "en")
  }
}
#253

Natural Language Question

Find all songs in The Global Jukebox from countries with more than four sessions in the Session

SPARQL Query

PREFIX rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs:  <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd:    <http://www.wikidata.org/entity/>
PREFIX wdt:   <http://www.wikidata.org/prop/direct/>

PREFIX diamm: <https://linkedmusic.ca/graphs/diamm/>
PREFIX dtl:   <https://linkedmusic.ca/graphs/dig-that-lick/>
PREFIX ts:    <https://linkedmusic.ca/graphs/thesession/>
PREFIX gj:    <https://linkedmusic.ca/graphs/theglobaljukebox/>
PREFIX mb:    <https://linkedmusic.ca/graphs/musicbrainz/>

SELECT DISTINCT ?song
WHERE {
  GRAPH <https://linkedmusic.ca/graphs/theglobaljukebox/> {
    ?song a gj:Song ;
          wdt:P495 ?country .
  }
  GRAPH <https://linkedmusic.ca/graphs/thesession/> {
    SELECT ?country (COUNT(DISTINCT ?session) AS ?sessionCount)
    WHERE {
      ?session a ts:Session ;
               wdt:P17 ?country .
    }
    GROUP BY ?country
    HAVING (COUNT(DISTINCT ?session) > 4)
  }
}
#254

Natural Language Question

Find all works in MusicBrainz that, according to Dig that Lick, contains a solo performed by Charlie Parker

SPARQL Query

PREFIX rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs:  <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd:    <http://www.wikidata.org/entity/>
PREFIX wdt:   <http://www.wikidata.org/prop/direct/>

PREFIX diamm: <https://linkedmusic.ca/graphs/diamm/>
PREFIX dtl:   <https://linkedmusic.ca/graphs/dig-that-lick/>
PREFIX ts:    <https://linkedmusic.ca/graphs/thesession/>
PREFIX gj:    <https://linkedmusic.ca/graphs/theglobaljukebox/>
PREFIX mb:    <https://linkedmusic.ca/graphs/musicbrainz/>

SELECT DISTINCT ?work
WHERE {
  GRAPH <https://linkedmusic.ca/graphs/dig-that-lick/> {
    ?solo a dtl:Solo ;
          wdt:P175 wd:Q103767 ; 
          wdt:P361 ?track .
    ?track wdt:P2888 ?wikidataWork .
  }

  GRAPH <https://linkedmusic.ca/graphs/musicbrainz/> {
    ?work a mb:Work ;
          wdt:P2888 ?wikidataWork .
  }
}
#255

Natural Language Question

Find all compositions or recordings with "death" in the title

SPARQL Query

PREFIX rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs:  <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd:    <http://www.wikidata.org/entity/>
PREFIX wdt:   <http://www.wikidata.org/prop/direct/>

PREFIX diamm: <https://linkedmusic.ca/graphs/diamm/>
PREFIX dtl:   <https://linkedmusic.ca/graphs/dig-that-lick/>
PREFIX ts:    <https://linkedmusic.ca/graphs/thesession/>
PREFIX gj:    <https://linkedmusic.ca/graphs/theglobaljukebox/>
PREFIX mb:    <https://linkedmusic.ca/graphs/musicbrainz/>

SELECT DISTINCT ?entity ?label
WHERE {
  {
    GRAPH <https://linkedmusic.ca/graphs/musicbrainz/> {
      ?entity rdf:type mb:Work .
      ?entity rdfs:label ?label .
      FILTER (CONTAINS(LCASE(STR(?label)), "death"))
    }
  }
  UNION
  {
    GRAPH <https://linkedmusic.ca/graphs/musicbrainz/> {
      ?entity rdf:type mb:Recording .
      ?entity rdfs:label ?label .
      FILTER (CONTAINS(LCASE(STR(?label)), "death"))
    }
  }
  UNION
  {
    GRAPH <https://linkedmusic.ca/graphs/diamm/> {
      ?entity rdf:type diamm:Composition .
      ?entity rdfs:label ?label .
      FILTER (CONTAINS(LCASE(STR(?label)), "death"))
    }
  }
  UNION
  {
    GRAPH <https://linkedmusic.ca/graphs/thesession/> {
      ?entity rdf:type ts:Recording .
      ?entity rdfs:label ?label .
      FILTER (CONTAINS(LCASE(STR(?label)), "death"))
    }
  }
  UNION
  {
    GRAPH <https://linkedmusic.ca/graphs/dig-that-lick/> {
      ?entity rdf:type dtl:Track .
      ?entity rdfs:label ?label .
      FILTER (CONTAINS(LCASE(STR(?label)), "death"))
    }
  }
  UNION
  {
    GRAPH <https://linkedmusic.ca/graphs/thesession/> {
      ?entity rdf:type ts:Tune .
      ?entity rdfs:label ?label .
      FILTER (CONTAINS(LCASE(STR(?label)), "death"))
    }
  }
  UNION
  {
    GRAPH <https://linkedmusic.ca/graphs/theglobaljukebox/> {
      ?entity rdf:type gj:Song .
      ?entity rdfs:label ?label .
      FILTER (CONTAINS(LCASE(STR(?label)), "death"))
    }
  }
}
#256

Natural Language Question

Find all musical instruments in the Global Jukebox featured in songs indigenous to Madagascar, and find recordings in MusicBrainz featuring these same instruments

SPARQL Query

PREFIX rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs:  <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd:    <http://www.wikidata.org/entity/>
PREFIX wdt:   <http://www.wikidata.org/prop/direct/>

PREFIX diamm: <https://linkedmusic.ca/graphs/diamm/>
PREFIX dtl:   <https://linkedmusic.ca/graphs/dig-that-lick/>
PREFIX ts:    <https://linkedmusic.ca/graphs/thesession/>
PREFIX gj:    <https://linkedmusic.ca/graphs/theglobaljukebox/>
PREFIX mb:    <https://linkedmusic.ca/graphs/musicbrainz/>

SELECT DISTINCT ?wikidataInstrument ?recording WHERE {
  GRAPH <https://linkedmusic.ca/graphs/theglobaljukebox/> {
    ?song wdt:P495 wd:Q1019 .
    ?song wdt:P870 ?wikidataInstrument .
  }
  GRAPH <https://linkedmusic.ca/graphs/musicbrainz/> {
    ?recording wdt:P870 ?musicBrainzInstrument .
    ?musicBrainzInstrument wdt:P2888 ?wikidataInstrument .
  }
}
Odoma and Graphia logos

Quagga has been developed by Odoma ↗ for Graphia ↗

Funded by the European Union (grant ID: 101188018 ↗)

and by the Swiss State Secretariat for Education, Research and Innovation (SERI).

Contact Github FAQ