Kamis, 21 Juli 2011

RDFa = RDF + awesome



This video is provided by msporny. It's rather old (est. 2008) and is subjected to some specification updates. Here I wanna try to make the vid summary:
  • RDFa = RDF (Resource Description Framework) + awesome
  • Actually, it stands for = RDF in attributes
  • RDFa empowers bloggers and web designers to add semantic information directly to web pages.
  • RDFa is based on RDF.
  • RDF is a concept, not a syntax.
  • There are three things in RDF = subjects + predicates + objects
  • Those three things are usually called triples.
  • RDF uses URIs to specify subjects, predicates, and objects.
  • For instance: Dave likes cookies, becomes, <#dave> <pref:likes> <#cookies>
  • There can be many triples associated with the particular subject.
  • RDFa is a syntax used to describe RDF to computers.
FYI, RDFa attributes are (source):
  • about and src – a URI or CURIE specifying the resource the metadata is about
  • rel and rev – specifying a relationship or reverse-relationship with another resource
  • href and resource – specifying the partner resource
  • property – specifying a property for the content of an element
  • content – optional attribute that overrides the content of the element when using the property attribute
  • datatype – optional attribute that specifies the datatype of text specified for use with the property attribute
  • typeof – optional attribute that specifies the RDF type(s) of the subject (the resource that the metadata is about)

Here comes the conclusion

How the Semantic Web is built? Triple by triple. Triples link to other triples, which then link to more triples. These links go between pages, between blogs, between sites, and between countries. The more triples that are available on the web, the more computers will be able to understand our world.

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).