public class SPINModuleRegistry extends Object
| Constructor and Description |
|---|
SPINModuleRegistry() |
| Modifier and Type | Method and Description |
|---|---|
static SPINModuleRegistry |
get()
Gets the singleton instance of this class.
|
Function |
getFunction(String uri,
org.apache.jena.rdf.model.Model model)
Gets a registered Function with a given URI.
|
Collection<Function> |
getFunctions()
Gets a Collection of all registered Functions.
|
Set<org.apache.jena.rdf.model.Model> |
getModels()
Gets all Models that are associated to registered functions and templates.
|
Object |
getSource(Function function) |
Template |
getTemplate(String uri,
org.apache.jena.rdf.model.Model model)
Gets a Template with a given URI in its defining Model.
|
Collection<Template> |
getTemplates()
Gets a Collection of all registered Templates.
|
void |
init()
Initializes this registry with all system functions and templates
from the SPL namespace.
|
void |
register(Function function,
Object source,
boolean addARQFunction)
Registers a Function with its URI to this registry.
|
void |
register(Template template)
Registers a Template with its URI.
|
void |
registerAll(org.apache.jena.rdf.model.Model model,
Object source)
Registers all functions and templates from a given Model.
|
protected void |
registerARQFunction(Function spinFunction)
If the provided Function has an executable body (spin:body), then
register an ARQ function for it with the current FunctionRegistry.
|
void |
registerARQPFunction(Function function)
If the provided Function has an executable body (spin:body), then
register an ARQ function for it with the current FunctionRegistry.
|
void |
registerFunctions(org.apache.jena.rdf.model.Model model,
Object source)
Registers all functions defined in a given Model.
|
void |
registerTemplates(org.apache.jena.rdf.model.Model model)
Registers all templates defined in a given Model.
|
void |
reset()
Resets this registry, supporting things like server restarts.
|
static void |
set(SPINModuleRegistry value)
Sets the SPINModuleRegistry to another value.
|
public static SPINModuleRegistry get()
public static void set(SPINModuleRegistry value)
value - the new value (not null)public Function getFunction(String uri, org.apache.jena.rdf.model.Model model)
uri - the URI of the Function to getmodel - an (optional) Model that should also be used to look up
locally defined functions (currently not used)public Collection<Function> getFunctions()
public Set<org.apache.jena.rdf.model.Model> getModels()
public Template getTemplate(String uri, org.apache.jena.rdf.model.Model model)
uri - the URI of the Template to look upmodel - an (optional) Model that should also be used for look uppublic Collection<Template> getTemplates()
public void init()
public void register(Function function, Object source, boolean addARQFunction)
registerARQFunction().
Note that the Model attached to the function should be an OntModel
that also imports the system namespaces spin.owl and sp.owl - otherwise
the system may not be able to transform the SPIN RDF into the correct
SPARQL string.function - the Function (must be a URI resource)source - an optional source for the function (e.g. a File)addARQFunction - true to also add an entry to the ARQ function registrypublic void register(Template template)
template - the Template (must be a URI resource)public void registerAll(org.apache.jena.rdf.model.Model model,
Object source)
model - the Model to iterate overprotected void registerARQFunction(Function spinFunction)
spinFunction - the function to registerpublic void registerARQPFunction(Function function)
function - the function to registerpublic void registerFunctions(org.apache.jena.rdf.model.Model model,
Object source)
register(function) for each of them.model - the Model to add the functions ofsource - an optional source of the Modelpublic void registerTemplates(org.apache.jena.rdf.model.Model model)
register(template) for each of them.model - the Model to add the templates ofpublic void reset()
Copyright © 2017 TopQuadrant, Inc.. All rights reserved.