[13:14:57] Is it possible to query musicbrainz data with the SPARQL query service and connect it to wikidata? [13:16:06] e.g. curl -H 'Accept: application/ld+json' https://musicbrainz.org/work/16b58177-3777-3986-9d32-418fc98d9393 returns a json-ld representation of the work [13:16:43] which has a "sameAs" link to a wikidata entity [14:01:12] so, what is your question? [14:08:49] phschafft: the question I asked in the beginning [14:11:13] I'm not sure if that isn't what you actually answered. [14:11:25] or do you mean the reverse? asking wikidata based on a musicbrainz ID? [14:16:50] phschafft: I mean can I construct a query in the wikidata sparql editor that can do the association directly [14:18:47] which pulls the sameAs wikidata tag from the json-ld and uses that to query wikidata [14:18:54] something like (pseudo-SPARQL) [14:18:56] schema:sameAs ?wd. [14:18:58] ?wd wdt:P2561 ?name. [14:22:00] why not just compare via P434? [14:22:42] I have something like: ?item wdt:P434 "16b58177-3777-3986-9d32-418fc98d9393" [14:23:11] because I’m looking for a work, not an artist [14:23:34] then you need to figure out which the correct property is. ;) [14:23:36] and in one case the data is in musicbrainz, in the other the data is in wikidata [14:24:06] and as far as I understand, the main idea behind RDF is that you can combine multiple sources in a single query [14:24:11] P435? [14:24:15] because it’s “just” URLs [14:24:46] yes, but that is why I'm still unsure what your question actually is. ;) [14:25:04] I wrote some pseudocode above [14:25:09] would that work [14:25:12] or if no, why not [14:25:25] that is the question [14:26:52] for example, this does not return anything: "16b58177-3777-3986-9d32-418fc98d9393" wdt:P435 ?wd [14:27:16] which is not surprising, because I don’t expect wikidata to contain every work in musicbrainz [14:27:22] that would be quite silly [14:30:36] okay, it does return something if I flip the arguments [14:31:08] but that’s cause it’s quite the famous work, if I use something more arbitrary like https://musicbrainz.org/work/ea0bd5dd-6528-45c0-b272-c2647f9caedc I get no results [14:31:49] * phschafft nods. [14:32:50] maybe I’m completely wrong here and the backend does some magic to make the data binding two-way? [14:33:03] but if the work is not in wikidata you naturally don't get any infos from that part of the net. [14:33:03] but I doubt it [14:33:45] a resolver can only answer with what it knows. [14:34:18] and while people try to keep data sync that will never fully work, keeping the amount of data we know of. [14:34:46] generally if you have a ID from source X I would suggest starting the search by quering the API of X. [14:35:13] doesn't mean that you could not also query more services. [14:35:55] I mean given that we have URLs, I don’t see why that couldn’t be done by the SPARQL backend itself [14:36:04] but point taken [14:36:10] it could be done. sure. [14:36:27] but then it's again part of what is known to said resolver. [14:37:06] and I must say that running such cross-resolvers is a tough thing on the administration side. [14:38:57] I can imagine, yeah [14:49:57] may I ask what context your question arose from? [14:50:58] I’m figuring out how to best build a song search based on open data, which is a non-trivial problem [14:51:22] non-trivial yet doable. [14:51:31] I mean I could lowball it and use a last.fm API key [14:51:57] * phschafft is listening as he is having some project on his desk that includes mixing data from different sources. [14:52:09] It gets quite tricky with songs like “Angels”, there’s a bunch of works by that name [14:52:18] but usually people want the Robbie Williams version [14:52:48] first idea was to go by the musicbrainz “works” search [14:53:19] but looks like secondhandsongs might be even better, like https://secondhandsongs.com/search/work?title=angels&credits=robbie&format=json [14:54:03] * phschafft just needed to look that song up. because... his brains didn't connect with such a generic title. ;)