OldWiki » History » Version 1
Version 1/5
-
Next ยป -
Current version
Chris Cannam, 2012-08-08 09:40 AM
Classical Composers and RDF¶
This is an old wiki page from 2009, archived here
This is where we make feature requests and comments regarding Cannam's Canon - Chris Cannam's RDF-based software Opus.
SPARQL DBpedia¶
You can find a query using skos to get all the "classical composers" from DBpedia [[http://dbpedia.org/snorql/?query=SELECT+%3Fcomp%0D%0AWHERE+{%0D%0A+%3Ftype+skos%3Abroader+%3Chttp%3A%2F%2Fdbpedia.org%2Fresource%2FCategory%3AClassical_composers%3E+.%0D%0A+%3Fcomp+skos%3Asubject+%3Ftype+.%0D%0A}%0D%0A|here]].
PREFIX skos: <http://www.w3.org/2004/02/skos/core#> SELECT ?comp WHERE { ?type skos:broader <http://dbpedia.org/resource/Category:Classical_composers> . ?comp skos:subject ?type . }
Note this returns 6703 composers.
What stuff can be drawn straight from DBpedia?¶
Composers -- Sort of. I'm drawing these from a few different sources at the
moment, partly because I liked the "surname, first names" ordering used in one
source, I wanted to pull in a number of spelling variants at once for text search purposes, etc. (For popular composers wikipedia/dbpedia does a good job of that last one though -- I particularly like http://dbpedia.org/resource/Woflgang_amadeus_mozart)
But, it does seem to be the case that almost all that composers we're "interested in" have Wikipedia pages and so at least potential DBpedia URIs. Should we use those instead of generated URIs plus owl:sameAs? Possibly. One annoyance is that a DBpedia URI doesn't give us the nice "human namespace" hint that this is
a classical composer, so I would prefer to have some more direct association made between the URI and "a composer" than the DBpedia categorisation currently gives us. That annoyance may be a symptom of a deeper problem of expression for us.
Works -- No. If a composer has a reasonably complete opus listing or catalogue, we want to import all of it, not just those works that happen to have Wikipedia pages. This generally means reading the Wikipedia list pages for a compose
r's works, which are often fairly complete, rather than querying works that have
pages of their own. (A lot of works that appear in Wikipedia don't seem to have corresponding DBpedia resources yet either, which means we wouldn't easily be
able to query them that way.) We can't generate DBpedia URIs for works that are
not yet in Wikipedia, because that would mean anticipating (in code) the editor
ial decisions of Wikipedia editors.
Orchestras and Performers -- Generally yes, e.g. analogous to composer query
above,
SELECT ?c WHERE { ?type skos:broader <http://dbpedia.org/resource/Category:Conductors_by_nationality> . ?c skos:subject ?type . }
(1867 results). The same thing for Orchestras_by_nationality gives 390 results
(though this certainly doesn't include all the orchestras found in Wikipedia), and Classical_pianists_by_nationality gives 1397 (note the apparently more general "Pianists_by_nationality" omits many famous classical pianists and gives fewer
results).
What can we query from e.g. MusicBrainz?¶
Should we start by looking up e.g. "all 'tracks' by Ludwig van Beethoven" and seeing just how bad it is?
[[http://dbtune.org/musicbrainz/snorql/?query=select+count%28%3Fc%29+where+{%0D%0A%3Fa+foaf%3Aname+%22Ludwig+van+Beethoven%22.%0D%0A%3Fb+foaf%3Amaker+%3Fa%3B%0D%0A+a+mo%3ATrack%3B%0D%0A+dc%3Atitle+%3Fc%3B%0D%0A}&prefixes=PREFIX+map%3A+%3Cfile%3A%2Fhome%2Fmoustaki%2Fwork%2Fmotools%2Fmusicbrainz%2Fd2r-server-0.4%2Fmbz_mapping_raw.n3%23%3E%0D%0APREFIX+rdfs%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3E%0D%0APREFIX+owl%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2002%2F07%2Fowl%23%3E%0D%0APREFIX+event%3A+%3Chttp%3A%2F%2Fpurl.org%2FNET%2Fc4dm%2Fevent.owl%23%3E%0D%0APREFIX+rel%3A+%3Chttp%3A%2F%2Fpurl.org%2Fvocab%2Frelationship%2F%3E%0D%0APREFIX+lingvoj%3A+%3Chttp%3A%2F%2Fwww.lingvoj.org%2Fontology%23%3E%0D%0APREFIX+foaf%3A+%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0D%0APREFIX+rdf%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E%0D%0APREFIX+tags%3A+%3Chttp%3A%2F%2Fwww.holygoat.co.uk%2Fowl%2Fredwood%2F0.1%2Ftags%2F%3E%0D%0APREFIX+db%3A+%3Chttp%3A%2F%2Fdbtune.org%2Fmusicbrainz%2Fresource%2F%3E%0D%0APREFIX+geo%3A+%3Chttp%3A%2F%2Fwww.geonames.org%2Fontology%23%3E%0D%0APREFIX+dc%3A+%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%3E%0D%0APREFIX+bio%3A+%3Chttp%3A%2F%2Fpurl.org%2Fvocab%2Fbio%2F0.1%2F%3E%0D%0APREFIX+mo%3A+%3Chttp%3A%2F%2Fpurl.org%2Fontology%2Fmo%2F%3E%0D%0APREFIX+vocab%3A+%3Chttp%3A%2F%2Fdbtune.org%2Fmusicbrainz%2Fresource%2Fvocab%2F%3E%0D%0APREFIX+xsd%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%23%3E%0D%0APREFIX+mbz%3A+%3Chttp%3A%2F%2Fpurl.org%2Fontology%2Fmbz%23%3E%0D%0A|Count tracks by LvB in SNORQL interface]] -- says "1000" (soft limit reached?) -- how many of these can be mechanically mapped onto our own "works" data?
There looks to be some scope for querying things like orchestras using the DBtune MusicBrainz interface, but it's giving me some rather strange results. For example SELECT COUNT WHERE { ?a a mo:ChamberOrchestra } returns 818 results -- apparently including all orchestras, not just chamber orchestras -- while searches for mo:Orchestra or mo:SymphonyOrchestra (both apparently supported classes) return nothing. Where did these data come from?