Class ITER_JSONPath

  • All Implemented Interfaces:
    IteratorFunction

    public class ITER_JSONPath
    extends IteratorFunctionBase
    Iterator function iter:JSONPath extracts a list of sub-JSON documents of a JSON document, according to a JSONPath expression. See https://github.com/json-path/JsonPath for the JSONPath syntax specification.

    See Live example

    • Param 1: (json): the URI of the JSON document (a URI), or the JSON object itself (a String);
    • Param 2: (jsonPath) the JSONPath query;
    • Param 3 .. N : (auxJsonPath ... ) other JSONPath queries, which will be executed over the results of the execution of jsonPath, and provide one result each.
    The following variables may be bound:
    • Output 1: (string) sub-JSON document, encoded in a string literal;
    • Output 2 .. N-1: result of the execution of the auxiliary JsonPath queries on Output 1, encoded as a boolean, float, double, integer, string, as it best fits;
    • Output N: (integer) the position of the result in the list;
    • Output N+1: (boolean) true if this result has a next result in the list.
    Output 2 and 3 can be used to generate RDF lists from the input, but the use of keyword LIST( ?var ) as the object of a triple pattern covers most cases more elegantly.
    Author:
    Maxime Lefrançois
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String URI  
    • Constructor Summary

      Constructors 
      Constructor Description
      ITER_JSONPath()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void checkBuild​(ExprList args)
      Partially checks if the iterator function can be executed with the given arguments.
      java.util.List<java.util.List<NodeValue>> exec​(java.util.List<NodeValue> args)
      IteratorFunction call to a list of evaluated argument values.
      static com.jayway.jsonpath.Configuration getConf()
      Get the general JSONPath JayWay configuration.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ITER_JSONPath

        public ITER_JSONPath()
    • Method Detail

      • getConf

        public static com.jayway.jsonpath.Configuration getConf()
        Get the general JSONPath JayWay configuration.
        Returns: