Package org.topbraid.shacl.expr
Class AbstractNodeExpression
- java.lang.Object
-
- org.topbraid.shacl.expr.AbstractNodeExpression
-
- All Implemented Interfaces:
NodeExpression
- Direct Known Subclasses:
ComplexNodeExpression,ConstantTermExpression,FocusNodeExpression
public abstract class AbstractNodeExpression extends Object implements NodeExpression
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractNodeExpression(org.apache.jena.rdf.model.RDFNode expr)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.jena.util.iterator.ExtendedIterator<org.apache.jena.rdf.model.RDFNode>evalReverse(org.apache.jena.rdf.model.RDFNode valueNode, NodeExpressionContext context)Produces an iterator of focus nodes for a given value node.List<NodeExpression>getInputExpressions()org.apache.jena.rdf.model.ResourcegetOutputShape(org.apache.jena.rdf.model.Resource contextShape)Gets the shape of the output data (if known), based on a context shape.org.apache.jena.rdf.model.RDFNodegetRDFNode()Gets the RDF node that was used to construct the expression, in the SHACL node expressions syntax.booleanisReversible(NodeExpressionContext context)Checks if this expression could be evaluated in the reverse direction, with a value given and then finding all focus nodes.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.topbraid.shacl.expr.NodeExpression
eval, getFunctionalSyntax, getTypeId, visit
-
-
-
-
Method Detail
-
evalReverse
public org.apache.jena.util.iterator.ExtendedIterator<org.apache.jena.rdf.model.RDFNode> evalReverse(org.apache.jena.rdf.model.RDFNode valueNode, NodeExpressionContext context)Description copied from interface:NodeExpressionProduces an iterator of focus nodes for a given value node. This operation can only be called for node expressions where isReversible returns true and may throw an IllegalStateException otherwise.- Specified by:
evalReversein interfaceNodeExpression- Parameters:
valueNode- the value nodecontext- the context- Returns:
- an iterator (never null)
-
getInputExpressions
public List<NodeExpression> getInputExpressions()
- Specified by:
getInputExpressionsin interfaceNodeExpression
-
getOutputShape
public org.apache.jena.rdf.model.Resource getOutputShape(org.apache.jena.rdf.model.Resource contextShape)
Description copied from interface:NodeExpressionGets the shape of the output data (if known), based on a context shape. For example, for a path expression it would try to infer the output shape from the sh:class or sh:node of the property (path).- Specified by:
getOutputShapein interfaceNodeExpression- Parameters:
contextShape- the shape where the evaluation would start, e.g. the node shape of the sh:values statement- Returns:
- an output shape or null if unknown
-
getRDFNode
public org.apache.jena.rdf.model.RDFNode getRDFNode()
Description copied from interface:NodeExpressionGets the RDF node that was used to construct the expression, in the SHACL node expressions syntax.- Specified by:
getRDFNodein interfaceNodeExpression- Returns:
- the RDF node
-
isReversible
public boolean isReversible(NodeExpressionContext context)
Description copied from interface:NodeExpressionChecks if this expression could be evaluated in the reverse direction, with a value given and then finding all focus nodes. The function evalReverse can then be called. NOTE THAT THIS IS CURRENTLY BARELY IMPLEMENTED.- Specified by:
isReversiblein interfaceNodeExpression- Parameters:
context- the context- Returns:
- true if reversible
-
-