Semantic Web

Basics of Ontology, RDF and SPARQL


We cover
What is Ontology
What is RDF store
What is SPARQL
What is the use of all this..?

What is Ontology:
The structure of data with relationships. That is it. Ontology helps us defining how data is structured, how you define every data instance and the relationships between those instances. In abstract way , it allows to convert data into knowledge and in some cases even information to knowledge.
Example: Assume Time.
Time is used to define various "THINGS" in our world. Let's say if we want to define an Activity, we need some temporal properties. Activity can have temporal properties like startTime, endTime, duration etc. Now, what we did here is we tried to define an Activity is some data instance which has an endTime and a startTime. We define some Actor which performs activities like Running. So, there is a data instance which is connected to something called running, which is in turn connected to two time instances called startTime and endTime.

So we get a graph like:

Actor--performs-->Running
Running--is_a-->Activity
Running--has-->startTime
Running--has-->endTime
startTime--hasValue-->12:01:36
endTime--hasValue-->12:03:33

What is RDF store:
Above representation is called a Resource Description Format (RDF) in form of triples. This triple means every instance is stored in form of three URLs that are Subject, Predicate, Object. Now, what this RDF does is to use this ontological structure of time, endtime, starttime, actor, performs, activities etc. and tries to make sense out of this data on basis of subject, predicate and object. We store all this data along with instances and ontology in a data store and hence RDF data Store.

What is SPARQL:
SPARQL Protocol And RDF Query Language is similar to SQL query language just it works on RDF stores. This allows users to ask complex queries which could traverse these graph like structures to give more accurate results. Query format is very similar to normal SQL Query:

SELECT x, y
WHERE { ... 
FILTER(...)
ORDER BY


What is the use of all this..?
This allows us now to read data in a format like: Actor performed An activity named Running which started at X time and Ended at Y time. So now when you are traversing a data structure you actually as a normal question and you get a normal answer instead of collection of links to possible answers containing your keywords. Also this graph based data structure allows users to go from one node to next and so on. A possible query can be. Give me all values where Actor A is Running in Evening while Using Phone and calling Person named Z.


In further discussion I would try to go in little details about basics of developing an Ontology, creating DataStore, Configuring Sparql endpoints and Querying them.

I hope you find it useful and please correct me wherever I am wrong.

Comments