Kamis, 10 November 2011

From Natural Language to DL


  • Superheroes that wear bat-costumes have sidekicks.
    $Superhero \sqcap\exists wear.BatCostume \sqsubseteq \exists hasSidekick.\top$
     
  • Someone whose opponent is a superhero is a supervillain.
    $\exists hasOpponent.Superhero \sqsubseteq Supervillain$
     
  • Only superheroes and supervillains can have superpowers.
    $\exists hasSuperpower.\top \sqsubseteq (Superhero \sqcup Supervillain)$
     
  • Someone who has a sidekick also has a teammate.
    $\exists hasSidekick.\top \sqsubseteq \exists hasTeammate.\top$
     
  • A person's sidekick is always that person's teammate.
    $hasSidekick \sqsubseteq hasTeammate$
PS: These were my exercises from the Fuzzy Description Logic course @ TU Dresden.

Jumat, 14 Oktober 2011

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

Senin, 30 Mei 2011

SMW ♥ 303

How do I know? Here's the clue. Have a look at the log generated by Live HTTP headers (a Firefox add-on) below:


So, what does really happen?
  1. I send a request to dereferencing the resource (any kind of resource) URI  @ line 3. I add a content negoitation stuff on the header like line 6.
  2. The server gives a 303 response (yay!) @ line 14 and because I was asking for text/html content, the server gives a redirection to this location @ line 22.
  3. I send a second request  @ line 30 to get the text/html content (information resource) to the location as specified on the server response.
  4. I got a 200 @ line 40, voila! Now I could read the information describing the resource URI.

Jumat, 20 Mei 2011

Silly Semantic

Just exported this RDF file from my Drupal profile page (localhost) and if you look at it, you'll find out why I called this silly.


Hey guys, I was born on 2011-04-06T23:06:09+07:00! I'm a baby then!

PS: This silliness comes when you mix up the semantic about a document and a thing described by that document.

Semantic Web: Intro