eu.larkc.jactr.modules.declarative.rdf
Class DefaultDeclarativeModuleRdf

java.lang.Object
  extended by org.jactr.core.utils.DefaultAdaptable
      extended by org.jactr.core.module.AbstractModule
          extended by org.jactr.core.module.declarative.basic.AbstractDeclarativeModule
              extended by org.jactr.core.module.declarative.basic.DefaultDeclarativeModule
                  extended by org.jactr.core.module.declarative.six.DefaultDeclarativeModule6
                      extended by eu.larkc.jactr.modules.declarative.rdf.DefaultDeclarativeModuleRdf
All Implemented Interfaces:
IDeclarativeModuleRdf, IDeclarativeModule5, IDeclarativeModule4, IDeclarativeModule, IModule, IAdaptable, IInitializable, IInstallable, IParameterized

public class DefaultDeclarativeModuleRdf
extends DefaultDeclarativeModule6
implements IDeclarativeModuleRdf

Default Declarative Module using an OpenRDF Sesame Repository.

Author:
Martijn Brakenhoff

Field Summary
 
Fields inherited from interface eu.larkc.jactr.modules.declarative.rdf.IDeclarativeModuleRdf
BASE_URI, RDF_FORMAT, RDF_SOURCE, RDF_SOURCE_FILE, RDF_SOURCE_URL
 
Fields inherited from interface org.jactr.core.module.declarative.four.IDeclarativeModule4
ACTIVATION_NOISE, BASE_LEVEL_CONSTANT, PARTIAL_MATCHING, PERMANENT_ACTIVATION_NOISE
 
Fields inherited from interface org.jactr.core.module.declarative.five.IDeclarativeModule5
MAXIMUM_DIFFERENCE, MAXIMUM_SIMILARITY, MISMATCH_PENALTY
 
Constructor Summary
DefaultDeclarativeModuleRdf()
           
 
Method Summary
 String addPrefix(String resource)
          Returns the resource, but with the namespace replaced by the matching prefix.
 RdfStoreConnection createRdfStoreConnection()
          Returns the RdfStoreConnection to the internal repository.
 void dispose()
           
 Future<Collection<IChunk>> findSPARQLMatches(SPARQLQuery sparqlQuery)
          Returns (the promise of) a collection of all the chunks that match the given SPARQL Query.
 String getBaseURI()
          Returns the Base URI that was set for the knowledge base in the model.
 Map<String,String> getNamespaces()
          Returns the namespaces that are used in this module's knowledgebase.
 String getParameter(String key)
           
 String getRdfFormat()
          Returns the RDF format that was set in the model.
 String getRdfSourceURL()
          Returns the URL that was set as the Source of RDF in the model.
 Collection<String> getSetableParameters()
           
 String getSPARQLPrefixes()
          Returns the namespaces (see getNamespaces()), but formats them like the PREFIX part of a sparql query.
 void initialize()
           
 boolean isPartialMatchingEnabled()
           
 void setParameter(String key, String value)
           
 
Methods inherited from class org.jactr.core.module.declarative.six.DefaultDeclarativeModule6
getActivationNoise, getBaseLevelConstant, getMaximumDifference, getMaximumSimilarity, getMismatchPenalty, getPermanentActivationNoise, getSimilarity, setActivationNoise, setBaseLevelConstant, setMaximumDifference, setMaximumSimilarity, setMismatchPenalty, setPartialMatchingEnabled, setPermanentActivationNoise, setSimilarity
 
Methods inherited from class org.jactr.core.module.declarative.basic.DefaultDeclarativeModule
dispose, findExactMatches, findPartialMatches, getAssociativeLinkageSystem, getNumberOfChunks, getPossibleParameters, isDisposalSuspended, reset, setAssociativeLinkageSystem, setDisposalSuspended, willEncode
 
Methods inherited from class org.jactr.core.module.declarative.basic.AbstractDeclarativeModule
addChunk, addChunkType, addListener, copyChunk, createChunk, createChunkType, getBusyChunk, getChunk, getChunks, getChunkType, getChunkTypes, getEmptyChunk, getErrorChunk, getFreeChunk, getFullChunk, getNewChunk, getRequestedChunk, getUnrequestedChunk, removeListener
 
Methods inherited from class org.jactr.core.module.AbstractModule
delayedFuture, getExecutor, getModel, getName, immediateFuture, immediateReturn, install, uninstall
 
Methods inherited from class org.jactr.core.utils.DefaultAdaptable
getAdapter
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jactr.core.module.declarative.IDeclarativeModule
addChunk, addChunkType, addListener, copyChunk, createChunk, createChunkType, dispose, findExactMatches, findPartialMatches, getAssociativeLinkageSystem, getBusyChunk, getChunk, getChunks, getChunkType, getChunkTypes, getEmptyChunk, getErrorChunk, getFreeChunk, getFullChunk, getNewChunk, getNumberOfChunks, getRequestedChunk, getUnrequestedChunk, removeListener, setAssociativeLinkageSystem, willEncode
 
Methods inherited from interface org.jactr.core.module.IModule
getModel, getName, install, reset
 
Methods inherited from interface org.jactr.core.utils.IInstallable
uninstall
 
Methods inherited from interface org.jactr.core.utils.IAdaptable
getAdapter
 
Methods inherited from interface org.jactr.core.utils.parameter.IParameterized
getPossibleParameters
 

Constructor Detail

DefaultDeclarativeModuleRdf

public DefaultDeclarativeModuleRdf()
Method Detail

dispose

public void dispose()
Specified by:
dispose in interface IModule
Overrides:
dispose in class DefaultDeclarativeModule6

initialize

public void initialize()
Specified by:
initialize in interface IModule
Specified by:
initialize in interface IInitializable
Overrides:
initialize in class DefaultDeclarativeModule

getNamespaces

public Map<String,String> getNamespaces()
Description copied from interface: IDeclarativeModuleRdf
Returns the namespaces that are used in this module's knowledgebase.

Specified by:
getNamespaces in interface IDeclarativeModuleRdf
Returns:
the namespaces.

getSPARQLPrefixes

public String getSPARQLPrefixes()
Description copied from interface: IDeclarativeModuleRdf
Returns the namespaces (see getNamespaces()), but formats them like the PREFIX part of a sparql query.

Specified by:
getSPARQLPrefixes in interface IDeclarativeModuleRdf
Returns:
the prefix part of a sparql query.

addPrefix

public String addPrefix(String resource)
Description copied from interface: IDeclarativeModuleRdf
Returns the resource, but with the namespace replaced by the matching prefix.

Specified by:
addPrefix in interface IDeclarativeModuleRdf
Parameters:
resource - the rdf resource URI.
Returns:
if the namespace is known, the resource with a prefix, otherwise the given resource.

findSPARQLMatches

public Future<Collection<IChunk>> findSPARQLMatches(SPARQLQuery sparqlQuery)
Description copied from interface: IDeclarativeModuleRdf
Returns (the promise of) a collection of all the chunks that match the given SPARQL Query.

Specified by:
findSPARQLMatches in interface IDeclarativeModuleRdf
Parameters:
sparqlQuery - the SPARQL-Query object.
Returns:
all the chunks that match the given SPARQL Query.

createRdfStoreConnection

public RdfStoreConnection createRdfStoreConnection()
Description copied from interface: IDeclarativeModuleRdf
Returns the RdfStoreConnection to the internal repository.

Specified by:
createRdfStoreConnection in interface IDeclarativeModuleRdf
Returns:
the RdfStoreConnection

isPartialMatchingEnabled

public boolean isPartialMatchingEnabled()
Specified by:
isPartialMatchingEnabled in interface IDeclarativeModule4
Overrides:
isPartialMatchingEnabled in class DefaultDeclarativeModule6

getRdfSourceURL

public String getRdfSourceURL()
Description copied from interface: IDeclarativeModuleRdf
Returns the URL that was set as the Source of RDF in the model.

Specified by:
getRdfSourceURL in interface IDeclarativeModuleRdf
Returns:
the RDF source URL.

getRdfFormat

public String getRdfFormat()
Description copied from interface: IDeclarativeModuleRdf
Returns the RDF format that was set in the model. (Possible values: String equivalent of org.openrdf.rio.RDFFormat).

Specified by:
getRdfFormat in interface IDeclarativeModuleRdf
Returns:
the RDF format.

getBaseURI

public String getBaseURI()
Description copied from interface: IDeclarativeModuleRdf
Returns the Base URI that was set for the knowledge base in the model.

Specified by:
getBaseURI in interface IDeclarativeModuleRdf
Returns:
the Base URI for the knowledge base

getParameter

public String getParameter(String key)
Specified by:
getParameter in interface IParameterized
Overrides:
getParameter in class DefaultDeclarativeModule6

getSetableParameters

public Collection<String> getSetableParameters()
Specified by:
getSetableParameters in interface IParameterized
Overrides:
getSetableParameters in class DefaultDeclarativeModule6

setParameter

public void setParameter(String key,
                         String value)
Specified by:
setParameter in interface IParameterized
Overrides:
setParameter in class DefaultDeclarativeModule6