My Opera news » My Opera Embraces SPARQL

My Opera Embraces SPARQL

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! smile

Comments

Danieldan1el Monday, December 12, 2005 2:54:03 PM

I really dont get this stuff no matter how many times I read it.

Ivan MinicSerbianFighter Monday, December 12, 2005 2:59:07 PM

Congrats developers wink

Jere Monday, December 12, 2005 2:59:42 PM

Cool. Now if we still got a JavaScript alert() to notify about new private messages.

Eddieelcid73 Monday, December 12, 2005 3:04:41 PM

Mash ups here we come! This is great.. it's a bit further beyond the scope of what I can comprehend, but I get the idea, and I look forward to testing some sample mashups using SPARQL.

Tadfroggy420 Monday, December 12, 2005 3:11:15 PM

Is this the big suprise?down

FataL Monday, December 12, 2005 3:11:17 PM

Cool! Will try it! up

TomCrash Monday, December 12, 2005 3:15:32 PM

Now thats a great thing! pirate

DiMaple2005 Monday, December 12, 2005 3:16:37 PM

祝福伟大的Opera~
Great!

Jakub81 Monday, December 12, 2005 3:21:00 PM

Great job, but Web 2.0 is a hoax!

DiMaple2005 Monday, December 12, 2005 3:21:56 PM

祝福伟大的Opera~
Great!

Eddieelcid73 Monday, December 12, 2005 3:25:35 PM

So how do we know what to query for?

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

Regards to the big surprise.. I don't see how this is related to New Years, or New York... so I would wager no. Also, the posts/blogs linked to are dated in November and are talking about SPARQL as if it's not big deal, so I would wager you have some more news coming.

NoobSaibot Monday, December 12, 2005 4:03:06 PM

just in case you didn't notice here

Kjetil Kjernsmokjetilk Monday, December 12, 2005 4:11:16 PM

elcid73: That's a very good question! For now, it requires knowledge about the model, and the various vocabularies used. For the user data, most of the data is described using FOAF, so that's how you could make a qualified guess a username is foaf:nick. The FOAF specification has also some data for images, and we use that. For the blog and forum posts, we use mostly the Dublin Core terms for titles, descriptions and contributors.

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

ok kjetilk- I thought maybe there was just some concept that I wasn't grasping. Now that I know that, I feel more comfortable experimenting.

Eddieelcid73 Monday, December 12, 2005 5:35:23 PM

So.. if I wanted to move this example over to my website and query opera community, how would I use the "FROM"??

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

i see no FROM in the examples. i guess the prefix of the datafields defines the FROM.

Eddieelcid73 Monday, December 12, 2005 6:55:19 PM

Yeah there is no FROM, that's why I'm asking.

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

Also, is there going to be a specific forum created (unless I missed it) to post these questions in?

Words Monday, December 12, 2005 7:13:50 PM

I'm completely baffled by this confused

But if it's Opera and a first, then it's gonna be great! party

NoobSaibot Monday, December 12, 2005 8:22:52 PM

elcid73: hmmm, we need a documentation of all the "columns" and "tables" we can query smile

Hermenhermen2048 Monday, December 12, 2005 9:00:42 PM

This would be great in conjunction with an "Opera Platform" application! p

FlorianMyFriendJack Monday, December 12, 2005 11:26:44 PM

i have no clue at all what this is about but... guess it must be great if it is encouraged by Opera.

Northgrove Tuesday, December 13, 2005 9:37:37 AM

For the confused, I believe it's to query websites for information using a standard language.

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

To clear up some confusion: First, NoobSaibot, yup that's the next step, it goes into the service description problem, a problem that is being worked on by the community.

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 how I understand it.. but from what little I'm gathering.. the examples shown here are the opera website asking itself for information. But I can't see how to ask the opera SPARQL engine from somewhere else (which is the whole point)

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

Right!

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

Well all that just makes perfect sense. I was just tying to make things harder than they actually are I guess because that's what I first tried doing.

fx910 Tuesday, December 20, 2005 1:10:37 PM

I have to admit: I just don't see the value. It's clearly far too complex for regular users, yet different enough from (ANSI) SQL to represent a steep learning curve for programmers. Why not just use a subset of SQL, or some other well-established query language (such as the "attribute:value" form that most search engines use)?

Ryan BergemanTabris17thAngel Thursday, December 22, 2005 2:40:29 AM

I've been reading through the spec, and it looks pretty sweet! I'm considering incorporating it into my senior project (though I'm not quite sure how I will just yet). ^_^;

Thanks for giving us a place to familiarize ourselves with it!

One Eyed Pikerfalkons54701 Monday, January 16, 2006 3:12:52 AM

I have used cracker codes that resemble this, I use Linux all the time, But I run many Drives for my needs, Including Windows on one - Witch I will say is my Weekest OS, So see what this is, But I feel it's been around now that I know for about four an a half years, But you are very wright about opera its thee leader of the pack, with that I will be on my way THE FALKON

qicai02 Thursday, June 15, 2006 2:28:23 PM

Congrats developers !I have to admit: I just don't see the value. It's clearly far too complex for regular users, yet different enough from (ANSI) SQL to represent a steep learning curve for programmers.

Write a comment

You must be logged in to write a comment. If you're not a registered member, please sign up.