Repository navigation
Add customizable AST-based search patterns to DataProvider and entity search components - #176
Merged
Merged
Conversation
AlexeyMz
force-pushed
the
lookup-patterns
branch
6 times, most recently
from
November 14, 2026 23:10
db095e1 to
3758e6c
Compare
AlexeyMz
force-pushed
the
lookup-patterns
branch
6 times, most recently
from
November 22, 2026 12:55
2875d4a to
af9881e
Compare
AlexeyMz
marked this pull request as ready for review
November 22, 2026 12:56
…ty search components: - Add AST-based lookup patterns to `DataProvider`: * Support entity search with composable `LookupPattern` in `DataProvider.lookup()`; * **[💥Breaking]** Only provide `inLinks` and `outLinks` for result items from `DataProvider.lookup()` when `withLinks: true` is specified and there is a top-level `connectedTo`-pattern with constant `fromValues` sub-pattern (i.e. including just passing `refElementId`); - Add extendable search UI to `InstancesSearch` and `SearchSectionEntities` based on lookup patterns: * Add `SearchPattern`-derived types (separate from `LookupPattern`) to allow customizable search pattern display and editors; * Add built-in search criteria options: `SearchCriterionAnd`, `SearchCriterionOr`, `SearchCriterionHasType` `SearchCriterionConnectedTo`, `SearchCriterionFromValues`, `SearchCriterionHasProperty`; * Add utility "building blocks" for custom search criteria: `SearchCriterionBlock`, `SearchCriterionWhereGroup`, `SearchCriterionWhere`. - Fix incorrect `limit` support in `SparqlDataProvider.lookup()` query if a connected element has more than one type (including transitive super-types) or it is connected by more than one link or direction: * Projection variables `?link` and `?direction` are removed from `SparqlDataProviderSettings.lookupQuery`; * Separate links query is issued instead of a complex single query to compute `inLinks` and `outLinks` for `DataProviderLookupItem`. - Depend on `@floating-ui/react-dom` for better placed dropdown floating panels. - Improve element/link/property types processing in data providers: * Add `lookupElementTypes()`, `lookupPropertyTypes()` and `lookupLinkTypes()` methods to `DataProvider` to allow to search for the corresponding types; * Add `RdfDataProvider` options `propertyOrLinkBaseTypes` and `propertyTypeBaseTypes` (in addition to existing `linkTypeBaseTypes`) to distinguish between link and property types; * Always compute counts for implicit element/link/property types in `RdfDataProvider`; * Update `IndexedDbCachedProvider.DB_VERSION` to `5`. - Remove no entity type fallback to `owl:Thing` in `filterElementInfoPattern` for `OwlRdfsSettings` and `WikidataSettings`. - Clarify `useAsync()` behavior on `undefined` return value from `load` callback to keep the previous result. - Add internal utility components: * Add `ErrorMessage` component to display a formatted error message from an exception when possible; * Add base `Autocomplete` component based on `Dropdown` and `SearchInput`; * Add `EntitySelect` component based on `Autocomplete` to lookup one or multiple entities by label; * Add `SchemaTypeSelect` component with default suggestions for select element/property/link types; * Extract `SchemaTypeView` from class tree to display an element/property/link type; - Improve code structure and unit tests: * Refactor `SparqlDataProvider` query generation into separate module `SparqlGenerator`; * Add thorough unit tests for `lookup()` in `SparqlDataProvider` and `RdfDataProvider`; * Refactor `SearchInput` and its usages to have proper slots to display additional components inside; * Add block display mode to `InlineEntity`; * Add `useCombinedRef()`, extract `useFetchStatus()` hook; - Add storybook-like `components` example page as an interactive playground for exported and internal components;
AlexeyMz
force-pushed
the
lookup-patterns
branch
from
November 22, 2026 18:57
af9881e to
06dab65
Compare
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.
DataProvider:LookupPatterninDataProvider.lookup();inLinksandoutLinksfor result items fromDataProvider.lookup()whenwithLinks: trueis specified and there is a top-levelconnectedTo-pattern with constantfromValuessub-pattern (i.e. including just passingrefElementId);InstancesSearchandSearchSectionEntitiesbased on lookup patterns:SearchPattern-derived types (separate fromLookupPattern) to allow customizable search pattern display and editors;SearchCriterionAnd,SearchCriterionOr,SearchCriterionHasTypeSearchCriterionConnectedTo,SearchCriterionFromValues,SearchCriterionHasProperty;SearchCriterionBlock,SearchCriterionWhereGroup,SearchCriterionWhere.limitsupport inSparqlDataProvider.lookup()query if a connected element has more than one type (including transitive super-types) or it is connected by more than one link or direction:?linkand?directionare removed fromSparqlDataProviderSettings.lookupQuery;inLinksandoutLinksforDataProviderLookupItem.@floating-ui/react-domfor better placed dropdown floating panels.lookupElementTypes(),lookupPropertyTypes()andlookupLinkTypes()methods toDataProviderto allow to search for the corresponding types;RdfDataProvideroptionspropertyOrLinkBaseTypesandpropertyTypeBaseTypes(in addition to existinglinkTypeBaseTypes) to distinguish between link and property types;RdfDataProvider;IndexedDbCachedProvider.DB_VERSIONto5.owl:ThinginfilterElementInfoPatternforOwlRdfsSettingsandWikidataSettings.useAsync()behavior onundefinedreturn value fromloadcallback to keep the previous result.ErrorMessagecomponent to display a formatted error message from an exception when possible;Autocompletecomponent based onDropdownandSearchInput;EntitySelectcomponent based onAutocompleteto lookup one or multiple entities by label;SchemaTypeSelectcomponent with default suggestions for select element/property/link types;SchemaTypeViewfrom class tree to display an element/property/link type;SparqlDataProviderquery generation into separate moduleSparqlGenerator;lookup()inSparqlDataProviderandRdfDataProvider;SearchInputand its usages to have proper slots to display additional components inside;InlineEntity;useCombinedRef(), extractuseFetchStatus()hook;componentsexample page as an interactive playground for exported and internal components;TODO:
SparqlDataProvider.lookup()andRdfDataProvider.lookup()SearchPatternlookup pattern generation and serialization;inLinks/outLinks" expected behavior forSparqlDataProviderAdd custom search criteria (entities from SPARQL query) example(in the follow-up)