On 10/27/07, Sidney <[EMAIL PROTECTED]> wrote:
> Is it possible to add a mechanism for custom "graph resolving"?

That's a pretty good idea.  The closest thing for that (currently) is
rdflib.sparql.Algebra.LoadGraph(datasetURI,datasetBaseURI,graph)

This is used by the SPARQL evaluation engine to resolve dataset
expressions.  Unfortunately, this part of the specification triggers
normative dependencies on URI formatting, resolution, etc.. (for which
vanilla Python 2.4+ does a poor job).  So, the current LoadGraph
attempts to use a more compliant URI resolution library (Ft.Lib.Uri)
if it is available.

So, theoretically, you should be able to:

.. stuff ..
from rdflib.sparql import Algebra
Algebra.LoadGraph = yourFunc
graph.query('..sparql query...',...)

In order to have your own LoadGraph method do the dataset resolution,
it would simply need to populate the given graph with the triples
serialized by the representation that corresponds with the given URI.

> An abstract class would be something as followed:
>
> class GraphResolver:
>
>   def resolve(self, uri):
>      # return graph given by param uri
>
> So, whenever the SPARQL processor needs to resolve a graph, it calls the
> client's graph resolver to return the desired graph.

So, the main difference here would be that a (new?) graph is returned
by the resolver instead of populating a given graph.

-- Chimezie
_______________________________________________
Dev mailing list
Dev@rdflib.net
http://rdflib.net/mailman/listinfo/dev

Reply via email to