named graphs in HTML

On Wed, 2012-05-09 at 16:00 +0200, Ivan Herman wrote:
> On May 9, 2012, at 15:35 , Sandro Hawke wrote:
> 
> > Following the general outcry against the term "layers", and Guus'
> > endorsement of "spaces", I've renamed it for now.  So the ED is now
> > here:
> > 
> >        http://dvcs.w3.org/hg/rdf/raw-file/default/rdf-spaces/index.html#
> > 
> > It's not yet clear to me what to discuss, on this topic, if we get there
> > in today's agenda.   One thing does seem a little pressing, because it
> > relates to Turtle:
> > 
> > I think it would be great if one could use Turtle in HTML as a dataset
> > language not just a graph language.   The easy way to do this would be
> > to say *if* there's an "id" attribute on any of the script elements
> > containing turtle, the triples parsed from that element go into a named
> > graph and the rest goes into the default graph (along with any RDFa and
> > microdata).  
> 
> Hm. First of all, note that RDFa and microdata-in-RDF is completely silent on the Turtle-in-HTML. These two structures do not share anything up until now (eg, a prefix definition in RDFa on the <html> element has no bearing on the turtle prefixes within a <script> element). Working out the details on how these two approaches meet may not be that simple. It may be worth doing, but it would require more than just this. (And I am not sure it is something we should do in this WG).
> 
> Also: In the RDFa group we had some bad experience reusing existing HTML attributes. The @id attribute may be used on the <script> element for very different purposes by the author (e.g., to manipulate it from a Javascript) and this would lead to unexpected side-effect in the Turtle file. We should keep away from that. Ideally, there would be a different attribute (@graph) for what you want to use the @id for, but then this WG will have to negotiate with the HTML5 WG to accept another attribute. Not necessarily easy.
> 
> I am not sure where the Turtle vs. TriG discussion will go, ie, whether these two will end up having two different media types. If so, then I think the script element can simply signal that as part of its type, and then let a TriG syntax work within the <script>.

Option 1:

At http://example.com/doc1 we say: 

        <html>
        ...
        <script type="text/trig">
        @prefix eg: <http://example.com/ns>.
        <#section> { eg:a eg:b eg:c }
        </script>
        ...
        </html>
        
Option 2:


At http://example.com/doc1 we say: 
        
        <html>
        ...
        <script type="text/turtle" id="section">
        @prefix eg: <http://example.com/ns>.
        eg:a eg:b eg:c.
        </script>
        ...
        </html>

Okay, yeah, I see your point.   Mechanically, option 1 is okay, and
procedurally, it's much simpler.

My preference for option 2 comes from my sense of Web Architecture, that
id attributes simply continue the URL after the hash.   The URL foo#bar,
if "foo" is an HTML document", is the *name* of the section of "foo"
with the id "bar".   But whatever.  This wouldn't be the first time
people chose expediency of architectural purity.

     -- Sandro


> Ivan
> 
> 
> > 
> > It would also be nice to have a way to say one wants the triples to
> > *also* go into the default graph -- so if what you're doing is graph
> > annotation you don't have to repeat all the triples in the annotated
> > graph.  Maybe class="included" or something; I'm not sure how the
> > namespaces of HTML classes works these days.
> > 
> > I know this touches on something Steve said yesterday about getting
> > quads when you're expecting triples; I'll reply to that separately.
> > 
> >     -- Sandro
> > 
> > 
> > 
> > 
> > 
> > 
> 
> 
> ----
> Ivan Herman, W3C Semantic Web Activity Lead
> Home: http://www.w3.org/People/Ivan/
> mobile: +31-641044153
> FOAF: http://www.ivan-herman.net/foaf.rdf
> 
> 
> 
> 
> 
> 

Received on Wednesday, 9 May 2012 14:34:59 UTC