W3C home > Mailing lists > Public > public-rdf-wg@w3.org > September 2012

Re: Scope of blank node labels in TriG/N-Quads

From: Andy Seaborne <andy.seaborne@epimorphics.com>
Date: Wed, 05 Sep 2012 22:26:54 +0100
Message-ID: <5047C39E.602@epimorphics.com>
To: public-rdf-wg@w3.org


On 05/09/12 18:36, Richard Cyganiak wrote:
> Second, separation of inference [1]. This doesn't require sharing of
> blank nodes in surface syntaxes, but only*within*  a store, so it's
> not relevant here.

If you can set the store up with shared bNodes, it's visible outside 
with existing standards.

SPARQL 1.0 XML Results can already expose this information to the web.

Graph 1:

_:a rdf:type :C1

and is C1 is subclass of C2:

Graph 2:

_:a rdf:type :C1 .
_:a rdf:type :C2 .

then

SELECT ?g ?s ?c { GRAPH ?g { ?s rdf:type ?c} }'

==>

<?xml version="1.0"?>
<sparql xmlns="http://www.w3.org/2005/sparql-results#">
   <head>
     <variable name="s"/>
     <variable name="c"/>
   </head>
   <results>
     <result>
       <binding name="g"><uri>http://example/g2</uri></binding>
       <binding name="s"><bnode>b0</bnode></binding>
       <binding name="c"><uri>http://example/C2</uri></binding>
     </result>
     <result>
       <binding name="g"><uri>http://example/g2</uri></binding>
       <binding name="s"><bnode>b0</bnode></binding>
       <binding name="c"><uri>http://example/C1</uri></binding>
     </result>
     <result>
       <binding name="g"><uri>http://example/g1</uri></binding>
       <binding name="s"><bnode>b0</bnode></binding>
       <binding name="c"><uri>http://example/C1</uri></binding>
     </result>
   </results>
</sparql>

or in JSON (a NOTE from DAWG):

{
   "head": {
     "vars": [ "g" , "s" , "c" ]
   } ,
   "results": {
     "bindings": [
       {
         "g": { "type": "uri" , "value": "http://example/g2" } ,
         "s": { "type": "bnode" , "value": "b0" } ,
         "c": { "type": "uri" , "value": "http://example/C2" }
       } ,
       {
         "g": { "type": "uri" , "value": "http://example/g2" } ,
         "s": { "type": "bnode" , "value": "b0" } ,
         "c": { "type": "uri" , "value": "http://example/C1" }
       } ,
       {
         "g": { "type": "uri" , "value": "http://example/g1" } ,
         "s": { "type": "bnode" , "value": "b0" } ,
         "c": { "type": "uri" , "value": "http://example/C1" }
       }
     ]
   }
}

	Andy
Received on Wednesday, 5 September 2012 21:27:24 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:25:51 GMT