Package org.topbraid.shacl.expr.lib
Class DistinctExpression
- java.lang.Object
-
- org.topbraid.shacl.expr.AbstractNodeExpression
-
- org.topbraid.shacl.expr.ComplexNodeExpression
-
- org.topbraid.shacl.expr.AbstractInputExpression
-
- org.topbraid.shacl.expr.lib.DistinctExpression
-
- All Implemented Interfaces:
NodeExpression
public class DistinctExpression extends AbstractInputExpression
Implements support for sh:distinct. This node expression type is not part of the SHACL-AF 1.0 document, but a candidate for 1.1.- Author:
- Holger Knublauch
-
-
Constructor Summary
Constructors Constructor Description DistinctExpression(org.apache.jena.rdf.model.RDFNode expr, NodeExpression input)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static org.apache.jena.util.iterator.ExtendedIterator<org.apache.jena.rdf.model.RDFNode>distinct(org.apache.jena.util.iterator.ExtendedIterator<org.apache.jena.rdf.model.RDFNode> base)Produces an RDFNode iterator that drops duplicate values, based on a Set.org.apache.jena.util.iterator.ExtendedIterator<org.apache.jena.rdf.model.RDFNode>eval(org.apache.jena.rdf.model.RDFNode focusNode, NodeExpressionContext context)Produces an iterator of value nodes for a given focus node.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.StringgetTypeId()voidvisit(NodeExpressionVisitor visitor)-
Methods inherited from class org.topbraid.shacl.expr.AbstractInputExpression
evalInput, getFunctionalSyntaxArguments, getInput, getInputExpressions
-
Methods inherited from class org.topbraid.shacl.expr.ComplexNodeExpression
getFunctionalSyntax, getFunctionalSyntaxName
-
Methods inherited from class org.topbraid.shacl.expr.AbstractNodeExpression
evalReverse, getRDFNode, isReversible, toString
-
-
-
-
Constructor Detail
-
DistinctExpression
public DistinctExpression(org.apache.jena.rdf.model.RDFNode expr, NodeExpression input)
-
-
Method Detail
-
eval
public org.apache.jena.util.iterator.ExtendedIterator<org.apache.jena.rdf.model.RDFNode> eval(org.apache.jena.rdf.model.RDFNode focusNode, NodeExpressionContext context)Description copied from interface:NodeExpressionProduces an iterator of value nodes for a given focus node.- Parameters:
focusNode- the focus nodecontext- the context- Returns:
- an iterator (never null)
-
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- Overrides:
getOutputShapein classAbstractNodeExpression- 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
-
getTypeId
public String getTypeId()
-
distinct
public static org.apache.jena.util.iterator.ExtendedIterator<org.apache.jena.rdf.model.RDFNode> distinct(org.apache.jena.util.iterator.ExtendedIterator<org.apache.jena.rdf.model.RDFNode> base)
Produces an RDFNode iterator that drops duplicate values, based on a Set.- Parameters:
base- the iterator to wrap- Returns:
- a distinct iterator
-
visit
public void visit(NodeExpressionVisitor visitor)
-
-