J1QL Updates

J1QL Update: Optional traversal query results are now consistent with non-optional results

Issue description:
Queries with optional traversals and no RETURN statement have traditionally defaulted to returning the expected results (first entity type/class after Find), but *also* returned any entities found from the optional traversal. This was never optimal or intuitive as it did not match the behavior of regular queries.

When will this change occur?
This change will be moved to production on March 17, 2022.

What is changing?
Queries like FIND User (that is Person)? previously created a union set of User and Person entities from the optional traversal and always returned that merged set if no return statement was included. The changes we will introduce this week will modify existing behavior to be more aligned with regular graph queries so the User entities (not the merged set) will be returned as query results.

In the example above, there is no real difference between FIND User (that is Person)? and find User, but there would be an impact to queries that continue to chain relationship constraints on to the query. For example, the query Find User (that is Person)? that owns Device would previously return that unioned set, but now will just return the user entities.

What if I still want to receive the combined set of entities?
If you would still like to receive the combined set of entities, an alias can be simply attached after the optional traversal and retrieved explicitly via a RETURN statement. Continuing with the example above, we would make the following modification to the query: Find User (that is Person)? As UserAndPerson that owns Device return UserAndPerson.

Will I need to modify my existing queries?
In most cases, no. JupiterOne has proactively identified a small number of existing customers with saved queries that will be impacted by this change. For everyone else, this update is informational only.

Where can I get additional information?
If you have any questions regarding this change, please reach out to your assigned Customer Success Engineer, or post your questions in the  #j1ql community Slack channel.

This Month's Leaders