Re: Named Graphs in RDFa

On Sunday 01 February 2009, you wrote:
> Hi all,
>
> This is an idea that Kjetil Kjernsmo and I have been looking at for a
> couple of weeks:
>
> http://buzzword.org.uk/2009/rdfa4/spec

Thanks for posting, Toby!

The reason why I started to think about this is that I lay awake one 
night thinking about the pains we've had with XSLTing RDF. It should be 
possible to create a HTML-near templating language. And RDFa is 
HTML-near, here we go: "RDFa Templates":

http://www.kjetil.kjernsmo.net/software/rat/

Basically, the idea is to use the RDF graph encoded in section of an 
RDFa document in the SPARQL WHERE clause. Additionally, I wanted to do 
this with minimal changes to parsers so that XML, RDF and RDFa tools 
could be used pretty much as they are. If any extension would be added, 
it should use the concepts we allready have. 

The idea I came up with was the name this section so that it would 
become a named graph. Thus, when the document is parsed, I could have a 
hash that would have the graph name URI as they key and the 
corresponding RDF graph as the value. 

So, my next thought was then "since the graph is now detached from the 
document it was in, how do I identify where it came from?" My answer 
was to use xml:id to name the graph, thus, the full graph name would be 
the URI of the document with the content of the xml:id attribute as a 
fragment identifier. 

Then, the template builder would just need to get the fragment 
identifier from the graph name, then $dom->getElementById($fragment)
and I would have all I need. 

Toby has several good arguments why xml:id might not be such a good 
idea, importantly its use in SVG, but I also feel that there should be 
an attribute that one can rely on. I saw that this was Michael's first 
reaction to Toby's draft too, so I'll address that in that thread. 

My main use case right now is this: Get as easy access to the XML that 
surrounds the graph as possible, and that seems to be by using 
$dom->getElementByID. However, I understand that one can define an 
attribute to be an ID in a schema, so we could in principle define our 
own for this purpose.

Cheers,

Kjetil
-- 
Kjetil Kjernsmo
Programmer / Astrophysicist / Ski-orienteer / Orienteer / Mountaineer
kjetil@kjernsmo.net
Homepage: http://www.kjetil.kjernsmo.net/     OpenPGP KeyID: 6A6A0BBC

Received on Sunday, 1 February 2009 11:06:44 UTC