I guess you could use addGraph to intercept and alter (or substitute) the 
graph, but that seems like a real distortion of the semantics. Seems like the 
AFS-Dev material is more to the point here. Andy, what do you think it would 
take to get that stuff to Jena master? Do you think it is ready for that? I 
would be happy to refactor TIM to use it instead of the stuff it currently uses 
in o.a.j.sparql.core.mem.

---
A. Soroka
The University of Virginia Library

> On Mar 15, 2016, at 7:39 AM, Dick Murray <dandh...@gmail.com> wrote:
> 
> Eureka moment! It returns a new Graph of a certain type. Whereas I need the
> graph node to determine where the underlying data is.
> 
> Cheers Dick.
> 
> On 15 March 2016 at 11:28, Andy Seaborne <a...@apache.org> wrote:
> 
>> On 15/03/16 10:30, Dick Murray wrote:
>> 
>>> Sorry, supportsTransactionAbort() in AFS-Dev
>>> <https://github.com/afs/AFS-Dev>/src
>>> <https://github.com/afs/AFS-Dev/tree/master/src>/main
>>> <https://github.com/afs/AFS-Dev/tree/master/src/main>/java
>>> <https://github.com/afs/AFS-Dev/tree/master/src/main/java>/projects
>>> <https://github.com/afs/AFS-Dev/tree/master/src/main/java/projects>/dsg2
>>> <https://github.com/afs/AFS-Dev/tree/master/src/main/java/projects/dsg2>/
>>> *DatasetGraphStorage.java*
>>> 
>> 
>> *Experimental code.*
>> 
>> 
>> 
>> supportsTransactionAbort is in the DatasetGraph interface in Jena.
>> 
>> 
>> DatasetGraphStorage is using TransactionalLock.createMRSW
>> 
>> As mentioned, it needs cooperation from the underlying thing to be able to
>> do aborts and MRSW does not provide that (it's external locking).
>> 
>> DatasetGraphStorage doesn't presume that the storage unit is transactional.
>> 
>> After these discussions I've decided to create a DatasetGraphOnDemand which
>>> extends DatasetGraphMap and uses Union graphs.
>>> 
>>> However in DatasetGraphMap shouldn't getGraphCreate() be
>>> getGraphCreate(Node graphNode) as otherwise it doesn't know what to
>>> create?
>>> 
>> 
>> It creates a graph - addGraph(graphNode, g) is managing the naming. Grapsh
>> don't know the name used (in other places one graph can have many names).
>> 
>> DatasetGraphMap is for a collection of independent graphs to be turned
>> into a dataset.
>> 
>>        Andy
>> 
>> 
>>>     @Override
>>>     public Graph getGraph(Node graphNode)
>>>     {
>>>         Graph g = graphs.get(graphNode) ;
>>>         if ( g == null )
>>>         {
>>>             g = getGraphCreate() ;
>>>             if ( g != null )
>>>                 addGraph(graphNode, g) ;
>>>         }
>>>         return g ;
>>>     }
>>> 
>>>     /** Called from getGraph when a nonexistent graph is asked for.
>>>      * Return null for "nothing created as a graph"
>>>      */
>>>     protected Graph getGraphCreate() { return null ; }
>>> 
>>> Dick.
>>> 
>>> 
>> 

Reply via email to