07.18.06

Atom/XHTML/RDFa in Queso

Posted in development, semantic web, web at 12:03 am by wingerz

Elias posted about Queso, our summer project that mixes the Web2.0 (REST-ful URLs, JSON, some nice Ajax-y UI libraries) and Semantic Web (data stored as RDF, queryable via SPARQL) worlds.

Content is inserted into the system is by posting Atom entries. The entries are stored as RDF (converted via Atom OWL by Henry Story), so their content and metadata is accessible via SPARQL queries. Because Atom relies on both an ID and a timestamp to establish the uniqueness of an entry, the ID cannot be used as the resource that serves as the subject of statements describing the particular Atom entry. Instead we use a blank node that has and http://www.w3.org/2005/10/23/Atom#updated> properties. All of the triples for a particular Atom id are stored in a named graph that has this id as its name.

Of course, we might want to store some additional RDF triples in addition to the ones that represent the Atom entry. For this we use RDFa which gives us a means of embedding RDF triples in XHTML. Using RDFa is one way to transition from the current web towards a more semantic web.

If the Atom entry is posted with the content type set to “xhtml”, Queso will run an RDFa parser on the content, extracting any embedded triples and storing them along with the triples for the entry (in the same named graph). For example, posting the following as content type “xhtml” (if you are posting with the ATOMbrowser, leave off the enclosing divs):


Wing Yung

will result in the following triples being added to the store:


_:thisEntry a Person ;
	  .
	  .
	 "Wing Yung"^^

along with other triples describing the author, title, content, summary, etc. of the Atom entry:


_:thisEntry a ;
	  .
	 "2006-08-25T23:22:00.995Z^^ .
	...

Note that we use in the XHTML as a magic resource that gets replaced by the blank node that represents this particular Atom entry.

Once the content has been posted it can be accessed in several ways. The first one is the ATOMbrowser. Navigate to the appropriate collection (“wingerz”) and entry (“RDFa test”). The content and other attributes are viewable in the right-most column. Grabbing id (urn:lsid:abdera.watson.ibm.com:entries:397859049), we can visit the entry’s content, which is output as XHTML.

Finally, if you go to the SPARQL browser, you can query the store for the triples. Click the “Graphs” tab and add the id (urn:lsid:abdera.watson.ibm.com:entries:397859049). Uncheck the introspection document and click back over to the “Query” tab. Run the default query (which brings back all of the triples in this named graph). For less data try the following query instead:


SELECT ?person ?blog ?pic
WHERE {graph ?g {
    ?person a  ;
       ?blog ;
       ?pic .
  }
} 

And of course, if you hit the SPARQL endpoint, preferably with Lee‘s SPARQL Javascript library, you can request your output in JSON format so that your client never has to parse RDF or Atom.

So what good is this? We hope to serve both data (content as Atom and RDF) and applications (content as Javascript and XHTML) off the server. Application deployment should be trivial. Semantic Web-aware developers can easily create, remove, update, and delete data, speeding up development time. And because everything is accessible through SPARQL, others can use the data or combine data from different applications in interesting ways.

See also:
Ben‘s entry about posting Atom entries using Abdera.

5 Comments »

  1. snellspace.com » Blog Archive » Carpe Queso said,

    July 18, 2006 at 2:05 am

    [...] Update: more here. [...]

  2. semanticpool :: thoughts :: Queso. Atom store. said,

    July 21, 2006 at 1:49 am

    [...] The actual data-storing takes place using RDF-Data. But the data is inserted by the user or the machine using Atom-syntax: Content is inserted into the system is by posting Atom entries. The entries are stored as RDF (converted via Atom OWL by Henry Story), so their content and metadata is accessible via SPARQL queries. […] [...]

  3. RDFa » Blog Archive » Would you like Queso with that? said,

    July 21, 2006 at 10:35 am

    [...] That’s why we’re very excited to see a bunch of really smart folks at IBM jumping into the fray with Queso, a web2.0/semweb server that, among other things, parses RDFa. Cheers to Elias, Wing, and Ben (Szekely) for some great implementation feedback, which you can read, as always, on our open mailing list. [...]

  4. The Hundredth Monkey Phenomenon » Developing with RDF: A Survey said,

    January 22, 2007 at 1:30 pm

    [...] Otherwise, I believe in the dream and the vision, and I definitely recommend that anyone interested in RDF development should check out Queso. Very promising server-side component to this architecture. del.icio.us this! [...]

  5. Erix Lab » 3. SPARQL Language said,

    June 11, 2009 at 1:34 am

    [...] The current, standardized version of SPARQL deals only with retrieving selected data from RDF graphs. There is no equivalent of the SQL INSERT, UPDATE, or DELETE statements. Most RDF-based applications handle new, changing, and stale data directly via the APIs provided by specific RDF storage systems. Alternatively, RDF data can exist virtually (i.e. created on-demand in response to a SPARQL query). Also, there are systems which create RDF data from other forms of markup, such as Wiki markup or the Atom Syndication Format. [...]

Leave a Comment