[redland-dev] Re: contexts

Dave Beckett dave.beckett at bristol.ac.uk
Thu Feb 13 14:34:01 GMT 2003


>>>Danny Ayers said:
> Hi Dave,
> 
> Looking good!
> 
> When you have a spare minute(!), I for one would appreciate some expansion
> on your description of contexts - ...

I've been trying for a simple summary; I'll try again.

Redland with contexts (index-contexts='yes' option to store) enabled
allows you to add the following to a graph (redland model):

  [Triple, Context Node]

Now any time you do any query of the graph, you can get back the
result and the Context Node.  You can also list all the triples with
a given Context Node, and remove all such triples from the Graph.
A Context Node is just a regular redland Node.


So some possible uses that I've thought of

Merging graphs.

  Give each separate graph a different context node
  and add them to the model like this:
    [Triple from G1, Context Node 1]
    [Triple from G1, Context Node 1]
       ...
    [Triple from G2, Context Node 2]
    [Triple from G2, Context Node 2]
       ...

 Then in queries, you can find overlaps.  You can also de-merge
 perfectly (and very efficiently)

  
Provenance

  Give each triple or set of triples you care about a different
  context node (it could for example be the URI of where you got it,
  but that might conflat location and identity).  You can then add
  extra triples to the graph that describe the provenance like:

    <Context Node> <whereIgotIt> <something>
    <Context Node> <whenIgotIt>      <...>
    <Context Node> <digitalSignature> <...>
         ...

  Then when you get back a triple you can navigate to the context
  node and query, add triples.


" how it relates to the M&T" ?

Don't know what you mean.  This redland contexts idea is outside the
RDF abstract syntax/model theory.

> .. and perhaps how
> the same functionality might be added to other APIs (Jena ;-) etc.

Some of this might already be in the relational stores of Jena
etc. but not exposed.  I expect Jena2 might have something to help
with that.  Jena always tied statements & nodes to a particular
model, which isn't what Redland does. 

The abstraction in Redland
that does the tieing is the query, represented by the Stream and
Iterator classes for triples and nodes respectively.


> (btw, I just got a new machine onto which I've put Debian, so am hoping to
> have a proper play with Redland in the near future - I just couldn't face it
> in this Windows environment, despite Cygwin)

Sometime I'll fight the debian packaging but RPMs are so much easier.

Dave



More information about the redland-dev mailing list