Difference between revisions of "TF-Graphs/RDF-Quadless-Proposal"

From RDF Working Group Wiki
Jump to: navigation, search
(Semantics)
m (Rationale and Syntax)
Line 13: Line 13:
 
     @prefix owl: <...> .
 
     @prefix owl: <...> .
 
     :pchampin owl:sameAs :patHayes .
 
     :pchampin owl:sameAs :patHayes .
   """ ]
+
   """ ].
  
 
== Semantics ==
 
== Semantics ==

Revision as of 17:23, 22 June 2011

This proposal is entitled "quadless", as it aims to talk about graphs in RDF even in standard (i.e. triple based) syntaxes (even RDF/XML). More generally, it tries to be minimally invasive to RDF semantics.


Rationale and Syntax

The idea is to represent graphs (g-snaps) as resources, and describe them with their serialization. What we need minimally is a property rdf:xml-serialization that would link a graph to its RDF/XML serialization. We could of course define, similarly rdf:turtle-serialization, rdf:ntriples-serialization...

A turtle example would then be

 @prefix : <http://example.org/> .
 :pchampin :states [ rdf:turtle-serialization """
   @prefix : <http://example.org/>
   @prefix owl: <...> .
   :pchampin owl:sameAs :patHayes .
 """ ].

Semantics

The RDF semantics document would need the following additions:

  • every interpretation contains a mapping IG from IR to the set G of all RDF graphs
  • every interpretation is constrained in such a way that
    • if (I(E),I(F)) ∈ IP(rdf:xml-serialization),
    • then IG(I(E)) is the graph that one gets from parsing I(F)
    • (to be specified: ensure that blank nodes in that graph are not shared with any other graph, what if F is not valid RDF/XML...)

Link with other syntaxes

It is fairly easy to map syntaxes that allow graph literals into that proposal. For example, curly brackets in N3 could be understood as a shortcut for '[ rdf:n3-serialization """' and '""" ]' respectively.

For Trig or NQuad, we do not have to commit to a very strong semantics for the link between the "graph URI" and the graph itself. We can for example specify that the following Trig

 @prefix : <http://example.org> .
 :G1 { :a :b :c }

actually means

 @prefix : <http://example.org> .
 [ rdf:turtle-serialization """
   @prefix : <http://example.org> .
   :a :b :c .
   """ ;
   trig:label :G1
 ]

Link with named graphs and datasets

Named graphs (as defined in Carroll et al 1995) or SPARQL Datasets can easily be represented withing this framework.

If I understand named graphs correctly, the URIs paired with the graph are the actual names of those graphs, so it amounts to using URIs instead of blank nodes to represent the graphs:

 :G1 rdf:xml-serialization "..." .
 :G2 rdf:xml-serialization "..." .

In SPARQL Datasets, the relation is looser, but nothing can't be solved with a level of indirection.

 :my-dataset :has-default-graph [ rdf:xml-serialization "..." ] ;
   :has-named-graph [
     :name :G1 ;
     :graph [ rdf:xml-serialization "..." ]
   ],[
     :name :G2 ;
     :graph [ rdf:xml-serialization "..." ]
   ].