|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.topbraid.spin.system.SPINModuleRegistry
public class SPINModuleRegistry
A singleton that keeps track of all registered SPIN functions and templates. For example, in TopBraid this is populated by walking all .spin. files in the Eclipse workspace. Other implementations may need to register their modules "manually".
Constructor Summary | |
---|---|
SPINModuleRegistry()
|
Method Summary | |
---|---|
static SPINModuleRegistry |
get()
Gets the singleton instance of this class. |
Function |
getFunction(java.lang.String uri,
Model model)
Gets a registered Function with a given URI. |
Template |
getTemplate(java.lang.String uri,
Model model)
Gets a Template with a given URI in its defining Model. |
java.util.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,
boolean addARQFunction)
Registers a Function with its URI to this registry. |
void |
register(Template template)
Registers a Template with its URI. |
void |
registerAll(Model model)
Registers all functions and templates from a given Model. |
protected void |
registerARQFunction(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(Model model)
Registers all functions defined in a given Model. |
void |
registerTemplates(Model model)
Registers all templates defined in a given Model. |
static void |
set(SPINModuleRegistry value)
Sets the SPINModuleRegistry to another value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SPINModuleRegistry()
Method Detail |
---|
public static SPINModuleRegistry get()
public static void set(SPINModuleRegistry value)
value
- the new value (not null)public Function getFunction(java.lang.String uri, 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 Template getTemplate(java.lang.String uri, Model model)
uri
- the URI of the Template to look upmodel
- an (optional) Model that should also be used for look up
public java.util.Collection<Template> getTemplates()
public void init()
public void register(Function function, 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)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(Model model)
model
- the Model to iterate overprotected void registerARQFunction(Function function)
function
- the function to registerpublic void registerFunctions(Model model)
register(function)
for each of them.
model
- the Model to add the functions ofpublic void registerTemplates(Model model)
register(template)
for each of them.
model
- the Model to add the templates of
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |