at.newmedialab.ldpath.backend.linkeddata
Class AbstractLDBackend

java.lang.Object
  extended by at.newmedialab.ldpath.backend.sesame.AbstractSesameBackend
      extended by at.newmedialab.ldpath.backend.sesame.SesameRepositoryBackend
          extended by at.newmedialab.ldpath.backend.linkeddata.AbstractLDBackend
All Implemented Interfaces:
LDCacheProvider, at.newmedialab.ldpath.api.backend.RDFBackend<org.openrdf.model.Value>
Direct Known Subclasses:
LDMemoryBackend, LDPersistentBackend

public abstract class AbstractLDBackend
extends SesameRepositoryBackend
implements LDCacheProvider

Abstract superclass for Linked Data backends. Implements functionality common to all implementations.

Author: Sebastian Schaffert


Constructor Summary
protected AbstractLDBackend()
          Initialise a new sesame backend.
 
Method Summary
 org.openrdf.repository.Repository getTripleRepository()
          Return the sesame repository used for storing the triples that are retrieved from the Linked Data Cloud.
 Collection<Endpoint> listEndpoints()
          List all endpoints currently registered with the Linked Data cache provider.
 Collection<org.openrdf.model.Value> listObjects(org.openrdf.model.Value subject, org.openrdf.model.Value property)
          List the objects of triples in the triple store underlying this backend that have the subject and property given as argument.
 Collection<org.openrdf.model.Value> listSubjects(org.openrdf.model.Value property, org.openrdf.model.Value object)
          List the subjects of triples in the triple store underlying this backend that have the object and property given as argument.
 void registerEndpoint(Endpoint endpoint)
          Register a new Linked Data endpoint with this cache provider.
 void unregisterEndpoint(Endpoint endpoint)
          Unregister the Linked Data endpoint given as argument.
 
Methods inherited from class at.newmedialab.ldpath.backend.sesame.SesameRepositoryBackend
createLiteral, createLiteral, createURI, getRepository, setRepository
 
Methods inherited from class at.newmedialab.ldpath.backend.sesame.AbstractSesameBackend
booleanValue, createLiteralInternal, createLiteralInternal, createURIInternal, dateTimeValue, dateValue, debugType, decimalValue, doubleValue, floatValue, getLiteralLanguage, getLiteralType, getThreadPool, integerValue, intValue, isBlank, isLiteral, isURI, listObjectsInternal, listSubjectsInternal, longValue, stringValue, supportsThreading, timeValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface at.newmedialab.ldclient.api.LDCacheProvider
getMetadataRepository
 

Constructor Detail

AbstractLDBackend

protected AbstractLDBackend()
Initialise a new sesame backend. Repository needs to be set using setRepository.

Method Detail

getTripleRepository

public org.openrdf.repository.Repository getTripleRepository()
Return the sesame repository used for storing the triples that are retrieved from the Linked Data Cloud. Triples will always be added to the context http://www.newmedialab.at/ldclient/cache to be able to distinguish them from other triples.

Specified by:
getTripleRepository in interface LDCacheProvider
Returns:
an initialised Sesame repository that can be used for caching triples

listObjects

public Collection<org.openrdf.model.Value> listObjects(org.openrdf.model.Value subject,
                                                       org.openrdf.model.Value property)
List the objects of triples in the triple store underlying this backend that have the subject and property given as argument.

Specified by:
listObjects in interface at.newmedialab.ldpath.api.backend.RDFBackend<org.openrdf.model.Value>
Overrides:
listObjects in class SesameRepositoryBackend
Parameters:
subject - the subject of the triples to look for
property - the property of the triples to look for
Returns:
all objects of triples with matching subject and property

listSubjects

public Collection<org.openrdf.model.Value> listSubjects(org.openrdf.model.Value property,
                                                        org.openrdf.model.Value object)
List the subjects of triples in the triple store underlying this backend that have the object and property given as argument.

Specified by:
listSubjects in interface at.newmedialab.ldpath.api.backend.RDFBackend<org.openrdf.model.Value>
Overrides:
listSubjects in class SesameRepositoryBackend
Parameters:
object - the object of the triples to look for
property - the property of the triples to look for
Returns:
all dubjects of triples with matching object and property
Throws:
UnsupportedOperationException - in case reverse selection is not supported (e.g. when querying Linked Data)

registerEndpoint

public void registerEndpoint(Endpoint endpoint)
Register a new Linked Data endpoint with this cache provider.

Specified by:
registerEndpoint in interface LDCacheProvider
Parameters:
endpoint -

listEndpoints

public Collection<Endpoint> listEndpoints()
List all endpoints currently registered with the Linked Data cache provider.

Specified by:
listEndpoints in interface LDCacheProvider
Returns:
a collection of endpoints

unregisterEndpoint

public void unregisterEndpoint(Endpoint endpoint)
Unregister the Linked Data endpoint given as argument.

Specified by:
unregisterEndpoint in interface LDCacheProvider
Parameters:
endpoint - the endpoint to unregister


Copyright © 2012-2013 Salzburg Research. All Rights Reserved.