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

Allow context to be cleared by setting it to nil #14

Merged
merged 3 commits into from
Apr 17, 2023

Conversation

dpetran
Copy link
Contributor

@dpetran dpetran commented Mar 7, 2023

This addresses/enables a solution for fluree/db#395

If a context is set to nil, compact should return fully expanded json-ld.

@dpetran dpetran requested a review from a team March 7, 2023 20:44
@dpetran dpetran closed this Mar 7, 2023
@dpetran dpetran reopened this Mar 21, 2023
Swapped the order of the test clauses so the failure reports make more sense. Also some
whitespace cleanup.

Also changed the signature of `parse-map` to match all of the other "parse-" type
functions, accepting the "externals" arg as the second arg instead of first. Also fixed
up some cases where weren't passing on the base context, and gave it a clearer name.
If context is `nil`, `context/parse` will return an empty context. During expansion we
need to be a little more careful that we don't pass in a nil context by accident, and
instead pass in an empty context for a no-op, which was the old `nil` context behavior.
Make sure to use the expected actual form for the tests, add some tests to show behavior
of "identity" operations.
@dpetran
Copy link
Contributor Author

dpetran commented Mar 21, 2023

This is ready for review again. No changes were necessary, just rebased on main.

@dpetran dpetran merged commit a570e8f into main Apr 17, 2023
@dpetran dpetran deleted the feature/clear-context branch April 17, 2023 20:09
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