Package org.topbraid.shacl.arq.functions
Class SHACLSPARQLARQFunction
java.lang.Object
org.topbraid.shacl.arq.SHACLARQFunction
org.topbraid.shacl.arq.functions.SHACLSPARQLARQFunction
- All Implemented Interfaces:
org.apache.jena.sparql.function.Function,org.apache.jena.sparql.function.FunctionFactory,DeclarativeFunctionFactory,OptionalArgsFunction
An ARQ function that is based on a sh:SPARQLFunction.
There are two ways of declaring such functions:
- as sh:Function (similar to SPIN functions)
- from constraint components that point at sh:SPARQLAskValidators
This class has two constructors for those two cases.
- Author:
- Holger Knublauch
-
Field Summary
Fields inherited from class org.topbraid.shacl.arq.SHACLARQFunction
paramNames -
Constructor Summary
ConstructorsConstructorDescriptionSHACLSPARQLARQFunction(SHConstraintComponent component, org.apache.jena.rdf.model.Resource askValidator) Constructs a new SHACLSPARQLARQFunction based on a given sh:ConstraintComponent and a given validator (which must be a value of sh:nodeValidator, sh:propertyValidator etc.SHACLSPARQLARQFunction(SHSPARQLFunction shaclFunction) Constructs a new SHACLSPARQLARQFunction based on a given sh:Function. -
Method Summary
Modifier and TypeMethodDescriptionvoidbuild(String uri, org.apache.jena.sparql.expr.ExprList args, org.apache.jena.sparql.util.Context context) org.apache.jena.sparql.function.Functionorg.apache.jena.sparql.expr.NodeValueexecuteBody(org.apache.jena.query.Dataset dataset, org.apache.jena.rdf.model.Model defaultModel, org.apache.jena.query.QuerySolution bindings) org.apache.jena.query.QueryGets the Jena Query object for execution.protected StringMethods inherited from class org.topbraid.shacl.arq.SHACLARQFunction
addParameters, exec, getParamNames, getSHACLFunction, isOptionalArg
-
Constructor Details
-
SHACLSPARQLARQFunction
public SHACLSPARQLARQFunction(SHConstraintComponent component, org.apache.jena.rdf.model.Resource askValidator) Constructs a new SHACLSPARQLARQFunction based on a given sh:ConstraintComponent and a given validator (which must be a value of sh:nodeValidator, sh:propertyValidator etc.- Parameters:
component- the constraint component (defining the sh:parameters)askValidator- the sh:SPARQLAskValidator resource
-
SHACLSPARQLARQFunction
Constructs a new SHACLSPARQLARQFunction 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
-
build
public void build(String uri, org.apache.jena.sparql.expr.ExprList args, org.apache.jena.sparql.util.Context context) -
create
- Specified by:
createin interfaceorg.apache.jena.sparql.function.FunctionFactory- Overrides:
createin classSHACLARQFunction
-
executeBody
public org.apache.jena.sparql.expr.NodeValue executeBody(org.apache.jena.query.Dataset dataset, org.apache.jena.rdf.model.Model defaultModel, org.apache.jena.query.QuerySolution bindings) - Specified by:
executeBodyin classSHACLARQFunction
-
getBodyQuery
public org.apache.jena.query.Query getBodyQuery()Gets the Jena Query object for execution.- Returns:
- the Jena Query
-
getQueryString
- Specified by:
getQueryStringin classSHACLARQFunction
-