Class PathExpression

    • Constructor Detail

      • PathExpression

        public PathExpression​(org.apache.jena.rdf.model.RDFNode expr,
                              org.apache.jena.rdf.model.Resource path,
                              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: NodeExpression
        Produces an iterator of value nodes for a given focus node.
        Parameters:
        focusNode - the focus node
        context - the context
        Returns:
        an iterator (never null)
      • 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: NodeExpression
        Produces 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:
        evalReverse in interface NodeExpression
        Overrides:
        evalReverse in class AbstractNodeExpression
        Parameters:
        valueNode - the value node
        context - the context
        Returns:
        an iterator (never null)
      • getJenaPath

        public org.apache.jena.sparql.path.Path getJenaPath()
      • getPredicate

        public org.apache.jena.rdf.model.Property getPredicate()
      • getOutputShape

        public org.apache.jena.rdf.model.Resource getOutputShape​(org.apache.jena.rdf.model.Resource contextShape)
        Description copied from interface: NodeExpression
        Gets 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:
        getOutputShape in interface NodeExpression
        Overrides:
        getOutputShape in class AbstractNodeExpression
        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
      • getPath

        public org.apache.jena.rdf.model.Resource getPath()
      • getTypeId

        public String getTypeId()
      • isMaybeInferred

        public boolean isMaybeInferred​(ShapesGraph shapesGraph)
      • isReversible

        public boolean isReversible​(NodeExpressionContext context)
        Description copied from interface: NodeExpression
        Checks 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:
        isReversible in interface NodeExpression
        Overrides:
        isReversible in class AbstractNodeExpression
        Parameters:
        context - the context
        Returns:
        true if reversible