org.aksw.commons.graph
Class GraphBackedResourceCache

java.lang.Object
  extended by org.aksw.commons.graph.GraphBackedResourceCache

public class GraphBackedResourceCache
extends Object

This class is not finished yet.

Some thoughts: It would be cool to have a "construct cache:"

E.g. Construct { ?p :hasName ?name . ?p :hasAddress ?a . } The graph pattern can be decomposed into clauses: (And(.)

Our cache function is vars(Query) -> Model (e.g. (?p ?a) -> Model) (Hm actually it doesn't matter whether its a model or not)

Whenever a triple is inserted, that satisfied one of the clauses, we need to invalidate a corresponding cache entry.

Author:
raven

Constructor Summary
GraphBackedResourceCache(org.aksw.commons.graph.SparqlEndpoint graphDAO)
           
 
Method Summary
 void applyChanges()
           
 void insert(com.hp.hpl.jena.rdf.model.Model model)
           
 com.hp.hpl.jena.rdf.model.Model lookup(Collection<com.hp.hpl.jena.rdf.model.Resource> resources)
           
static String myToString(Collection<?> collection)
           
 void remove(com.hp.hpl.jena.rdf.model.Model model)
           
static Set<List<Object>> toKeys(Collection<com.hp.hpl.jena.rdf.model.Resource> resources)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphBackedResourceCache

public GraphBackedResourceCache(org.aksw.commons.graph.SparqlEndpoint graphDAO)
Method Detail

lookup

public com.hp.hpl.jena.rdf.model.Model lookup(Collection<com.hp.hpl.jena.rdf.model.Resource> resources)
                                       throws Exception
Throws:
Exception

insert

public void insert(com.hp.hpl.jena.rdf.model.Model model)
            throws Exception
Throws:
Exception

remove

public void remove(com.hp.hpl.jena.rdf.model.Model model)
            throws Exception
Throws:
Exception

applyChanges

public void applyChanges()
                  throws Exception
Throws:
Exception

myToString

public static String myToString(Collection<?> collection)

toKeys

public static Set<List<Object>> toKeys(Collection<com.hp.hpl.jena.rdf.model.Resource> resources)


Copyright © 2012. All Rights Reserved.