Class SHACLARQFunction

java.lang.Object
org.topbraid.shacl.arq.SHACLARQFunction
All Implemented Interfaces:
org.apache.jena.sparql.function.Function, org.apache.jena.sparql.function.FunctionFactory, DeclarativeFunctionFactory, OptionalArgsFunction
Direct Known Subclasses:
SHACLSPARQLARQFunction

public abstract class SHACLARQFunction extends Object implements org.apache.jena.sparql.function.Function, OptionalArgsFunction, DeclarativeFunctionFactory
An ARQ function that is based on a SHACL function definition.
Author:
Holger Knublauch
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected List<String>
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Constructs a new SHACLARQFunction based on a given sh:Function.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
     
    void
    build(String uri, org.apache.jena.sparql.expr.ExprList args)
     
    org.apache.jena.sparql.function.Function
     
    org.apache.jena.sparql.expr.NodeValue
    exec(org.apache.jena.sparql.engine.binding.Binding binding, org.apache.jena.sparql.expr.ExprList args, String uri, org.apache.jena.sparql.function.FunctionEnv env)
     
    abstract org.apache.jena.sparql.expr.NodeValue
    executeBody(org.apache.jena.query.Dataset dataset, org.apache.jena.rdf.model.Model model, org.apache.jena.query.QuerySolution bindings)
     
    Gets the names of the declared parameters, in order from left to right.
    protected abstract String
     
    Gets the underlying sh:Function Model object for this ARQ function.
    boolean
    isOptionalArg(int index)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.apache.jena.sparql.function.Function

    build
  • Field Details

  • Constructor Details

    • SHACLARQFunction

      protected SHACLARQFunction(SHFunction shaclFunction)
      Constructs a new SHACLARQFunction based on a given sh:Function. The shaclFunction must be associated with the Model containing the triples of its definition.
      Parameters:
      shaclFunction - the SHACL function
  • Method Details

    • addParameters

      protected void addParameters(SHParameterizable parameterizable)
    • build

      public void build(String uri, org.apache.jena.sparql.expr.ExprList args)
      Specified by:
      build in interface org.apache.jena.sparql.function.Function
    • create

      public org.apache.jena.sparql.function.Function create(String uri)
      Specified by:
      create in interface org.apache.jena.sparql.function.FunctionFactory
    • exec

      public org.apache.jena.sparql.expr.NodeValue exec(org.apache.jena.sparql.engine.binding.Binding binding, org.apache.jena.sparql.expr.ExprList args, String uri, org.apache.jena.sparql.function.FunctionEnv env)
      Specified by:
      exec in interface org.apache.jena.sparql.function.Function
    • executeBody

      public abstract org.apache.jena.sparql.expr.NodeValue executeBody(org.apache.jena.query.Dataset dataset, org.apache.jena.rdf.model.Model model, org.apache.jena.query.QuerySolution bindings)
    • getQueryString

      protected abstract String getQueryString()
    • getSHACLFunction

      public SHFunction getSHACLFunction()
      Gets the underlying sh:Function Model object for this ARQ function.
      Returns:
      the sh:Function (may be null)
    • getParamNames

      public String[] getParamNames()
      Gets the names of the declared parameters, in order from left to right.
      Returns:
      the parameter names
    • isOptionalArg

      public boolean isOptionalArg(int index)
      Specified by:
      isOptionalArg in interface OptionalArgsFunction