Skip to content

Add customizable AST-based search patterns to DataProvider and entity search components - #176

Draft
AlexeyMz wants to merge 2 commits into
masterfrom
lookup-patterns
Draft

AlexeyMz wants to merge 2 commits into
masterfrom
lookup-patterns

Conversation

@AlexeyMz

@AlexeyMz AlexeyMz commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

TODO:

  • Change link direction selector to a button group
  • Add JSDoc to newly exported types, components and functions
  • Add tests for SparqlDataProvider.lookup() and RdfDataProvider.lookup()
  • Add tests for SearchPattern lookup pattern generation and serialization;
  • Investigate and fix "connected by inLinks/outLinks" expected behavior for SparqlDataProvider
  • Add CHANGELOG description
  • Add custom search criteria (entities from SPARQL query) example (in the follow-up)

@AlexeyMz
AlexeyMz force-pushed the lookup-patterns branch 6 times, most recently from db095e1 to 3758e6c Compare November 14, 2026 23:10
@AlexeyMz
AlexeyMz force-pushed the lookup-patterns branch 4 times, most recently from cda38f5 to 6bafe81 Compare November 21, 2026 21:35
…ty search components:

`DataProvider` changes:
* Support AST-based `LookupPattern` via `DataProvider.lookup()`;
* Add `lookupElementTypes()`, `lookupPropertyTypes()` and `lookupLinkTypes()` methods to `DataProvider`;
* 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`);
* Fix incorrect limiting in `SparqlDataProvider.lookup()` query if connected element has more than one type (including transitive super-types) or it is connected by more than one link or direction;
* Remove `?link` and `?direction` projections from `SparqlDataProviderSettings.lookupQuery` (separate links query is issued instead of a complex single query);
* Remove no entity type fallback to `owl:Thing` in `filterElementInfoPattern` for `OwlRdfsSettings` and `WikidataSettings`;
* 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`
* Refactor `SparqlDataProvider` query generation into separate module `SparqlGenerator`;
* Add thorough unit tests for `lookup()` in `SparqlDataProvider` and `RdfDataProvider`;

`InstancesSearch`/`SearchSectionEntities` changes:
* Add `SearchPattern`-derived types (separate from `LookupPattern`) to allow customizable search pattern display and editors;
* Add built-in search criterion options: `SearchCriterionAnd`, `SearchCriterionOr`, `SearchCriterionHasType`
  `SearchCriterionConnectedTo`, `SearchCriterionFromValues`, `SearchCriterionHasProperty`;
* Add utility 'building blocks" for custom search criterions: `SearchCriterionBlock`,
  `SearchCriterionWhereGroup`, `SearchCriterionWhere`;

Utility changes:
* Use `@floating-ui/react-dom` for properly placed dropdown floating panels;
* Add base `Autocomplete` component based on `Dropdown` and `SearchInput`;
* Refactor `SearchInput` and its usages to have proper slots to display additional components inside;
* 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;
* Add `ErrorMessage` component to display a formatted error message from an exception when possible;
* Add block display mode to `InlineEntity`;
* Add `useCombinedRef()`, extract `useFetchStatus()` hook;
* Clarify `useAsync()` behavior on `undefined` return value from `load` callback;

Other changes:
* Add storybook-like `components` example page as an interactive playground for exported and internal components;
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.

1 participant