My Opera Embraces SPARQL
Monday, December 12, 2005 2:46:36 PM
The Opera Community is the first site that can be queried using the SPARQL language. What's that? SPARQL is a language that can be used to formulate very precise searches in the data. Not a lot of people know SPARQL, so once again Opera is on the forefront of research, and it was very enthusiastically received the research community, see for example XML.com's editor Kendall Clark's article.
We hope that people now will take the opportunity to learn it! Those who choose to do so will follow the current developments of the "Semantic Web". We think that in the future, reusing data in various contexts will happen by SPARQL queries. One blogger commented that "this should be enough to get people on the track to build GUIs and Web 2.0 stuff on top of Opera Community." Go for it!
We hope that people now will take the opportunity to learn it! Those who choose to do so will follow the current developments of the "Semantic Web". We think that in the future, reusing data in various contexts will happen by SPARQL queries. One blogger commented that "this should be enough to get people on the track to build GUIs and Web 2.0 stuff on top of Opera Community." Go for it!







Danieldan1el # Monday, December 12, 2005 2:54:03 PM
Ivan MinicSerbianFighter # Monday, December 12, 2005 2:59:07 PM
Jere # Monday, December 12, 2005 2:59:42 PM
Eddieelcid73 # Monday, December 12, 2005 3:04:41 PM
Tadfroggy420 # Monday, December 12, 2005 3:11:15 PM
FataL # Monday, December 12, 2005 3:11:17 PM
TomCrash # Monday, December 12, 2005 3:15:32 PM
DiMaple2005 # Monday, December 12, 2005 3:16:37 PM
Great!
Jakub81 # Monday, December 12, 2005 3:21:00 PM
DiMaple2005 # Monday, December 12, 2005 3:21:56 PM
Great!
Eddieelcid73 # Monday, December 12, 2005 3:25:35 PM
Like for example, when we want to pull data about a username, how do we know to use "nick" instead of say... "username"?
Is there a listing? Or do we just query everything? Am I not asking the right questions?
Eddieelcid73 # Monday, December 12, 2005 3:32:13 PM
NoobSaibot # Monday, December 12, 2005 4:03:06 PM
Kjetil Kjernsmokjetilk # Monday, December 12, 2005 4:11:16 PM
You also have the option of trying out queries and see what is returned.
But it is indeed not easy to find out and it is a topic for research now. We are a part of an international research community, and much attention is given to finding ways to automate service descriptions. Since the scale is so large, that's very important. So hang in there, we're following this very exciting field and will return with it when it is ready!
Eddieelcid73 # Monday, December 12, 2005 4:32:29 PM
Eddieelcid73 # Monday, December 12, 2005 5:35:23 PM
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
SELECT ?creator ?post ?title
FROM <??????????????????>
WHERE { ?user foaf:nick "haavard" .
OPTIONAL { ?user foaf:name ?creator . }
OPTIONAL { ?post foaf:maker ?user . }
OPTIONAL { ?post dc:title ?title . }
}
NoobSaibot # Monday, December 12, 2005 6:48:32 PM
Eddieelcid73 # Monday, December 12, 2005 6:55:19 PM
I would assume that if we are going to mash up somehow, we need to hook up to Opera to get the data?
I'm using http://www.ldodds.com/blog/archives/000213.html as an example to by... there is one example there that uses both FOAF and the Dublin Core.. I figure that is where I would start:
So the prefixes are the same as the example included here, but there is no FROM.. so how can I put this on my site?
Eddieelcid73 # Monday, December 12, 2005 6:56:40 PM
Words # Monday, December 12, 2005 7:13:50 PM
But if it's Opera and a first, then it's gonna be great!
NoobSaibot # Monday, December 12, 2005 8:22:52 PM
Hermenhermen2048 # Monday, December 12, 2005 9:00:42 PM
FlorianMyFriendJack # Monday, December 12, 2005 11:26:44 PM
Northgrove # Tuesday, December 13, 2005 9:37:37 AM
You ask a website a question using the SPARQL language and it gives you the answer. If widely adopted, you could e.g. ask a website for hardware drivers and it would give you the download location. Instead of navigating a site, where all sites use different layouts.
Kjetil Kjernsmokjetilk # Tuesday, December 13, 2005 2:19:23 PM
And then, there's the FROM clause, it is not quite like the FROM of SQL. The idea is that you can name certain parts of the graph, and the FROM clause allows you to restrict the query to that part of the graph. If, I would start indexing other sites on the web and enter those data in the my.opera.com database, then I might add a name for those other sites I index and allow you to use the FROM clause to restrict your search to those sites.
For now, you don't need any FROM clause, you just use the URL
http://my.opera.com/community/sparql/sparql?query=
URL-encode your query and add it to that, and off you go! :-)
The links to the examples are URL-encoded like that.
BTW, beware that the specifications here are still working drafts, and so they still change. I don't anticipate any big changes now, but note that the namespace URI of the results has changed in the specification but not in the library, so I'm not 100% uptodate here yet.
Eddieelcid73 # Tuesday, December 13, 2005 2:22:28 PM
That's why I asked about the "FROM" statement earlier. I'm not trying to act like I know what this is all about, but the W3C links are difficult to follow and google searching for tutorials is fruitless.. I've found a couple sites that have some samples/examples, and even a demo engine similar to what Opera has here. It's just putting all the pieces together is tough.
Kjetil Kjernsmokjetilk # Tuesday, December 13, 2005 2:53:34 PM
First, there is an introduction at
http://www.xml.com/pub/a/2005/11/16/introducing-sparql-querying-semantic-web-tutorial.html
which is rather good.
The main thing is that you construct URLs that will give you certain responses. Those URLs can get rather ugly. For example, the first example is simply this URL:
http://my.opera.com/community/sparql/sparql?query=PREFIX+foaf%3A+%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0D%0ASELECT+%3Fblog+WHERE++%0D%0A++%7B+%3Fuser+foaf%3Anick+%22stephan%22+.%0D%0A++++%3Fuser+foaf%3Aweblog+%3Fblog+.+%7D%0D%0A
So, you get the results by simply visiting that URL. Now, the next thing is to use those data. That part has to happen on the web backend or in Javascript, AJAX or something like that. Since I'm a server guy, I would probably write something that would launch queries against the backend in Perl, and when getting back data, transform them using XSLT to get the data I want out to the user. It is hard to be more specific without knowing what development platforms people use. In XSLT, you can also use document()-calls, so you could possibly use that and XPath to get the data you want.
As for AJAX, there has been done quite a lot of work on this, there is a client available: http://xmlarmyknife.org/docs/rdf/sparql/ajax.html
but I'm not sure how much work would be involved in making it use the my.opera.com model. This is a very interesting development though, and it is the topic for another of Kendall Clark's articles: http://www.oreillynet.com/pub/wlg/7823
Eddieelcid73 # Tuesday, December 13, 2005 6:42:32 PM
fx910 # Tuesday, December 20, 2005 1:10:37 PM
Ryan BergemanTabris17thAngel # Thursday, December 22, 2005 2:40:29 AM
Thanks for giving us a place to familiarize ourselves with it!
One Eyed Pikerfalkons54701 # Monday, January 16, 2006 3:12:52 AM
qicai02 # Thursday, June 15, 2006 2:28:23 PM