Class AbstractMultiFunction
- java.lang.Object
-
- org.topbraid.shacl.multifunctions.AbstractMultiFunction
-
- All Implemented Interfaces:
MultiFunction
- Direct Known Subclasses:
AbstractNativeMultiFunction,SPARQLMultiFunction
public abstract class AbstractMultiFunction extends Object implements MultiFunction
Abstract base class suitable for all MultiFunction implementations.- Author:
- Holger Knublauch
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractMultiFunction(String uri, List<String> argVarNames, List<String> resultVarNames)Use this constructor for natively implemented MultiFunctions.protectedAbstractMultiFunction(String uri, org.apache.jena.rdf.model.Resource declaration)Use this constructor for dynamically declared MultiFunctions from RDF graphs in the workspace.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.jena.graph.NodegetAPIStatus()Gets the API status.StringgetDescription()Gets human-readable documentation for the MultiFunction, e.g.List<MultiFunctionParameter>getParameters()Gets metadata about the declared parameters (based on sh:parameter).List<MultiFunctionParameter>getResultVars()Gets metadata about the variables that will be produced for each solution (based on dash:resultVariable).StringgetURI()Gets the URI of this MultiFunction, which can also be used for the SPARQL property function.voidinitFrom(org.apache.jena.rdf.model.Resource declaration)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.topbraid.shacl.multifunctions.MultiFunction
execute
-
-
-
-
Constructor Detail
-
AbstractMultiFunction
protected AbstractMultiFunction(String uri, org.apache.jena.rdf.model.Resource declaration)
Use this constructor for dynamically declared MultiFunctions from RDF graphs in the workspace.- Parameters:
uri- the URI of the multi-functiondeclaration- the RDF resource with the declaration
-
AbstractMultiFunction
protected AbstractMultiFunction(String uri, List<String> argVarNames, List<String> resultVarNames)
Use this constructor for natively implemented MultiFunctions. The main difference is that these are programmatically generated before the RDF declaration is processed. For (corner) cases in which a workspace is broken and those files are not found, we at least declare the variable names so that the function can still execute correctly.- Parameters:
uri- the URI of the multi-functionargVarNames- the names of the parametersresultVarNames- the names of the result variables
-
-
Method Detail
-
getAPIStatus
public org.apache.jena.graph.Node getAPIStatus()
Description copied from interface:MultiFunctionGets the API status.- Specified by:
getAPIStatusin interfaceMultiFunction- Returns:
- one of the instances of dash:APIStatus or null if this should not be used outside.
-
getDescription
public String getDescription()
Description copied from interface:MultiFunctionGets human-readable documentation for the MultiFunction, e.g. for code generation.- Specified by:
getDescriptionin interfaceMultiFunction- Returns:
- the description or null
-
getParameters
public List<MultiFunctionParameter> getParameters()
Description copied from interface:MultiFunctionGets metadata about the declared parameters (based on sh:parameter).- Specified by:
getParametersin interfaceMultiFunction- Returns:
- the parameters
-
getResultVars
public List<MultiFunctionParameter> getResultVars()
Description copied from interface:MultiFunctionGets metadata about the variables that will be produced for each solution (based on dash:resultVariable).- Specified by:
getResultVarsin interfaceMultiFunction- Returns:
- the result variables
-
getURI
public String getURI()
Description copied from interface:MultiFunctionGets the URI of this MultiFunction, which can also be used for the SPARQL property function.- Specified by:
getURIin interfaceMultiFunction- Returns:
- the URI string
-
initFrom
public void initFrom(org.apache.jena.rdf.model.Resource declaration)
-
-