Class MultiFunctions
java.lang.Object
org.topbraid.shacl.multifunctions.MultiFunctions
A singleton managing the (known) MultiFunctions, for example to drive code generators.
Any MultiFunction that gets registered will also be installed as a SPARQL property function for Jena.
- Author:
- Holger Knublauch
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MultiFunctionGets a MultiFunction with a given URI.static MultiFunctiongetOrCreate(org.apache.jena.rdf.model.Resource multiFunction) static org.topbraid.shacl.multifunctions.MultiFunctionPropertyFunctionregister(MultiFunction multiFunction) Registers a MultiFunction and installs a corresponding Jena property function.static voidregisterAll(org.apache.jena.rdf.model.Model model) Registers all declarative MultiFunctions (instances of dash:MultiFunction) from a given Model.registerAllTemp(org.apache.jena.rdf.model.Model model) Temporarily registers any multi-function that is not registered yet, e.g.static voidunregister(String uri) Removes a MultiFunction and the corresponding property function.uris()Gets a stream of the known URIs, which can then be used by the get function.
-
Constructor Details
-
MultiFunctions
public MultiFunctions()
-
-
Method Details
-
get
Gets a MultiFunction with a given URI.- Parameters:
uri- the URI of the MultiFunction to get- Returns:
- the MultiFunction or null
-
getOrCreate
-
register
public static org.topbraid.shacl.multifunctions.MultiFunctionPropertyFunction register(MultiFunction multiFunction) Registers a MultiFunction and installs a corresponding Jena property function.- Parameters:
multiFunction- the MultiFunction
-
registerAll
public static void registerAll(org.apache.jena.rdf.model.Model model) Registers all declarative MultiFunctions (instances of dash:MultiFunction) from a given Model. This will overwrite any previously known functions and property functions with overlapping URIs.- Parameters:
model- the Model to look up the definitions
-
registerAllTemp
Temporarily registers any multi-function that is not registered yet, e.g. for the duration of a test case. Needs to be followed by unregister calls in a finally block.- Parameters:
model- the Model to add the MultiFunctions of- Returns:
- the actually added URIs, needed for the unregister call
-
unregister
Removes a MultiFunction and the corresponding property function.- Parameters:
uri- the URI of the multi-function to remove
-
uris
Gets a stream of the known URIs, which can then be used by the get function.- Returns:
- the URIs
-