Repository navigation
Represent "contains" filters explicitly, with a Contains class - #182
Merged
apdavison merged 1 commit intoOct 20, 2026
Merged
Conversation
Add a Contains class alongside Equals and Regex, so that all three ways of matching text in a filter can be written explicitly, and convert a plain string given as the filter value for a text property into a Contains. A plain string means the same as before, so no generated query changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Currently, a filter on a text property can be given as an
Equals(the KG's EQUALS operator) or aRegex(REGEX), but the default, CONTAINS, has no class of its own: it is what a plain string does. The documentation therefore describesEqualsandRegexeach in terms of "a plain string", rather than presenting the three ways of matching text together.With this PR, there is a
Containsclass alongsideEqualsandRegex(exported fromfairgraph), and a plain string given as the filter value for a text property is converted to aContains, so every text filter is explicit internally. The existence query usesContainswithexistence_match="contains", as it already usesEqualswith"equals". Values for other properties (ids of linked nodes, IRIs, dates, numbers) are left as they are.A plain string means the same as before, so nothing changes for existing code: the golden query tests pass unchanged. The user guide now introduces the three filter classes together.