@ts4nfdi/terminology-service-suite 7.2.5 → 7.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/ols/OlsBaseApi.d.ts +1 -0
- package/dist/api/ols/OlsSearchApi.d.ts +1 -0
- package/dist/app/types.d.ts +76 -24
- package/dist/app/widgetDescriptions.d.ts +1 -0
- package/dist/components/widgets/AutocompleteWidget/AutocompleteWidget.d.ts +14 -2
- package/dist/components/widgets/AutocompleteWidget/AutocompleteWidget.stories.d.ts +1 -0
- package/dist/components/widgets/AutocompleteWidget/AutocompleteWidgetStories.d.ts +1 -0
- package/dist/components/widgets/DataContentWidget/DataContentWidget.stories.d.ts +1 -1
- package/dist/components/widgets/DataContentWidget/DataContentWidgetStories.d.ts +1 -1
- package/dist/components/widgets/EntityProviderWidget/EntityProviderWidget.stories.d.ts +61 -0
- package/dist/components/widgets/EntityProviderWidget/EntityProviderWidgetStories.d.ts +70 -0
- package/dist/components/widgets/EntityProviderWidget/getEntityProvider.d.ts +60 -0
- package/dist/components/widgets/EntityProviderWidget/index.d.ts +3 -0
- package/dist/components/widgets/EntityProviderWidget/useEntityProvider.d.ts +21 -0
- package/dist/components/widgets/GraphViewWidget/GraphViewWidget.stories.d.ts +1 -1
- package/dist/components/widgets/GraphViewWidget/GraphViewWidgetStories.d.ts +1 -1
- package/dist/components/widgets/OntologyInfoWidget/OntologyInfoWidget.stories.d.ts +1 -1
- package/dist/components/widgets/OntologyInfoWidget/OntologyInfoWidgetStories.d.ts +1 -1
- package/dist/components/widgets/ResourcesWidget/ResourcesWidget.stories.d.ts +1 -1
- package/dist/components/widgets/ResourcesWidget/ResourcesWidgetStories.d.ts +1 -1
- package/dist/components/widgets/SearchResultsListWidget/SearchResultsListWidget.stories.d.ts +1 -1
- package/dist/components/widgets/SearchResultsListWidget/SearchResultsListWidgetStories.d.ts +1 -1
- package/dist/components/widgets/TermDepictionWidget/TermDepictionWidget.stories.d.ts +1 -1
- package/dist/components/widgets/TermDepictionWidget/TermDepictionWidgetStories.d.ts +1 -1
- package/dist/components/widgets/index.d.ts +1 -0
- package/dist/esm/index.es.js +3227 -3116
- package/dist/esm/index.es.js.map +1 -1
- package/dist/model/interfaces/SelectResult.d.ts +3 -2
- package/dist/model/ols-model/OLSSelectResult.d.ts +3 -2
- package/dist/server/index.es.js +44 -37
- package/dist/server/index.es.js.map +1 -1
- package/dist/stories/storyArgs.d.ts +2 -1
- package/package.json +1 -1
|
@@ -3,4 +3,5 @@ export declare class OlsBaseApi {
|
|
|
3
3
|
protected axiosInstance: AxiosInstance;
|
|
4
4
|
constructor(api: string | AxiosInstance);
|
|
5
5
|
protected makeCall(url: string, config: AxiosRequestConfig<any> | undefined, useLegacy: boolean): Promise<any>;
|
|
6
|
+
getFullUrl(url: string, config: AxiosRequestConfig<any> | undefined, useLegacy: boolean): string;
|
|
6
7
|
}
|
|
@@ -13,6 +13,7 @@ export declare class OlsSearchApi extends OlsBaseApi {
|
|
|
13
13
|
*/
|
|
14
14
|
getSelectData(queryParams: SelectQueryParams, paginationParams?: PaginationParams, contentParams?: ContentParams, parameter?: string): Promise<Select>;
|
|
15
15
|
suggest: (queryParams: SuggestQueryParams, paginationParams?: PaginationParams, contentParams?: ContentParams, parameter?: string) => Promise<any>;
|
|
16
|
+
getSelectRequestUrl(queryParams: SelectQueryParams, paginationParams?: PaginationParams, contentParams?: ContentParams, parameter?: string): string;
|
|
16
17
|
}
|
|
17
18
|
export declare function splitAndApplyParams(url: URL, raw: string): void;
|
|
18
19
|
export declare function normalizeBaseApi(api: string): string;
|
package/dist/app/types.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { Action } from '@elastic/eui/src/components/basic_table/action_types';
|
|
|
3
3
|
import { EuiComboBoxProps } from '@elastic/eui/src/components/combo_box/combo_box';
|
|
4
4
|
import { EuiLinkColor } from '@elastic/eui/src/components/link/link';
|
|
5
5
|
import { EuiTextProps } from '@elastic/eui/src/components/text/text';
|
|
6
|
+
import { EntityValue } from '../components/widgets/AutocompleteWidget/AutocompleteWidget';
|
|
6
7
|
import { Thing } from '../model/interfaces';
|
|
7
8
|
import { BuildHierarchyProps, HierarchyIriProp } from '../model/interfaces/HierarchyBuilder';
|
|
8
9
|
import { EntityTypeName, ThingTypeName } from '../model/ModelTypeCheck';
|
|
@@ -146,36 +147,15 @@ type TabList = {
|
|
|
146
147
|
* */
|
|
147
148
|
initialSelectedTab?: string;
|
|
148
149
|
};
|
|
149
|
-
export type
|
|
150
|
-
/**
|
|
151
|
-
* The terms metadata that autocomplete selection change event returns to the client.
|
|
152
|
-
*/
|
|
153
|
-
iri?: string;
|
|
154
|
-
description?: string;
|
|
155
|
-
label: string;
|
|
156
|
-
ontology_name?: string;
|
|
157
|
-
short_form?: string;
|
|
158
|
-
source?: string;
|
|
159
|
-
type?: string;
|
|
160
|
-
};
|
|
161
|
-
export type AutocompleteWidgetProps = EuiComboBoxProps<string> & ParameterObj & ApiObj & CssClassNameObj & UseLegacyObj & OnNavigateToOntology & {
|
|
150
|
+
export type AutocompleteWidgetProps = Partial<EuiComboBoxProps<EntityValue>> & ParameterObj & ApiObj & CssClassNameObj & UseLegacyObj & OnNavigateToOntology & {
|
|
162
151
|
/**
|
|
163
152
|
* A method that is called once the set of selection changes
|
|
164
153
|
*/
|
|
165
|
-
selectionChangedEvent: (selectedOptions:
|
|
154
|
+
selectionChangedEvent: (selectedOptions: EntityValue[]) => void;
|
|
166
155
|
/**
|
|
167
156
|
* Pass pre-selected values. If `singleSelection == true`, only the first one is displayed.
|
|
168
157
|
*/
|
|
169
|
-
preselected?:
|
|
170
|
-
label?: string;
|
|
171
|
-
iri?: string;
|
|
172
|
-
description?: string;
|
|
173
|
-
ontology_name?: string;
|
|
174
|
-
type?: string;
|
|
175
|
-
short_form?: string;
|
|
176
|
-
source?: string;
|
|
177
|
-
source_url?: string;
|
|
178
|
-
}[];
|
|
158
|
+
preselected?: EntityValue[];
|
|
179
159
|
/**
|
|
180
160
|
* Placeholder to show if no user input nor selection is performed.
|
|
181
161
|
*/
|
|
@@ -204,6 +184,10 @@ export type AutocompleteWidgetProps = EuiComboBoxProps<string> & ParameterObj &
|
|
|
204
184
|
* Initial search value to show results on first render.
|
|
205
185
|
*/
|
|
206
186
|
initialSearchQuery?: string;
|
|
187
|
+
/**
|
|
188
|
+
* Show a button to open the search request.
|
|
189
|
+
*/
|
|
190
|
+
showApiRequestButton?: boolean;
|
|
207
191
|
};
|
|
208
192
|
export type DataContentWidgetProps = ApiObj & ParameterObj;
|
|
209
193
|
export type EntityInfoWidgetProps = ApiObj & OptionalEntityTypeObj & OptionalOntologyIdObj & ForcedIriObj & HasTitleObj & ShowBadgesObj & ParameterObj & UseLegacyObj & OnNavigates;
|
|
@@ -676,4 +660,72 @@ export type MappingListWidgetProps = {
|
|
|
676
660
|
api: string;
|
|
677
661
|
source: string;
|
|
678
662
|
};
|
|
663
|
+
/**
|
|
664
|
+
* Information about the terminology backend that actually served an entity.
|
|
665
|
+
*
|
|
666
|
+
* The TS4NFDI API Gateway federates several terminology software stacks (OLS,
|
|
667
|
+
* OntoPortal, Skosmos) and reports the responsible one per entity in a
|
|
668
|
+
* `provider` block. Plain (non-gateway) OLS instances do not return it, in
|
|
669
|
+
* which case no provider can be resolved.
|
|
670
|
+
*/
|
|
671
|
+
export type EntityProvider = {
|
|
672
|
+
/**
|
|
673
|
+
* Name of the providing terminology service, e.g. `"tib"`, `"agrovoc"`.
|
|
674
|
+
* Taken from `provider_name`.
|
|
675
|
+
*/
|
|
676
|
+
name?: string;
|
|
677
|
+
/**
|
|
678
|
+
* Software stack behind the provider, e.g. `"ols2"`, `"ontoportal"`,
|
|
679
|
+
* `"skosmos"`. Taken from `provider_type`.
|
|
680
|
+
*/
|
|
681
|
+
type?: string;
|
|
682
|
+
/**
|
|
683
|
+
* Base URL of the provider's own API, e.g.
|
|
684
|
+
* `"https://api.terminology.tib.eu/api"`. Taken from `provider_api`.
|
|
685
|
+
*/
|
|
686
|
+
api?: string;
|
|
687
|
+
/**
|
|
688
|
+
* Id of the ontology this provider was reported for. Relevant when an IRI
|
|
689
|
+
* resolves in several ontologies, since each may have a different provider.
|
|
690
|
+
*/
|
|
691
|
+
ontologyId?: string;
|
|
692
|
+
/**
|
|
693
|
+
* The unmodified `provider` block from the API response, so that fields
|
|
694
|
+
* added by future gateway versions stay accessible.
|
|
695
|
+
*/
|
|
696
|
+
raw: Record<string, any>;
|
|
697
|
+
};
|
|
698
|
+
export type EntityProviderWidgetProps = ForcedIriObj & OptionalOntologyIdObj & {
|
|
699
|
+
/**
|
|
700
|
+
* The API instance for the API call. Defaults to the TS4NFDI API Gateway
|
|
701
|
+
* OLS endpoint, as the provider information is specific to the gateway.
|
|
702
|
+
*/
|
|
703
|
+
api?: string;
|
|
704
|
+
/**
|
|
705
|
+
* If false, no request is made and the result stays empty. Useful to defer
|
|
706
|
+
* fetching until an IRI is known. Default is true.
|
|
707
|
+
*/
|
|
708
|
+
enabled?: boolean;
|
|
709
|
+
};
|
|
710
|
+
export type UseEntityProviderResult = {
|
|
711
|
+
/**
|
|
712
|
+
* Provider of the entity in its defining ontology, or of the first
|
|
713
|
+
* occurrence if none is marked as defining. Undefined while loading, on
|
|
714
|
+
* error, or if the entity could not be resolved.
|
|
715
|
+
*/
|
|
716
|
+
provider?: EntityProvider;
|
|
717
|
+
/**
|
|
718
|
+
* Providers of all ontologies the IRI resolves in. Contains at most one
|
|
719
|
+
* element if `ontologyId` was provided, and is empty if the entity could not
|
|
720
|
+
* be resolved.
|
|
721
|
+
*/
|
|
722
|
+
providers: EntityProvider[];
|
|
723
|
+
isLoading: boolean;
|
|
724
|
+
isSuccess: boolean;
|
|
725
|
+
isError: boolean;
|
|
726
|
+
/**
|
|
727
|
+
* The error that made the request fail, if any.
|
|
728
|
+
*/
|
|
729
|
+
error?: Error;
|
|
730
|
+
};
|
|
679
731
|
export {};
|
|
@@ -24,3 +24,4 @@ export declare const SearchResultsListDescription: string;
|
|
|
24
24
|
export declare const TermDepictionDescription: string;
|
|
25
25
|
export declare const EntityListDescription: string;
|
|
26
26
|
export declare const MappingListDetailDescription: string;
|
|
27
|
+
export declare const EntityProviderDescription: string;
|
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
import { AutocompleteWidgetProps } from '../../../app';
|
|
2
|
+
export interface EntityValue {
|
|
3
|
+
iri?: string;
|
|
4
|
+
label?: string;
|
|
5
|
+
ontology_name?: string;
|
|
6
|
+
type?: string;
|
|
7
|
+
short_form?: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
provider_name?: string;
|
|
10
|
+
provider_type?: string;
|
|
11
|
+
provider_api?: string;
|
|
12
|
+
synonyms?: string[];
|
|
13
|
+
}
|
|
2
14
|
/**
|
|
3
15
|
* A React component to provide Autosuggestion based on SemLookP.
|
|
4
16
|
*/
|
|
5
|
-
declare function AutocompleteWidget(props: AutocompleteWidgetProps):
|
|
6
|
-
declare function WrappedAutocompleteWidget(props: AutocompleteWidgetProps):
|
|
17
|
+
declare function AutocompleteWidget(props: AutocompleteWidgetProps): JSX.Element;
|
|
18
|
+
declare function WrappedAutocompleteWidget(props: AutocompleteWidgetProps): JSX.Element;
|
|
7
19
|
export { AutocompleteWidget, WrappedAutocompleteWidget };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { EntityProviderWidgetProps } from '../../../app/types';
|
|
3
|
+
/**
|
|
4
|
+
* The widget itself renders nothing - it is a hook. This demo exists only so
|
|
5
|
+
* that Storybook has something to show: it calls the hook and dumps the result.
|
|
6
|
+
* It is intentionally local to this file and not exported from the package.
|
|
7
|
+
*/
|
|
8
|
+
declare function EntityProviderDemo(props: EntityProviderWidgetProps): JSX.Element;
|
|
9
|
+
declare const meta: {
|
|
10
|
+
title: string;
|
|
11
|
+
component: typeof EntityProviderDemo;
|
|
12
|
+
parameters: {
|
|
13
|
+
layout: string;
|
|
14
|
+
docs: {
|
|
15
|
+
description: {
|
|
16
|
+
component: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
argTypes: {
|
|
21
|
+
api: any;
|
|
22
|
+
enabled: {
|
|
23
|
+
required: boolean;
|
|
24
|
+
description: string;
|
|
25
|
+
control: {
|
|
26
|
+
readonly type: "boolean";
|
|
27
|
+
};
|
|
28
|
+
table: {
|
|
29
|
+
defaultValue: {
|
|
30
|
+
summary: string;
|
|
31
|
+
};
|
|
32
|
+
type: {
|
|
33
|
+
summary: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
ontologyId: {
|
|
38
|
+
required: boolean;
|
|
39
|
+
description: string;
|
|
40
|
+
table: {
|
|
41
|
+
defaultValue: {
|
|
42
|
+
summary: string;
|
|
43
|
+
};
|
|
44
|
+
type: {
|
|
45
|
+
summary: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
args: {
|
|
51
|
+
readonly api: "https://terminology.services.base4nfdi.de/api-gateway/ols4/api/";
|
|
52
|
+
readonly iri: "";
|
|
53
|
+
readonly ontologyId: "";
|
|
54
|
+
readonly enabled: true;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
export default meta;
|
|
58
|
+
type Story = StoryObj<typeof meta>;
|
|
59
|
+
export declare const withOntologyId: Story;
|
|
60
|
+
export declare const notFound: Story;
|
|
61
|
+
export declare const disabled: Story;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export declare const EntityProviderWidgetStoryArgTypes: {
|
|
2
|
+
api: any;
|
|
3
|
+
enabled: {
|
|
4
|
+
required: boolean;
|
|
5
|
+
description: string;
|
|
6
|
+
control: {
|
|
7
|
+
readonly type: "boolean";
|
|
8
|
+
};
|
|
9
|
+
table: {
|
|
10
|
+
defaultValue: {
|
|
11
|
+
summary: string;
|
|
12
|
+
};
|
|
13
|
+
type: {
|
|
14
|
+
summary: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
ontologyId: {
|
|
19
|
+
required: boolean;
|
|
20
|
+
description: string;
|
|
21
|
+
table: {
|
|
22
|
+
defaultValue: {
|
|
23
|
+
summary: string;
|
|
24
|
+
};
|
|
25
|
+
type: {
|
|
26
|
+
summary: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export declare const EntityProviderWidgetStoryArgs: {
|
|
32
|
+
readonly api: "https://terminology.services.base4nfdi.de/api-gateway/ols4/api/";
|
|
33
|
+
readonly iri: "";
|
|
34
|
+
readonly ontologyId: "";
|
|
35
|
+
readonly enabled: true;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* An entity that resolves in voc4cat via the TS4NFDI API Gateway. At the time of writing
|
|
39
|
+
* the gateway serves it through Skosmos, but which provider answers is a
|
|
40
|
+
* property of the API Gateway configuration and may change - the story renders
|
|
41
|
+
* whatever the API reports rather than asserting a specific provider.
|
|
42
|
+
*/
|
|
43
|
+
export declare const withOntologyIdArgs: {
|
|
44
|
+
readonly api: "https://terminology.services.base4nfdi.de/api-gateway/ols4/api/";
|
|
45
|
+
readonly ontologyId: "voc4cat";
|
|
46
|
+
readonly iri: "https://w3id.org/nfdi4cat/voc4cat_0000151";
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* An IRI that does not exist in the requested ontology. The API answers with an
|
|
50
|
+
* empty `elements` array, which is not an error: `provider` stays undefined
|
|
51
|
+
* while `isSuccess` becomes true.
|
|
52
|
+
*/
|
|
53
|
+
export declare const notFoundArgs: {
|
|
54
|
+
readonly api: "https://terminology.services.base4nfdi.de/api-gateway/ols4/api/";
|
|
55
|
+
readonly ontologyId: "voc4cat";
|
|
56
|
+
readonly iri: "http://purl.obolibrary.org/obo/NCIT_C2985";
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Nothing is fetched while `enabled` is false, so the hook stays idle. Lets an
|
|
60
|
+
* application mount the hook before an IRI has been selected.
|
|
61
|
+
*/
|
|
62
|
+
export declare const disabledArgs: {
|
|
63
|
+
readonly api: "https://terminology.services.base4nfdi.de/api-gateway/ols4/api/";
|
|
64
|
+
readonly ontologyId: "voc4cat";
|
|
65
|
+
readonly iri: "https://w3id.org/nfdi4cat/voc4cat_0000151";
|
|
66
|
+
readonly enabled: false;
|
|
67
|
+
};
|
|
68
|
+
export declare const commonEntityProviderWidgetPlay: ({ canvasElement, }: {
|
|
69
|
+
canvasElement: HTMLElement;
|
|
70
|
+
}) => Promise<void>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { EntityProvider, EntityProviderWidgetProps } from '../../../app/types';
|
|
2
|
+
export type GetEntityProviderParams = Omit<EntityProviderWidgetProps, "enabled">;
|
|
3
|
+
/**
|
|
4
|
+
* Maps the `provider` block of a single entity from an OLS4 `elements` array to
|
|
5
|
+
* an {@link EntityProvider}. Returns undefined if the entity carries no
|
|
6
|
+
* provider information, which is the case for every non-gateway OLS instance.
|
|
7
|
+
*/
|
|
8
|
+
export declare function parseEntityProvider(element: any): EntityProvider | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Queries the `/entities` endpoint and returns the resolved entities together
|
|
11
|
+
* with their parsed providers, keeping both aligned so that the defining
|
|
12
|
+
* ontology can still be identified afterwards.
|
|
13
|
+
*/
|
|
14
|
+
declare function fetchEntityProviders(params: GetEntityProviderParams, abortSignal?: AbortSignal): Promise<{
|
|
15
|
+
element: any;
|
|
16
|
+
provider: EntityProvider;
|
|
17
|
+
}[]>;
|
|
18
|
+
/**
|
|
19
|
+
* Returns the provider of the entity in its defining ontology, or the first one
|
|
20
|
+
* if no occurrence is marked as defining. Mirrors the preference rule of
|
|
21
|
+
* `getPreferredOntologyJSON` in `model/ols-model/ModelObjectCreator.ts`.
|
|
22
|
+
*/
|
|
23
|
+
declare function pickPreferredProvider(entries: {
|
|
24
|
+
element: any;
|
|
25
|
+
provider: EntityProvider;
|
|
26
|
+
}[]): EntityProvider | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* Fetches provider information for an entity from the `/entities` endpoint of an
|
|
29
|
+
* OLS4 API, without requiring React.
|
|
30
|
+
*
|
|
31
|
+
* As one IRI can resolve in several ontologies, each potentially served by a
|
|
32
|
+
* different provider, this returns one entry per ontology the IRI was found in.
|
|
33
|
+
* Providing an `ontologyId` restricts the result to that single ontology.
|
|
34
|
+
*
|
|
35
|
+
* Returns an empty array if the entity could not be resolved, or if the API
|
|
36
|
+
* reports no provider information (i.e. it is not the TS4NFDI API Gateway).
|
|
37
|
+
* Only genuine request failures reject.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* const providers = await getEntityProviders({
|
|
41
|
+
* ontologyId: "voc4cat",
|
|
42
|
+
* iri: "https://w3id.org/nfdi4cat/voc4cat_0000151",
|
|
43
|
+
* });
|
|
44
|
+
*/
|
|
45
|
+
export declare function getEntityProviders(params: GetEntityProviderParams, abortSignal?: AbortSignal): Promise<EntityProvider[]>;
|
|
46
|
+
/**
|
|
47
|
+
* Convenience wrapper around {@link getEntityProviders} returning a single
|
|
48
|
+
* provider: the one of the defining ontology, or of the first occurrence if
|
|
49
|
+
* none is marked as defining. Undefined if the entity could not be resolved or
|
|
50
|
+
* carries no provider information.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* const provider = await getEntityProvider({
|
|
54
|
+
* ontologyId: "voc4cat",
|
|
55
|
+
* iri: "https://w3id.org/nfdi4cat/voc4cat_0000151",
|
|
56
|
+
* });
|
|
57
|
+
* console.log(provider?.name); // "tib"
|
|
58
|
+
*/
|
|
59
|
+
export declare function getEntityProvider(params: GetEntityProviderParams, abortSignal?: AbortSignal): Promise<EntityProvider | undefined>;
|
|
60
|
+
export { fetchEntityProviders, pickPreferredProvider };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { EntityProviderWidgetProps, UseEntityProviderResult } from '../../../app';
|
|
2
|
+
/**
|
|
3
|
+
* React hook returning information about the terminology provider that specifies
|
|
4
|
+
* an entity, as reported by the `provider` block of the TS4NFDI API Gateway.
|
|
5
|
+
*
|
|
6
|
+
* Deliberately implemented without `react-query`, so that it can be dropped
|
|
7
|
+
* into any React application without having to mount a `QueryClientProvider`.
|
|
8
|
+
* In-flight requests are aborted when the inputs change or the component
|
|
9
|
+
* unmounts.
|
|
10
|
+
*
|
|
11
|
+
* Note that an entity which cannot be resolved is not an error: `provider` is
|
|
12
|
+
* then undefined, `providers` is empty, and `isSuccess` is true.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* const { provider, isLoading } = useEntityProvider({
|
|
16
|
+
* ontologyId: "voc4cat",
|
|
17
|
+
* iri: "https://w3id.org/nfdi4cat/voc4cat_0000151",
|
|
18
|
+
* });
|
|
19
|
+
* if (!isLoading) console.log(provider?.name);
|
|
20
|
+
*/
|
|
21
|
+
export declare function useEntityProvider(props: EntityProviderWidgetProps): UseEntityProviderResult;
|
|
@@ -2,6 +2,7 @@ export * from './AutocompleteWidget';
|
|
|
2
2
|
export * from './DataContentWidget';
|
|
3
3
|
export * from './EntityInfoWidget';
|
|
4
4
|
export * from './EntityListWidget';
|
|
5
|
+
export * from './EntityProviderWidget';
|
|
5
6
|
export * from './EntityRelationsWidget';
|
|
6
7
|
export * from './GraphViewWidget';
|
|
7
8
|
export * from './JsonApiWidget';
|