Skip navigation

One of the main question about using semantic web is related at why we should use it instead of a common fully functional DBMS. They are powerful, they are easy to use through age tested ORM, they are widely spread, they are solid solution. So why change them with an RDF repository, where actually there are few solutions (Jena and Sesame between all), few documentation, few real examples, and most of all few killer applications that shows the power of semantic web? Actually it is used for research projects, in university environments, and they are finding difficulties to break down into the real market.

The question now is obvious.

Should we enter in the semantic web world, or should we continue to use DBMS?

The answer is quite simple. If you are not curious and you don’t wanna risk your mental health, continue to use DBMS. If you are a bit crazy (in the good way), you like new technologies, and you trust to Barners Lee just because he is famous and has huge groups of people following him, why not try! I’m of course in the second group.

I’ve been reading quite a lot of papers and documents about Semantic web lately, but still I’m not sure about the power of this solution. It seems to be the solution to an open web, where intelligent agents can move from a page to another one, solving all your life questions. The typical example is the possibility to arrange a trip, telling to your agent when, the place, the upper level price and some other info. You will wait few seconds and your agent moving into the semantic web can give you an answer. Sounds cool of course, but in 7 years nothing close to this is born. Of course we need time to spread new technologies, but lot of people are becoming quite inpatient, and are thinking that the semantic web is not a solution, that the semantic web is just a nice idea, that will change the web, but that this change will never become true.

The reasons are several. We can find people that worked for lot of years on Semantic web and got tired to not have results, other people that read what is semantic web from wikipedia and they think this is enough to judge this technology, and other people that see too much complexity on RDF, SPARQL, SWRL, OWL and other strange acronym. The final point is that only who can spend lot of time on learning semantic web, can (maybe), understand its power (if there is). It’s not like learning Ajax, or like making a PHP page, and it takes long time to go into your mind.

The motivation is that Semantic Web sound cool, easy for the “web” word that it has inside, but in reality it is formed from technologies that are not easily spread. The people that work on Semantic Web (mainly university) do not care at all at us, poor developers. The just keep writing technical papers, huge detailed documents, but they forget to present their ideas in an easy way. Until this will not change, hardly the average developer will get into these technology, and hardly he will have the time to reach some results.

From my side I studied semantic web because it was sounding cool (doesn’t it?!) and because my professor wanted to use it for my master thesis. So I implemented a repository RDF and now I’ve a semantic storage system. And now? What can I do with all my triples? What can I do after loosing 2 months instead of 2 days to build up my storage system? As I loosed 2 *months* (and not 2 days) I’ll try to convince you that semantic web is good, and that DBMS is bad, so I’ll be a bit colored… hope you don’t mind.

The advantages of storing the knowledge through triple are many. First of all we can use *reasoners*. They are piece of software that are able to infer new knowledge, using the principles of Programming Logic. For example if I’m the son of my Rici, and Rici is the son of Alfi, then Alfi is my ganpa (also if the direct relation is not defined). I know, its basic, but is just for give you a sight of what prolog means. Then we can easily define some *rules*, through which we can define new knowledge. For example we can define a rule that allow us to say something like

if my son will be back at home later than 2, then tonight disable the heating system in his room

Sounds funny, but its something can be done, and something about I worked in my thesis (building automation).

But still… How many people need these functionalities? We are web developer, we have our framework that do everything for us, and makes us happy. True? For all the time I was implementing the RDF repository, building web services on top of him to make it easily accessible from different components, I was continuously thinking “Why am I not using my DBMS and my ORM… Am I stupid?… I could have done this in 1/20th of the time I’m spending… It would be much more well tested… more stable… bla bla bla”. I did this for long time, and then I said “ok, if people use it, there will be a reason”. Still… I wasn’t sure, and to be honest I’m not right now, but listen at this.

We said we can use reasoners and rule systems, and lot of other tools are available for semantic web, making it tempting. But what I’m thinking right now, what made me writing this article, is that the real power of the semantic web is the ability to make the web connected, in the real way. Lets make an example. Think at your typical web application. It has its DBMS and if you are a good guy it offers some web services through REST. But what happens if you wanna connect this information with something else?

Lets say we have an application that allow me to control my house, or any other building. It’s a cool application, where I can open the light and control my television, lets say all through my shiny new IPhone. Sounds cool, no? But we can do better… what If I wanna connect with the outside world? What if I wanna see information related to all my DVD? If I have a normal DBMS system the solution is this. I should modify the schema of some tables, I should add some functionalities, I should be able to access to a web service that give me back information and I should be able to show them to my IPhone. Sounds still cool, because we can do it, but its getting more complicated, more difficult, and I don’t like this. What if I wanna connect the fridge with a supermarket or even other things?

Lets port this example into the Semantic Web. Lets say all our devices are defined in RDF and that we have a link that identify each DVD we have at home. Then lets say I wanna some information about them. If there are RDF information that describe my DVD on the web I can retrieve these information almost automatically, show them to the user, and be happy because I’ve not done one change to my application. What I’ve done was following the link that represent my DVD, follow it, and find useful and meaningful information.

This mechanism is just powerful because if the web would be *semantic*, I could really move on it without limits. For example I could see the information related to my DVD, then move from them and read some information about the main author, and from these to the opinion of some users… This is the connected web, where we can move and see what we are interested in. It’s powerful, dynamic and flexible, and we do not need to change anything about the application structure.

Still I’m not sure this can be done only with semantic web. During this period I also read a book about RESTful web services, and I really do think that it has lot of common points with semantic web. Both think about a connected web, made from resource, where we move from one to another as the web do today with people. The difference is that this time REST and Semantic Web are thinking at a way to make information easily understandable to machines. I think this combination can be really interesting, but it would need another article :)

So, in the end, I can’t say the semantic web is the solution to all our problems. It’s still difficult, far away from being easily adopted from developers, and its idea is not well understood from people (me either). But I can say its not dead. It has the time to become reality. Maybe we need some new tools to integrate to our preferred frameworks, real and easy example that everybody can understand, or maybe something else… but probably this idea will become true.

Maybe it will change name (Linked Data?), but the web will not be the one we know today.

This time I’ll not be writing some technical post, but I’ll write an excerpt of a book I’m reading right now. I should say that I read normal books just once in a year, and also if I feel as I should change this, I’m almost sure it will not happen… Anyway, I wanna write this thought just because sometimes, as lot of us already know, we don’t feel our freedom. We have lots of constraints in our life, we have a figure to show up, and lots of rules. And as I usually forget that we still are the owners of our life, we decide what to do of our life, I hope that writing this piece of text will help me somehow in the future… to remember.

Ok, lets stop telling this kind of stuff, and lets write. It’s in Italian, so sorry if somebody will not able to understand it, but a translation can’t comunicate the real feelings. The book is titled Giovanni Allevi, la musica in testa and speaks about a guy, a composer, that probably lived only following a dream. Something that in our day is difficult to find.

In realtà dobbiamo evitare di strozzare il torrente impetuoso che è in ognuno di noi, dobbiamo evitare l’inibizione e tuffarci nella danza delle cose, fosse anche il traffico cittadino.

Ma l’inibizione nasce nel pensiero solitario: La nostra piccola mente non ce la fa a contenere un universo che danza, e allora concepisce il concetto dell’irragiungibile, dell’impossibile, della delega a forze altrui.

Invece il non pensare è apertura e paradossalmente è comunicazione profonda con gli altri: ora che siamo di fronte, dimentichiamo i nostri ruoli, i nostri nomi e riconosciamoci come esseri umani, come miracoli. Un essere umano, chiunque sia, è il culmine la cui natura è giunta e da essa si differenzia per l’estrema imprevedibilità, per la misteriosa e prodigiosa presenza.

I could say also that sometimes we live some moments of our life without knowing what will happen in the future, and this can be scary. But this scary can be also energy if we decide to, energy that can change our life into a followed dream.

I’m here to post about an event that in the rest of the world could sound just normal, but that here in Italy I rarely saw. Before telling you what I’m talking about looks at these photos, and tell me what comes to your mind. For me this looks like a group of friends, that are meeting in a awesome place in Tuscany, to spend a weekend enjoying the sun and the company of each other. And for you?

Ok, back to reality. This was TechTalk Italia 2008, a meeting organized by netwo.it with the aim to make natural the exchange of ideas, of experiences, of serious and no-serious staff. All about Web 2.0. All this in the most comfortable way, in the country side of amazing Italy. A better idea of what a TechTalk is, can be given from this excerpt:

Techtalk is an event originally organized by Martin Varsavsky for the best european/world web2.0 entrepreneurs. The whole weekend spent together, during a few sessions everyone participating will give a short presentation of her/his activity/experience. Our families will be with us and we will also take the time to have fun all together.

The best part for me, although to see the the web in Italy is that alive, was the fact that almost all the people working on Mikamai was there! I had the luck to work with them for one month this year and they are a new, really cool! company, born with the aim to make everything unconventional, and despite the motto, they are really doing this!

The other aspect that made me happy is to know that lot of people participating at TechTalk use Ruby, the language that I love and that I use everywhere I can, also when I should use something else! This reinforce the idea that Ruby is a catalyst for great minds and people that do and don’t only speak ;-)

Stay tuned to Mikamai…

For people as me that develop on the web using a lot HTML, CSS and JavaScript usually desktop applications don’t appear cool. Ok, short and direct, and we know we are right, but we also know that desktop applications are still necessaries. Just think at Photoshop and at making some heavy operation such as filtering, applying effects, etc. You need the power of your computer, at least if you wanna be fast and productive. And also if you can still use a web application for tasks like the ones photoshops allows to do (see photoshop express), you should be a bit crazy to use it if working on computer graphics. So maybe we was wrong. Photoshop is a great application, and lot of people like it, but still in my mind I’ve this disturbing sentence that repeat

I know we need desktop application, but Web ones are the coolest ever, no?

We couldn’t say something similar before the birth of Ajax, but now we can! We can give a great user experience to people visiting our site, we can make shining effects, and come on, how many times did you click your right button of a page expecting a flash menu, but you found that those amazing effects was build in JavaScript! Then we have XHTML to give a structure to our pages and we can use CSS to change it in all the possible ways, for all the possible devices. You can moreover take advantage from the usability knowledge that grow day after day on web topics, to let all people to see your applications.

So Yes, I’m even more confident about the fact that XHTML, CSS and JavaScript are cool and that they are just the best. But then my mind (a sick one of course) start to think again.

Why, if the web is so nice and so cool, we still use desktop application?

In the beginning we was taking as example Photoshop, but there are lots of other desktop applications that we use, even me, much more smaller. Just think at the phenomena of the moment, think at Twitter. It made a revolution about the way we do blogging. Probably you are thinking at why I’m speaking about Twitter when speaking about desktop application. Yes, it is a web application, and if it wasn’t, it wouldn’t be so popular, but let’s listen to this. Twitter gives to developers a great RESTful API that allows third parts application to access to some information. Now you got it I guess. The point is that everyday in my feed I can see new desktop applications that you can use from your computer to modify your status, to follow your friends, and so on (some of them are Twitterrific and Twitterbox but there are lots more). They are just popular.

Yes, I said a desktop application. Sometimes they are just better, as in this case. I say this because sometimes we don’t wanna open a web page, put the address, make a login (maybe) and look at the results. It’s a long way to follow sometimes, so having your desktop application, you can just click to your menu icon and you open it. All the functionality ready for you, now! Probably this is the best quality of desktop application: they are fast!

But my mind still work saying that I’ll never be back to build desktop applications also if sometimes gives you advantages. It’s not something personal, but desktop applications right now sound old style and not cool at all. They don’t take my attention, my interest! I remember when I was in the High School and I was programming in Delphi (I still can’t understand how they could teach me it), making my first splash screen, my fist connection to a database, and so on. It was nice experience, but it was… well, 7 years ago, 7!

Still a doubt, a deep one. If we don’t build a desktop application, probably we will loose some clients ,or even worse we will not give the user experience we would like. And we love make people happy, do we?. We love HTML, CSS and JavaScript, together with Flash ad FLEX, right? So why don’t use them to build desktop application! You think I’m crazy, you think this is a dream… how can we do this?

The answer is Adobe AIR together with Google Gears.

Stay tuned and be ready to the second part, where we will go more in deep with Adobe AIR and Google Gears. For the impatients ones, you can take a look to a fresh free book released from Adobe introducing this new tecnology to Javascript programmers. I let also this funny video, a parody that tells us why we shouldn’t install applications on our computers (some parts are in italian, but Im sure you will like it anyhow).

Javascript in the last years is growing in popularity, and this thaks to Ajax, but even more thanks to some frameworks such as Prototype and JQuery (and lot lot more…) that solved compatibility problems, and made JavaScript programming even funny.

Now I wanna speak about a problem where I felt into when using Prototype (but it would happen also with JQuery and company). This framework allows you to make rich classes in your code in a real easy way, but whenever you do this you usually got into the problem of handling options.

Let’s take a simple example. Assume you wanna create a Javascript Widget as GMaps, that let you to navigate around an image. Following the prototype way you should start writing something like this


/* Definition of MyMap Class */
var MyMap = Class.create({
initialize: function(options) {
/* initializazion of our object */
},
/* other code here */
})

As we can see, we are passing an object to our initialize function, in this specific case an object called option. In this object we will have some options, defined as follow.


/* Instance of MyMap creation */
var map = new MyMap {
container: 'container-id',
zoom_level: '1',
initial_position: {top: 10, left: 20}
/* and more others... */
}

With this code we are instancing a MyMap object, and we wanna pass some options, so next time we will use the map object, we can call tem using something like map.options. To do something like this we can modify our initialize method. The first time, I did something like this.


var MyMap = Class.create({
initialize: function(options) {
*/ check the presence of at least one option because
we could call MyMap also without options */
if (options) {
/* now I set the options */
this.options.container = options.container || 'default-container-id';
this.options.zoom = options.zoom || '0';
this.options.positions = options.positions || {top: 0, left: 0};
this.options.sizes = options.sizes || {height: 200, width: 200};
this.options.speed = options.speed || 10;
},
/* other code here */
})

It wasn’t bad, and it was quite clear, but reading some articles on the web I found something that took my attention. You can find the article here, and if you look at the code in the last part, you will find this way to initialize options.


initialize: function() {
this.options = Object.extend({
container: 'container'
}, arguments[0] || {});
this.initLinks();
},
/* other code here */

What took my attention the most was that Object.extend, so I tried to make some research about, and I found a better way to initialize my options. Let’s see how this mechanism works out. The Object#extend method copies all properties from the source to the destination object, so we can easily understand how that code works. Basically we define all our default options, and then through the extend method we can override those options that are defined from the user. Let’s see how could be our new code.


var MyMap = Class.create({
initialize: function(options) {
this.options = Object.extend({
container: 'default-container-id',
zoom: 0,
positions: {top: 0, left: 0},
sizes: {height: 200, width: 200},
speed: 10
}, options || {});
}
})

As you can see now the code is much less than before, and it looks much more clear. In addition to this we don’t have anymore the need to check the existence of the options argument with the if we used in a first glance. I Hope you will find these snippets of code useful and if there are any doubts, don’t hesitate to put some lines in the comments.

Give style to your code!

Follow

Get every new post delivered to your Inbox.