Class ITER_JSONPath
java.lang.Object
fr.mines_stetienne.ci.sparql_generate.iterator.IteratorStreamFunctionBase
fr.mines_stetienne.ci.sparql_generate.iterator.IteratorFunctionBase
fr.mines_stetienne.ci.sparql_generate.json.ITER_JSONPath
- All Implemented Interfaces:
fr.mines_stetienne.ci.sparql_generate.iterator.IteratorFunction
public class ITER_JSONPath
extends fr.mines_stetienne.ci.sparql_generate.iterator.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.
- 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.
LIST( ?var )
as the object of a triple pattern covers most cases
more elegantly.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
checkBuild(org.apache.jena.sparql.expr.ExprList args)
static com.jayway.jsonpath.Configuration
getConf()
Get the general JSONPath JayWay configuration.Methods inherited from class fr.mines_stetienne.ci.sparql_generate.iterator.IteratorFunctionBase
exec
Methods inherited from class fr.mines_stetienne.ci.sparql_generate.iterator.IteratorStreamFunctionBase
build, exec, getContext
-
Field Details
-
URI
- See Also:
- Constant Field Values
-
-
Constructor Details
-
ITER_JSONPath
public ITER_JSONPath()
-
-
Method Details
-
getConf
public static com.jayway.jsonpath.Configuration getConf()Get the general JSONPath JayWay configuration.- Returns:
-
exec
public List<List<org.apache.jena.sparql.expr.NodeValue>> exec(List<org.apache.jena.sparql.expr.NodeValue> args)- Specified by:
exec
in classfr.mines_stetienne.ci.sparql_generate.iterator.IteratorFunctionBase
-
checkBuild
public void checkBuild(org.apache.jena.sparql.expr.ExprList args)- Specified by:
checkBuild
in classfr.mines_stetienne.ci.sparql_generate.iterator.IteratorStreamFunctionBase
-