These results are different with other JsonPath implementation (Goessner).
in the latest version of JayWay JsonPath (2.2.0), the output of Path 1 and Path 2 is compatible with Goessner implementation (given option "always return result list"). test here
in the JSONPathProcessor this can be done by simply adding JsonPath.using(Configuration.defaultConfiguration().addOptions(Option.ALWAYS_RETURN_LIST)); before compiling the reference in the first execute method (JsonPath path = JsonPath.compile(reference);).
I also suggest adding Lang3 into the pom (commons-lang3) and changing import namespace in be.ugent.mmlab.rml.xml.NamespaceContextAdapter from com.sun.org.apache.xml.internal.utils.PrefixResolver into org.apache.xml.utils.PrefixResolver since the former is marked as internal proprietary API.
Sample test-case using JSON input (from WorldBank)
JSON Path 1:
$[1]
JSON Path 2:$[1].*
using the version of JayWay JsonPath in the current pom.xml (0.9.1), the result of Path 1 would be
but Path 2 will result
These results are different with other JsonPath implementation (Goessner).
in the latest version of JayWay JsonPath (2.2.0), the output of Path 1 and Path 2 is compatible with Goessner implementation (given option "always return result list"). test here
in the JSONPathProcessor this can be done by simply adding
JsonPath.using(Configuration.defaultConfiguration().addOptions(Option.ALWAYS_RETURN_LIST));
before compiling the reference in the first execute method (JsonPath path = JsonPath.compile(reference);
).I also suggest adding Lang3 into the pom (commons-lang3) and changing import namespace in
be.ugent.mmlab.rml.xml.NamespaceContextAdapter
fromcom.sun.org.apache.xml.internal.utils.PrefixResolver
intoorg.apache.xml.utils.PrefixResolver
since the former is marked as internal proprietary API.Cheers,