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

Decompose strict equalities with Values nodes #680

Merged
merged 8 commits into from Jun 21, 2023

Conversation

bcogrel
Copy link
Member

@bcogrel bcogrel commented Jun 21, 2023

This PR introduces decomposition of strict equalities for values node.

For instance, values nodes often contain IRI strings and they are joining with mapping definitions that builds these IRIs from an IRI template. Values nodes can be simplified to contain the values used as parameters in the IRI template instead of the IRI strings.

Similarly they should use natural DB values (e.g. integer) instead of strings to make the joins more efficient (with no cast-to-string anymore).

Example:

JOIN
   VALUES [x] ("http://localhost/thing/1/3"^^STRING) ("http://localhost/thing/2/4"^^STRING) ("http://localhost/thing/notANumber/5"^^STRING) (NULL) ("http://localhost/somethingelse"^^STRING)
   CONSTRUCT [x] [x/http://localhost/thing/{}/{}(LARGE_INTToSTRING(a),b)]
      EXTENSIONAL STR_TABLE1AR2(0:a,1:b)

into

CONSTRUCT [x] [x/http://localhost/thing/{}/{}(LARGE_INTToSTRING(a),b)]
   JOIN
      VALUES [b, a] ("3"^^STRING,"1"^^LARGE_INT) ("4"^^STRING,"2"^^LARGE_INT)
      EXTENSIONAL STR_TABLE1AR2(0:a,1:b)

@bcogrel bcogrel added this to the v5.1.0 milestone Jun 21, 2023
@bcogrel bcogrel self-assigned this Jun 21, 2023
@bcogrel bcogrel merged commit 5725789 into version5 Jun 21, 2023
17 checks passed
@bcogrel bcogrel deleted the feature/iri-decomposition-values branch June 21, 2023 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant