Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating the matching/linking rules syntax to support null, and repeated variable names #184

Merged
merged 15 commits into from
Mar 5, 2024

Conversation

walisc
Copy link
Collaborator

@walisc walisc commented Feb 22, 2024

Ticket: N/A
Other Related Tickets: N/A


Describe of changes

This change extends the config rules parser to support null values, and have multiple variables in the rull. The rules that can now be supported are examplified below:

  • Example1

    • Input rule: eq(nationalId)
    • Output
      query query_link_deterministic_a($national_id: string) {
             all(func:type(GoldenRecord)) @filter(eq(GoldenRecord.national_id, 
               $national_id
               )) {
                uid
                GoldenRecord.source_id {
                   uid
                }
                GoldenRecord.aux_date_created
                GoldenRecord.aux_auto_update_enabled
                GoldenRecord.aux_id
                GoldenRecord.given_name
                GoldenRecord.family_name
                GoldenRecord.gender
                GoldenRecord.dob
                GoldenRecord.city
                GoldenRecord.phone_number
                GoldenRecord.national_id
             }
          }
  • Example2

    • Input rule: eq(national_id) or null(national_id) and eq(ccc)
    • Output
      query query_link_deterministic_a($national_id: string) {
             var(func:type(GoldenRecord)) @filter(eq(GoldenRecord.national_id, 
               $national_id
               )) {
                A as uid
             }
             var(func:type(GoldenRecord)) @filter(eq(GoldenRecord.national_id, "")) {
                B as uid
             }
             var(func:type(GoldenRecord)) @filter(eq(GoldenRecord.ccc, 
               $ccc
               )) {
                C as uid
             }
             all(func:type(GoldenRecord)) @filter(uid(A) OR (uid(B) AND uid(C))) {
                uid
                GoldenRecord.source_id {
                   uid
                }
                GoldenRecord.aux_date_created
                GoldenRecord.aux_auto_update_enabled
                GoldenRecord.aux_id
                GoldenRecord.given_name
                GoldenRecord.family_name
                GoldenRecord.gender
                GoldenRecord.dob
                GoldenRecord.city
                GoldenRecord.phone_number
                GoldenRecord.national_id
             }
          }

How to test

  • To test this you will need to adjist the config reference ( JeMPI_Apps/JeMPI_Configuration/reference/config-reference-api.json ) rules to the null expression. An example of this if is found in the following file config-reference.json
  • Once update you will need the source code generator (run ./create.sh reference/config-reference.json in the 'JeMPI_Apps/JeMPI_Configuration/reference/' folder)
  • From there you should be able to add new golden records, and search as appropiate to get your results back. An example of addin records (based on the config above) and search is found in the thunderclient config
    JeMPI-QueryTests.json

@walisc walisc marked this pull request as draft February 22, 2024 09:43
@walisc walisc requested a review from w-hayes February 27, 2024 13:48
@walisc walisc marked this pull request as ready for review February 27, 2024 13:48
Copy link
Collaborator

@MatthewErispe MatthewErispe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@walisc LGTM

@MatthewErispe MatthewErispe merged commit 4ebf98a into dev Mar 5, 2024
5 checks passed
@MatthewErispe MatthewErispe deleted the dev_null_parser branch March 5, 2024 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants