- changed status to open
ExpressionPredicate's handling of regex function seems to fail if regex does not match
The implementation for the regex function differs significantly between the ARRAY and OBJECT branches. The array branch appears correct to me. I am testing the object branch and when my regex does not match, I am still getting values added and so JPath.evaluate is returning non-null.
Comments (6)
-
repo owner -
repo owner -
assigned issue to
I will check this in my next attempt at a query language. I have used the regex function quite a bit so I would be interested in seeing some examples.
In any case, I did not respond within a reasonable timeframe so I am assuming you have moved on to something that is actually working for you.
John
-
assigned issue to
-
reporter I have made a number of fixes for issues reported in my local copy. I was unable to reach you for creation of pull requests so I needed to fix on my side. I could share them back.
-
repo owner Hello Eric, share away - happy to include anyting of value and applogies for the lack of reponse. My Bitbucket account was pointing to an email address I did not actually use :-S.
I am currently working on BSON support for an internal memory file store so I have spent a bit of time optimising the main model and the parsing.
I was planning on cleaning up JPath next. I was hoping a good standard had emerged. I did a bit of research over the last couple of days about how JSON is generally getting queried these days but there still seems to be no really good definition of a query language.
- JMESPath - This looks ok to me but I dont know how wide spread its adoption is http://jmespath.org/
- JSON Pointer - This one is at least a formal standard but its really basic and I dont like the replacement choices. https://tools.ietf.org/html/rfc6901
- Jaql - This looks like a totally different path and I would have to do a lot of leg work to support it. https://code.google.com/archive/p/jaql/
Out of interest, what are you using JSONiJ for?
John
-
reporter Here is what I have in terms of fixes or enhancements. I believe it was based off version 0.3.1. I can answer any questions related to the changes you have. Sorry I don't have more background to give; it has been over a year since I last did anything with this.
In terms of how it is used here (at Thomson Reuters), we have a JMS/MQ pathway for application events. These events have JSON payloads. At some point we have a dispatcher process setup that checks for certain characteristics in events and decides where it should be routed next. This makes heavy use of JSONiJ's JPath matching. Here is a sample from our rules XML:
<eventdispatcher>
<!-- source connection factory/pool and queue
(factoryOrPoolName:queueName) --> <source>EventDispatchQueueConnection:COBALT.EVENTS.ALL</source>
<!-- Rule mappings (see
com.trgr.cobalt.infrastructure.eventdispatcher.Rule) @category: product or service identifier for traceability jpath: an XPath-like syntax for selecting events; see the JSONiJ site for more details destination(s): destination connection factory/pool and queue (factoryOrPoolName:queueName) -->
<rules> <rule category="BusinessIntelligence">
<jpath>/[?(regex(@.name,"MyBusinessIntelligence.Website.NewsPlusData"))]</jpath> <destination> RnDNewsPlusQueueConnectionPool:COBALT.RND.NEWSPLUS.EVENTS</destination> </rule> <rule category="BusinessIntelligence">
<jpath>/[?(regex(@.name,"MyBusinessIntelligence.Website.FullText"))] AND /properties[?(@.DocumentContentType="news")]</jpath> <destination> RnDNewsPlusQueueConnectionPool:COBALT.RND.NEWSPLUS.EVENTS</destination> </rule>
<rule category="HistoryListener">
<jpath>/[?(regex(@.name,"Cobalt.Document.FullText.Display"))]</jpath>
<destination>HistoryQueueConnectionPool:COBALT.FOLDERING.HISTORY.EVENTS.SHARED</destination> </rule>
-
repo owner Hello Eric,
Here is what I have in terms of fixes or enhancements.
Where are the changes? I cant see any repositories on your user or pull requests. You could zip and email to me at j.w.marsden@gmail.com.
Thanks,
John
- Log in to comment