The Web 3.0's Pulse : Semantic Web Trends

Currently Hot: Facebook OpenGraph Protocol

Showing posts with label Semantic Applications. Show all posts
Showing posts with label Semantic Applications. Show all posts

Saturday, August 14, 2010

Jena Tutorials

The HP's Jena Framework has become very popular lately in the Semantic Web development world . I started to notice that many of this blog's visitors came here looking for sample code about it. This is why I thought that I could help them out by providing few links where tutorials can be found.

I have noticed that many of the visitors come here seeking some tutorial or getting-started code samples about Jena , besides the code placed in its documentation. Therefore, I decided to look around the Internet and see if I can find some people who already spent some time writing tutorials about Jena . Fortunately, I found some code, which, in my opinion, could very useful if you happen to be someone starting off writing Semantic Web applications. So, here is a small list of links where Jena tutorials can be found:
I agree though, that some of those tutorials may be a few years old, but, in fact, they might serve you well in seeing some kick-off code where the Jena documentation lacks it. For example, in one of those tutorials, I saw a  working set of Jena rules - whereas its documentation was not rich on code about it. 
In case you are wondering what Jena is (which I doubt), I wrote an article describing this Semantic Web Framework a couple of months ago. 

Dear readers, have you ever worked with Jena? What is your personal experience about this framework? Would you favor some other Semantic Web framework instead? Why or why not?

Friday, August 6, 2010

Facebook Questions - Another Search Frontline

Facebook is testing the new Questions  feature - a search engine that finds relevant people to answer other people's questions. Interesting, the word "relevant" here plays great role - Facebook must be pulling data and make conclusions based on that data. "Where from ?" - One may ask. Well, the countless "like"s people do, provide that data, which is now semantically annotated. But behind the scenes, this application concerns several rivals, including Google and Twitter.

The People Search Engine

There are trials to revolutionize the way people search the today. In a world, dominated by authoritative, fast and amazingly complex algorithm for textual search, it seems there is not much to be improved. And for now, people are happy - they just type in what they are interested in, and Google (by saying Google, I also count Yahoo!, Bing and others in)  and: BANG! - it appears in the first 4 results displayed. Although today's search engines subtly show their power by answering well even if the user misspells the word or moreover, categorizing it like Posts, Tweets, Images etc. Google nowadays is even faster in updating its search index, reaching the Real Time Web Informer status.


But however, there are situations in which textual searching can't do much help. Queries like: "Hey Google, what are the songs that have reached No. 1 in UK's Chart in the last 10 years ?" or ... "Bing buddy, I am looking for a movie tonight. Basically I want comedies, like 'American Pie' or 'Dumb and Dumber', do you happen to have some recommendations for me?" etc. etc. (Examples for such situations can be quite a few, I will not go any further). Well, some of these queries might have to wait for the Semantic Search Engine to be built, but the interesting thing is there is a new trend : to build Social (People) Engines, which will not scan text, but people and their habits. These People Engines will try to discover the right person to answer human-only interpretable questions like those above. But to achieve that, these search engines need to have additional metadata about each person : her skills, interests, friends etc. Having that in mind, one can easily conclude that  building such network can be a challenging and expensive task to do - unless... unless it is built by itself - like in the example of Facebook. Facebook is lucky for having so connected network with correctly filled information such as people's names, age, photos, interests, friends etc. In my opinion, Facebook is now preparing to take advantage of that metadata it has: to build internal network for answering questions - people will answer each other's questions on any topic - Facebook will only be the platform to find the "relevant" people to answer them.


Facebook Questions Application


This application is exactly that: means for people to use "Social Search" instead of "Textual Search". A smart move, I say, because engaging real  people in answering topic-specific questions (for free!) is the currently best way to get around the technological gap that prevents us from building software agents to answer the questions for us. Whoever came with the idea of building this application, must have studied people behavior and conclude that people would react on such questions, if they feel they are concerned on some point with the topic of the question - be it their profession or simply a good or bad experience of some product. We will still need to wait to see how this invention of Facebook will impact the Tweetosphere and the ordinary search.

Google's Social Search Engine Efforts


Surprise, surprise, but Facebook did not invent this whole People-answering-questions thing. Google has been spending time on this field quite a while, resulting in an experimental application in Google Labs, which returns 20 % of the results from your Google queries as answers based on your social graph within Google and in inquiry of Aardvark (the closest relative of Facebook Questions app). Aardvark gathers each person's interests they type in and parses the question text, matches entities with people's interests and finds people that might be able to answer the questions. I have been looking into this application for a while and indeed it has proven itself to be very useful: most of the times it did find a person to be able to answer my question and ... what I really like about is that it integrates with the IMs : be it MSN Messenger, GTalk or Skype ... Pretty cool.
Therefore, I think that these kind of engines do have bright future, no matter what vendor creates them.

Readers, what do you think ? Would you use some of these services as your secondary search engines ? Do you think they will one day integrate with the textual search engines ?

Tuesday, July 6, 2010

Google, meet Facebook's OpenGraph Search

With the introduction of the OpenGraph Protocol, Facebook introduces a new concept of searching throughout the Web. Facebook's search works based on what they call "connections" between resources from their OG ontology. Their algorithms are capable of discovering related items to the input query, based on the individual's social neighborhood or perhaps on the frequency of hitting the (now famous) "Like" button. Sounds like a bundle of possibilities, doesn't it ?

FaceRank, the Social Relevance Algorithm

Of course, this is not something Facebook officially announced (it would sound corny, don't you think ?), but the point is, after long 10 years, finally there is a serious candidate to best the PageRank, or at least complement with it. But Google works fine, the whole world searches, people are happy! Why would anyone use Facebook's new lab gadget instead of tested, proven, mature, lightning-fast and precise tool? Well because, there are queries that Google Search simply cannot satisfy! Moreover, their results are based on statistical methods, no people are involved there. What makes Facebook different is the capability to deliver real-time results , fresh and relevant , without deploying complex calculations . If some event is popular, people will rapidly talk about it. Same as with Google, it will be up to the web masters to annotate their web pages with the metadata, but the key differential factor here is that Facebook has the feedback from the users. It can use the number of "Like" hits to give weight to popularity of some particular web page. What if someone puts false metadata? (One of the biggest problems in the Semantic Web, too). In this case, the answer is simple: people will not like it, they will simply ignore it if it is misleading, hence it will be less popular and will have lower positioning. Another advantage from using this approach is that metadata now contains the context of the resource, opening the gates for bringing the conventional Semantic Web Dream . Facebook  is now able to interpret user's query, does she search for related books, movies, sport teams, people... you name it, it finds it... in real time. As written in Times: Google, This Time, Its Personal.

Hey Mark, Recommend Me a Movie, Please

When someone says: "Yeah, the idea of the Semantic Web is great, but if it so wonderful, how come there are no applications to massively leverage it? You say the technology is available for a while.", usually made some point, but I think not anymore. With Facebook's ultimate way of Social Bookmarking, it becomes easily calculable of what users could want, on individual level ! How, you may ask ?
Here is what I am at. (This may be a real idea for semantic application, too). Suppose you want to watch a movie, but you are not really sure what you want to watch... Naturally, you would ask your friends or you would search through the Internet a bit to see where is the movie hype cloud at the moment... (did you realize I said, "at the moment"? Hang on.). Now imagine a widget, that simply communicates the Facebook via OpenGraph API, to check what movies do you like. The widget also supposes that since you like those movies, you have probably watched them, so it makes no sense to suggest them to you again. But how difficult it is, to write a query that says:

"Give me the most popular movies that are related to the comedies I like". We define "related to" as a simple rule: "A movie is related to another if X people that watched the first movie also watched the second. The movie gains ranking in relatedness if at least Y of that people are my friends. The movie gains ranking if there are at least Z pages with more than 50 likes on the Web". 

Hmmm, not so difficult to be written in a query language. For now some of these aspects are not covered in the OpenGraph ontology (I refer to the Movie Genre), but undoubtly, it could easily be added. On the other side, for the application user, it is as simple as logging in to Facebook, and pressing the "Recommend" button. Welcome to the Semantic reality, Neo. Btw, how do you write "My favorite movies" in Google ? :)

But appart from the interesting search ideas the OpenGraph brings, my deepest beliefs are that Facebook's reason number one to introduce this protocol has e-Marketing roots i.e. to deliberately interfere with Google's primary business model - with personalized, perfect ad targeting tool .

What do you think ? Will this Facebook API bring new methods of warfare between the web titans ? Will it provide better searching for end-users ? Will ultimately, data find us ? How will Google eventually respond ? Is this the final gate that needed to be opened, for semantic applications to be massively written ?

Sunday, July 4, 2010

Facebook and the Semantic Web: Weaving the Social or the Advertising Graph?

You probably already heard about the Facebook's new OpenGraph Protocol. It represents a new way of making connections between topics people like around the web, thus embedding metadata within the webpages itself. Why is Facebook doing this ? Does it want (really) to act as a social hub platform for bridging the Semantic Web to reality?



Finally a big player enters the Semantic Web realm. One that is recognizable all over the world. One that people have confidence in. One that promises to be powerful enough, to integrate topics from different webpages and connect them to corresponding people. One that will get rid of the chicken-and-the-egg vicious circle of Semantic annotation and Semantic Applications. One graph to rule them all : Facebook's OpenGraph.

Facebook, the Chicken and the Egg

Facebook apparently is trying to motivate webmasters to start embedding semantics into webpages, similarly to how meta keywords and meta description tags are embedded today for SEO. That would eventually give the desired push and stable ground for Semantic Applications to be finally built. People are already familiar with this way of embedding metadata, thus the motivation for them lies in the fact that Facebook will utilize that metadata whenever someone puts the mouse over the link that describes how a person "likes" something. But what is happening in background ? Is this simplified mapping to Facebook's ontology one step driven by the desire for people to share what they really like around different platforms ?  Does Facebook have hidden intentions in this whole story ?

The Impact on Ordinary Users

Well, what do average users get from the Social Graph ? Of course, they could leverage this new feature in order to spread the word about services/products they prefer or offer, providing additional fuel to marketing in Social Media. From that aspect, users will get even more specific recommendations from friends about things that might interest them. Of course, friends have similar interests and there is a good chance that they will at least be intrigued about what one's friends like. Moreover, "like" web sites that aggregate Facebook page titles and groups have begin to emerge. Some users find this aggregation amusing.

Facebook Flaws in Semantics : Why ?

As it was recently published in a post on Read Write Web , Facebook did leave flaws in embedding semantics in web pages. Some of them are known to Semantic Web enthusiasts from long time ago, such as the ambiguity problem when identifying resources. In terms of the OpenGraph protocol, there is no means to denote that two resources on the Web refer to actually the same thing. Therefore, integration between heterogeneous systems is not easy at all. Secondly, items with same names refer to same things although they point to different terms. This means there is no way to denote that a page is relevant to the car Jaguar, not the animal jaguar. Furthermore, the OpenGraph leaves no way to build relations between resources, assuming that the only relation is : is_relevant_to . This relation applies to web pages and items and items to people, respectively. This conclusion comes since there is no way to embed multiple objects into a single web page.

The Open Advertising Protocol

This is not something that Facebook publicly says, but if one gets into little deeper thinking, becomes obvious. Facebook is not concerned about allowing people brag to the others what they like. The company is concerned about mapping the users' interests in another graph, which I take the freedom to name it Open Advertising Protocol. It refers to a graph that will try to make connections between topics that might interest the user and her social graph, individually and in groups. What this means is the following: Facebook is trying to gain information about the meaning of the things because it needs more precise targeting for its personalized ads! It is fairly simple. Every time a user presses the "Like" button, Facebook gains insight on that user's interests! By having this knowledgebase at hand, Facebook will soon have enough data to improve their Ad targeting algorithm. What is even scarier, even if one does not press the "Like" button, they will be able to map your interests roughly based on your friend's interests! One might think: Fine, then people will eventually stop hitting that button once they realize this. But hold on a second! Facebook was created to fulfill a human need for social interaction, an interaction that was not satisfied by any other media before ! The point is, people are not that inert as one might think! "Like" it or not, the Big Face will be able to find out who we are, who we hang out with, what are we interested in aaaand ... what companies have better chance of selling to us!

What do you think? What is the reason for Facebook to enter this Semantic Web Game ? Why does it leave flaws, although it has both knowledge and infrastructure to make it differently? Does it really want help people share things they like or this is just a preparation for the Perfect Advertising Tool and even bigger profit ?

Sunday, October 25, 2009

Jena, a Framework for developing Semantic Web Applications


Jena, Semantic Web framework, advantages and features

 Jena is a Java framework for developing Semantic Web applications. It has been developed by HP Labs and it is an open source project. Basically, Jena provides Java environment for working with RDF, RDFS, OWL, SPARQL and reasoning engines. The Jena framework creates an additional layer of abstraction that translates the statements and constructs of the Semantic Web into Java artifacts, such as classes, objects, methods and attributes. These artifacts reduce the effort needed for programming Semantic Web applications. One of the strongest sides of Jena lies in its excellent documentation. The exhaustive resources, including descriptions and tutorials that can be found on the Web encourage programmers to further develop their Semantic Web applications utilizing this framework.
As part of its RDF features, Jena offers managing with RDF resources, writing them in RDF/XML, N3 and N-Triples format. Jena also supports working with the RDF Schema, by providing API for all the vocabulary extensions it brings. Moreover, Jena covers the usage of OWL, in one of the three variants: Full, Description Logic, and Lite. The OWL API provides the ability to navigate through the graph, locate resources and retrieve them from the model. Regardless to the schema and the data models (which can be separate resources) used, Jena can simultaneously work with multiple ontologies from different sources. The API which comes with the framework makes the knowledge sharing process extremely easy, as every resource comes with its URI, Jena is excellent in working with the knowledge shared across the (Semantic) Web. The framework also covers methods for validating an ontology and derivation logging, which enables the developer to see how Jena concludes the answers of the query.
Regarding the persistence storage, Jena perfectly works with files containing OWL or RDF data, but has an API for database backend as well. Because of its high level of generics crafted into its software design, Jena can be easily bound to SQL databases from different vendors. All a developer needs is an appropriate driver for the particular SQL database.
Querying the knowledge graph is an important topic when discussing semantic web frameworks. Jena supports querying the model through the API, or by directly constructing SPARQL query to retrieve the results. The knowledge base can be attached to a web server designed especially for Jena, named Joseki (www.joseki.org). Joseki acts as a mediator between the SPARQL query input through GET or POST HTTP methods, and returns RDF/XML response with the results, which can be further formatted with XSLT.  
Perhaps the most powerful component of the Jena Framework is the Inference API. This API contains several reasoner types, which efficiently conclude new relations in the knowledge graph. Among the reasoners, there are: RDF(S), OWL, Transitive and Generic reasoners. It is worth mentioning that Jena is compatible with third party reasoners, such as the Pellet reasoner. All of the reasoners can be configured individually, by creating special resources that contain the desired configuration and  then using it to perform the reasoning. For example, the reasoned can be configured to run in forward-chaining or backward-chaining mode, or an OWL reasoner can be instructed to use a Description Logic (or Full or Lite) memory model specifically in the favor better reasoning performance.

Disadvantages

Despite the powerful abilities and the high level of abstraction provided, Jena has some serious disadvantages. For instance, when retrieving datasets, the framework places all statements into the main memory, often causing an overflow in the heap of the Java Virtual Machine (JVM). Therefore, the needs significant amount of space, depending on the number of statements that are retrieved in the resulting data set. This is also true even if one decides to use SQL database for persistence.
The second disadvantage is regarding the threading. Namely, Jena is not thread safe and consistency and concurrency issues can easily occur. The API provides methods for declaring critical regions but it is up to the programmer to take care of the threads using the model.
The third, and possibly the most relevant disadvantage is the cost of the inference process. Inference capability is one of the basic features of the knowledgebase and yet the most powerful one. Without inference, a knowledgebase would not be much different from an ordinary database. As mentioned earlier, the reasoning process infers implicit statements in the knowledge graph. Hence the number of edges in the graph rapidly increases, requiring more time to navigate and locate a specific resource from it. Adding large number of statements in the knowledge model is a time- and memory-consuming process. However, efforts are being made to decrease these high costs by using methods known as graph closure and graph reduction.

Summary

The Jena Framework is an excellent tool for managing resources needed for the Semantic Web applications. Being developed in Java, it is applicable to various environments. In addition, it is open source and strongly backed up by solid documentation. Even though it has some significant disadvantages, it is still one of the most powerful frameworks for Semantic Web technologies and holds the potential to become de facto standard when it comes to developing such programs. Frameworks like Jena are worth investing in, since they might play the key role in the evolution of the WWW into Semantic Web, predicted by Sir Tim Berners Lee.

Friday, October 9, 2009

What Would You Do With RDF Organized Knowledge ?

So, lets say that there is an ideal tool for creating RDF from your HTML pages. And now what ? This question came to my mind... What is the first application you would write knowing that many sites publish their knowledge in RDF / OWL format ? The sad thing is, I could not answer immediately. So think about it, what would be the amazing benefit of publishing RDF ?
If anyone has implemented such applications, feel free to share them here.