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 Details

    • 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-function
      declaration - 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-function
      argVarNames - the names of the parameters
      resultVarNames - the names of the result variables
  • Method Details

    • getAPIStatus

      public org.apache.jena.graph.Node getAPIStatus()
      Description copied from interface: MultiFunction
      Gets the API status.
      Specified by:
      getAPIStatus in interface MultiFunction
      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: MultiFunction
      Gets human-readable documentation for the MultiFunction, e.g. for code generation.
      Specified by:
      getDescription in interface MultiFunction
      Returns:
      the description or null
    • getParameters

      public List<MultiFunctionParameter> getParameters()
      Description copied from interface: MultiFunction
      Gets metadata about the declared parameters (based on sh:parameter).
      Specified by:
      getParameters in interface MultiFunction
      Returns:
      the parameters
    • getResultVars

      public List<MultiFunctionParameter> getResultVars()
      Description copied from interface: MultiFunction
      Gets metadata about the variables that will be produced for each solution (based on dash:resultVariable).
      Specified by:
      getResultVars in interface MultiFunction
      Returns:
      the result variables
    • getURI

      public String getURI()
      Description copied from interface: MultiFunction
      Gets the URI of this MultiFunction, which can also be used for the SPARQL property function.
      Specified by:
      getURI in interface MultiFunction
      Returns:
      the URI string
    • initFrom

      public void initFrom(org.apache.jena.rdf.model.Resource declaration)