[MODCXMOCK-12] align with CQL schema Created: 02/Jan/18  Updated: 04/Jan/18  Resolved: 04/Jan/18

Status: Closed
Project: mod-codex-mock
Components: None
Affects versions: None
Fix versions: 1.0.2

Type: New Feature Priority: P3
Reporter: Jakub Skoczen Assignee: Heikki Levanto
Resolution: Done Votes: 0
Labels: sprint29
Remaining Estimate: Not Specified
Time Spent: 1 day
Original estimate: Not Specified

Issue links:
Relates
relates to MODCXINV-7 Convert from Codex CQL to Inventory CQL Closed
Sprint:

 Description   

In the 'raml' repo.



 Comments   
Comment by Heikki Levanto [ 02/Jan/18 ]

https://github.com/folio-org/raml/blob/master/schemas/codex/codex_instance_cqlschema.json

Comment by Heikki Levanto [ 03/Jan/18 ]

Looks like I need to fix the following in the query:

  • 'resourceType' in the query should be translated to plain 'type', as that is what we have in the data
  • 'identifier/type=isbn' should be mapped to plain 'identifier'. Yes, it will match other identifiers too, but we don't have any in the mock data
  • Same for 'identifier/type=issn', although we don't have any data with that. Maybe we should find some examples

Actually, the proper isbn query would be '(identifier=isbn and identifier=123456789)'. It is not perfect, but at least it will not find records that have the same identifier under some other type , but do not have an isbn at all.

These are so small changes that I think it is easiest to do them with a simple string replacement, without

Comment by Jakub Skoczen [ 03/Jan/18 ]

I doubt you can do this well with a simple string replacement (rather than walking the CQL parse tree). There are modifiers that need to be handler and index names that need to be mapped.

Comment by Heikki Levanto [ 03/Jan/18 ]

As far as I can see, there are only those three I mentioned above, and they all are easy to handle with string replacements. Yes, there are pathological corner cases that will fail, like 'title=resourceType', but for the mock that will not matter so much

I just heard from Adam that is it not so easy to traverse the parse tree and make modifications...

Comment by Jakub Skoczen [ 03/Jan/18 ]

You can be sure more things are coming in the future versions of the codex and we will want flexibility first. But the choice is your, of course.

Comment by Heikki Levanto [ 03/Jan/18 ]

I may switch to walking through the parse tree once we get setters in the nodes, so I can modify them on the fly. But for now, a few small regular expressions was so much easier.

Comment by Heikki Levanto [ 04/Jan/18 ]

Fixed, merged into master

Generated at Thu Feb 08 22:26:46 UTC 2024 using Jira 1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d.