Skip to main content
Question

JSON Query Predicates


dbaldacchino1
Enthusiast
Forum|alt.badge.img+13

Hi,

I think I know the answer is "can't do this in FME yet", but thought of asking anyway :) Is there a syntax for constructing a predicate in JSON Query when used in a JSONExtractor or JSONFragmenter transformer? Basically I'm after getting to the data within complex JSON structures quicker and avoid having to fragment/flatten everything and then filter afterwards. Attached is an example: with a predicate, one would be able to get to the proper "Food" object in the array based on the predicate "Type"="Fruit", instead of having to flatten the whole thing, testing and filtering, then exploding again. Assuming this is not really possible, I also wrote a broader post in the Ideas section. Thanks.

2 replies

hkingsbury
Celebrity
Forum|alt.badge.img+54
  • Celebrity
  • February 9, 2021

That would be helpful to have, but from that documentation it appears that it is a function of a "[JSONata is a lightweight] query and transformation language for JSON data"

So safe would either have to build their own tools/functions/transformers to achieve similar results or license/include that language.

 

Regardless, have a thumbs up on your idea 👍


dbaldacchino1
Enthusiast
Forum|alt.badge.img+13
  • Author
  • Enthusiast
  • February 9, 2021
hkingsbury wrote:

That would be helpful to have, but from that documentation it appears that it is a function of a "[JSONata is a lightweight] query and transformation language for JSON data"

So safe would either have to build their own tools/functions/transformers to achieve similar results or license/include that language.

 

Regardless, have a thumbs up on your idea 👍

Thanks, you're absolutely right. I thought there was some kind of standard way to do JSON querying. Maybe I should have made reference to JSONPath perhaps...there seems to be definite room for improvement here, especially if you are using FME heavily to interact with web services.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings