Kamis, 21 Juli 2011

Hynotized by Fuseki

No, this is indeed not a song title (at least, that's what Mr. Google said!). Basically, what I am trying to do is to build (reuse, to be exact) a federated query server for my project. And thanks God, I've found Fuseki!


But, wait a minute, what's exactly federated query mean? Well, literally, federated query means you send queries over a couple of remote endpoints and then aggregate the query results. I know of two ways to do this by using Named Graphs; and SERVICE keyword, in which I am gonna explore now.

And then? So, assume that I own three companies; Company A, Company B, and Company C. Each of these companies already supports Semantic Web technologies (because they're my companies!), therefore each of them has a SPARQL endpoint for querying datasets. But the problem is, I want to do a query for them all at once, for example, I wanna get a list of employees from my companies, along with their job position. Well, easy peasy then, here's the query:



But, wait, did you notice that I just utilized a variable for substituting the SERVICE URIs? Yes I did! In order to run that query, I must specify what SERVICE URIs to be queried federately. It means I should write an RDF file containing data about SPARQL endpoints for all my companies, and then load it into my SPARQL server. So, check out the following RDF file then!



OK then, now I could execute my sacred, holy, and precious federated query! After that, I got the following result:


If you're curious what's inside the datasets from each company, check this stuff out then (actually, I concat them all on the code below).

Tidak ada komentar:

Posting Komentar