Thursday, August 18, 2011

Semantic Web - when machines talk

A difficult topic I agree, but assure you is really interesting if you want a nice afternoon sleep ;). Just kidding, the topic is really deep & interesting and is something that I may not be able to cover at length in one post, although I will try to keep pace with everyone' understanding and will also try to detail the points as far as I am aware of them.
So on a preface, I came across this topic when one of my colleague asked me about this and wanted to discuss this. I agree I had to read a lot as it was my first with this area and will share all links that I came across and found useful and understandable after I am done with my understanding here.
So, lets dive in...

What is this 'Semantic Web' ?
In plain simple terms, Semantic Web is a 'web of data' that helps machines understand the meaning of any information that exists on the web. You may argue that the World Wide Web(www) is that as well? Yes, it is. To elaborate, www is data that is in itself complete (confined within the bounderies of the application that generated this data) but not linked and more importantly this data (or rather documents) can only be interpreted by humans. Semantic Web links one application's data with the other application' data so in theory we do not have clusters of data generated by the applications but one single web of data or database where machines would be able to relate an A to B and deduce if A is part of B or not.
Ideally this will be a movement from documents to data!!

Confusing ? I am sure it is... read on!

When we search something on internet, the systems just present us with the search results without understanding the relevance or connection in a given situation/circumstance. So you may search for 'available flights to Mumbai' and there may be a result about how a bird can fly or about how an Ostrich can't fly. That's WWW as we know it today.
Semantic Web (or more precisely the Semantic Web agents), on the other hand will provide with data based on the relevance. So the 'available flights to Mumbai' will return you with data like, cheapest that suit your time zone.
Imagine a scenario where you would like to book a meeting with one of your clients a couple of days from now on. So all you need to do is tell your Semantic Web agent to book the cab on such a such date for a 3 pm meeting. The agent will book the Cab for you making sure the cab agency is the closest to your pick up place, also make sure that the cab arrives half an hour in time, check your calender for any conflicts and let you know if there is any, update your financial accounts with the charges, book a return cab for you... . All this without your intervention. The agent however, had to find and combine the information from multiple sources, interpret and take decisions. 
This is what we expect the Semantic Web would be able to bring to us in future on its realization.

Semantic Web is not separate from www, it is part of it and more precisely an extension of www. It's no more about the links on the web, its about linking between these data links so machines are able to analyse the data themselves without any human intervention. 
Understand that Semantic Web is a vision to dissolve the application boundaries and let there be one web complete of all data. 

Web 2.0 is not Semantic Web
So if Web 2.0 is not Semantic Web than what is and how is it different? Well, for one..Web 2.0 is not Semantic Web because Web 2.0 is actually about people. It is focused on the interaction done between people on web, or rather it drives the interaction between people on web. It focuses on the human interaction, its more about people' ability to collaborate the data and share it on the web and thus using the technologies like AJAX, XHTML, SOAP etc... All that people care about is the final result which is the social communication/interaction.

Relation to Web 3.0
Semantic Web is also used as a synonym for Web 3.0. But that remains a topic of debate, as some believe that Web3.0 will be the next revolution and will be more graphical in nature where it will be computers that will be generating more informational data.
As it is, Semantic Web is beyond humans. Its about machines interaction and analytic deduction of data on their own. It is focused on machines; when machines would be able to find, collect, analyze and act on data without any human dependency. So the extension of Web documents to data and metadata will enable the whole Web to be processed by humans and more interestingly by machines independently of humans.
To accomplish the task of converting the web documents to data Web 3.0 introduces some technologies like RDF. More precisely RDF (Resource Description Framework, described later in here), which works on web pages..applications and also databases, is used to turn basic Web data in to structured data that the applications/software can further use.

Semantic Web Technologies
Implementing Semantic web requires adding metadata (data that describes data) to information resources. So when there is enough metadata available, systems will be able to effectively process the data based on this available information.
As an example, the metadata tags available in the html files today helps search engines deduce the rankings and collect information about the type of data the document may contain.
The first step required is to get the data in uniform formats so machines don't end up with the case where at one place the first name is understood by <fname> tag and at other its the <firstname> tag. Semantic Web helps in here to make the data in the same format and also understandable not only to humans but to machines as well.
This is where technologies like RDF, RDFS and OWL come in to picture as they classify data from multiple domains based on their properties and relation to other data.

Resource Description Framework (RDF)
RDF is an XML based standard for describing resources that exists on the web (including intranets). It builds on XML and URI(Uniform Resource Identifiers) technologies, where it uses a single URI for identifying a resource and multiple URIs to analyze the data statements.
RDF statements are often referred to as 'triples'. A triple consists of:
- a subject (basically a resource)
- a predicate (a property)
- an object (property value)
For example:
The blogger site       is      
(subject)           (predicate)            (object)

RDF is normally expressed in an XML format and sometimes graphically as well.

And then we could associate other triples with this triple as well. Once this definition is done, we could code this in RDF/XML as well.
Creating a triple like this sets up a model where data is actually stored, so RDF describes the model and the syntax defining a resource. What RDF doesn't do is specify the semantics (meaning) of the resource. For that we need a schema and a language. Welcome RDFS and OWL !

Resource Description Framework Schema (RDFS) 
RDFS creates the much needed vocabulary that describes groups of related RDF resources and the relation between these resources. A vocab defines the allowable properties that could be linked to the resources in a particular domain. RDFS benefits us in creating classes of resources that may share common properties.
Likewise as in case of triple example provided above, RDFS triples consists of classes, its properties and its values that defines the classes and its relation to resources.
So in a RDFS vocab, resources are defined as instances of classes. A class is also a resource and any class can be a subclass of any other class. This hierarchical meaning (or semantic) information  allows machines to infer the meaning of a resource based  on its properties and property values.
RDFS is a simple vocab language and OWL builds on it to be much more richer.

Web Ontology Language (OWL)
building upon RDF and RDFS, OWL describes the type of relationships that can be expressed in RDF using XML vocab to indicate the structure and relations in between different resources. This is what defined an Ontology.
Semantic Web ontologies contains different sets of inference rules from which machines would be able to take the meaning and logical conclusions.
Taxonomy is nothing but a system of classifications. This classification expresses the hierarchy and the relations that exist between different resources and thus we could use OWL to assign properties to classes of resources and allow the sub-classes of these classes to inherit these properties as well.
So considering that 'Apple' is a 'Fruit' and a 'Fruit' is 'Eatable' a Semantic Web agent could infer that an 'Apple' is 'Eatable'.
OWL in itself has 3 sub-languages each with increasing complexity and each latter comprising of the earlier in below order:
- OWL lit
- OWL Full

Will this be a reality ?
Critics will always be there to question the basic feasibility of the idea. And in a way there are right to question it as well, people lie and may provide wrong metadata, which is basically the backbone on which the idea (will) work.
W3C will obviously argue on this!! However, just to complete the argument, the problem remains with the usage as the Semantic Web idea (though initially conceived by Sir Timothy Berners Lee) is being developed by people who know logical computation and AI.
Looking at the technological work we may soon see a Semantic Web agent at work, fingers crossed!!

More stuff to read on
Here is some more stuff to read. I personally referred to some of them in the build up to write this post.

Phew, yes that was some confusing topic! I agree with that totally. If you have any questions feel free to put them in comments and I may be able to answer them somewhat and may provide you with a link or two in here.

In case you need one, here is the QR for this post: 
Semantic Web QR

Friday, August 5, 2011

www or no-www

The other day a couple of people very close to my hearing radius were debating on www vs no-www. I wasn't aware of the actual nature of the discussion/debate/argument but it seems a good topic to detail on what is the difference, if any, and where it actually lies(considering there is some difference, how so ever subtle). I am hoping this would be a nice introductory and confusion resolving post.

SEO Perspective
Which one is better from a SEO point of view? A question many asks, and something that very easily has numerous of entries in any SEO related forum. Webmasters everywhere wants to know which version will be the best for their domain so as to rank it high and high up in the search results.
Lets try and answer this dwelling as far as my knowledge would let me to. SEO is related to search engines rankings. Search engines rank domains based on some set algorithms. To what I know and understand, there is nothing in a search engine algorithm that suggests which one is best or any preference on which one to rank high. For any search engine, your site with URL as or simple are two different entries (or sites for better understanding). So considering this to be as true as possible, this means that any search engine will rank and separately. And thus, these both sites, although same, will be ranked separately by say, Google for instance.
Your users will have no problem in accessing the contents as the site will be very much accessible via either of the URLs. What will get hurt is how the search engines will be collecting the data separately in two buckets, where the collection should actually have pointed to one domain/site.

Choice is Yours
Which URL you go with is entirely up to you. Simple as that. You decide what looks good in your email signatures/sign boards or your business card for that matter. It however is a known truth that people around the globe are now used to the www.
The only thing that you need to keep in mind is that after you are done on the selection, STICK WITH IT!
Don't make the mistake of using both. This will certainly be a problem in your rankings. Search engines, as you would probably know, ranks URLs. So, for example, if 5 sites link to your page as and 15 sites link to it as, search engine rather then reporting a total of 20 inbound links to your page will report 5 for one and 15 for other URL. And then there could be problems of duplicate contents further putting risk on your site' rank. So choose one and...yes you got it...STICK WITH IT!!

The 301 Re-direction and its How-To
So you have your site both with www and without it. Now, how to deal with these problems that I just described. Well, if you are a webmaster you would know that we can do a redirection. 301 Permanent Redirection is the most efficient way plus its search engine friendly as well. There are several ways you can accomplish this. Most people prefer the .htaccess (non Windows based) way to do it.
This is how you do it:
For a single page redirection, in your .htaccess file (create one in your root if not already) use this:
Redirect 301 /old/yourpage.htm /new/
For a canonical redirect, use the below code:
Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^ [nc]
rewriterule ^(.*)$$1 [r=301,nc]

For other types, you may Google it and will find several links to help you out!

Is www Deprecated?
Some people (or rather communities :-p ) certainly thinks so. You will find a good discussion on a more official website NO-WWW

It Matters That...
At the end of the day, what really matters is that you stick to one of the format and consistently use it. The other obviously will (and should) redirect to the first so as to make more sense and not rather punish you in any rank sense.

It may be interesting to decide if you would use the www URL and redirect the no-www to it and rather go the other way round :). 
Hope you found the information useful. I would love to know your thoughts and which way you will prefer. Have a good one!

Here is the QR for this post: 

Monday, August 1, 2011

A wonderful weekend

It was 5am on a Saturday morning when the cell alarm disturbed my cozy early morning sleep. It took me ages to put it down and around 10 more minutes to get out of my bed. The only thought, as you would assume, was to somehow get back in the bed and doze off. Hate getting up that early. The next moment I opened my eyes, I was in the company of my toothbrush; beginning to mull over the various lovely dreams I rather be busy with at this hour. It should have been a couple of minutes when my mother inquired about the time the taxi was to arrive. '6:15' I said..loud enough for her to hear and soft enough not to disturb my own tipsiness. She didn't ask me to repeat so I assumed she got the message.
The taxi was on time and so was I, thanks largely to my wife for nearly all of the packing. I was sad she was missing out on this trip due to some other commitments we couldn't miss (another matter that I knew it was going to be too hot and dry for her to enjoy).
It being a Saturday and early morning time, didn't find much traffic on road and so reached the railway station a comfortable 20 or so minutes still for the train to leave. A look at the big info board confirmed that my train was waiting at platform#5. Another 5 minutes and there I was, a nice window seat and a book that promised a good read through what I expected to be not more than 4.5 hr journey. 
My destination, the hottest place I have been to in my life, was my birth place..Dholpur, Rajasthan. The train, the best I know to travel there, Taj Express. A few minutes later, my watch said its 7:10 and the train started the move. 'Nice...', I exclaimed, its good to start on time as I was too eager to reach my place. Even after so many years the place still instills a calmness in me, guess that' where I belong..away from much hype of the modern cities and hullah-bullah.

Nice weather it was, cool breeze..seemed it was to rain quickly and it would be cats and dogs as and when it happens. Another 20 or so minutes and I thought to start with the book or else I will die of boredom. The book is indeed a good read (Selective Memory, Stories from My Life), Shobha De' autobiography couldn't be lull. 
Some thudding sounds took my attention (as I was too engrossed in the book) and my head moved to see people bringing their window doors down. So much was my engrossment with the book that it took me a while to realize my arm (towards the window side) was a little wet and the skin was cooling down with the nice cool wind. Another second and I had to shut the window, much to my displeasure. Hand tightly gripped around the book and eyes all set on the rain outside...wasn't sure what was more enjoyable at that moment!!
With such a nice weather what better existed in this world apart from the book in my hand and a nice cup of coffee, I didn't know :). That's what I did for some more time, enjoying Mrs. De' narration with a nice cup of coffee. The coffee was no match to my wife' version but at the moment seemed something I could live with. The rain followed the train till Agra, Uttar Pradesh. The moment we moved more towards my destination it was getting dry and hot. The first 3.5hrs were cool with the weather being really nice to me. The next, however, was much the opposite, dry..sultry...pipping hot! It stayed like that for that day and next till I boarded the same train back to Delhi.
The stay was as enjoyable as ever. A puja to attend which my relatives made sure had some media attention to take some pics and videos. I heard my uncle repeatedly spelling my name to them to make sure it read correctly in the next day' article :) 
Around 3 hrs in that serene environment, I spent rest of the day going around the place which was as green as possible. Spotting a peacock wasn't difficult, if anything, it was more difficult to capture him. The pic on the right was the closest I was able to reach him in at least 10-12 shots. I missed my digital camera and a zoom feature in my Nexus S cam.
It sure was a tiring day but I enjoyed it with utmost pleasure. After I retired to bed, who knows when I fell asleep. The next morning with me enjoying a nice sleep, my cousin was at the top of his voice to call me in his room. Hurried as I was, I reached there with his finger pointed to the TV set in the corner of the room. It was the news and the video (shot the day before featuring me) in the local news channel :)
My uncle handed me the local newspaper with the article in there, smiling as he was, and I knew name was perfectly spelled in there!!
As always, for those interested here is some food for your smart phones...the QR code for this post. 

Get widget

Twitter Bird Gadget