- Source:
Methods
(async) getEntryByGraphType(graphType, context, asyncCallType) → {Promise.<Entry>}
- Description:
Attempting to find one entry for a specific graph type, if multiple entries exists with the same type the returned promise fails. You may restrict to a specific context.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
graphType |
string | is the graph type for the entry to match, e.g. use {@see types#GT_USER}. |
context |
Context | restrict to finding the entry in this context |
asyncCallType |
string | the callType used when making the search. |
Throws:
Error
Returns:
- Type
- Promise.<Entry>
(async) getEntryByResourceURI(resourceURI, contextopt, asyncCallType) → {Promise.<Entry>}
- Description:
Retrieves an entry for a resource URI, note that if there are several entries that all have the same resource URI it is unclear which of these entries that are returned. Hence, only use this function if you expect there to be a single entry per resource URI.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
resourceURI |
string | is the URI for the resource. |
|
context |
Context |
<optional> |
only look for entries in this context, may be left out. |
asyncCallType |
string | the callType used when making the search. |
Throws:
Error
Returns:
- Type
- Promise.<Entry>
(async) getEntryByResourceURIDebounce(resourceURI, contextopt, asyncCallType) → {Promise.<Entry>}
- Description:
Retrieves an entry for a resource URI in a similar manner as the method getEntryByResourceURI, but with the distinction that it delays the request for a few milliseconds to allow collecting multiple requests together into a single request.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
resourceURI |
string | is the URI for the resource. |
|
context |
Context |
<optional> |
only look for entries in this context, may be left out. |
asyncCallType |
string | the callType used when making the search. |
Throws:
Error
Returns:
- Type
- Promise.<Entry>
(async) getEntryByType(typeURI, context, asyncCallType) → {Promise.<Entry>}
- Description:
Attempting to find a unique entry for a specific type, if multiple entries exists with the same type the returned promise fails. You may restrict to a specific context.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
typeURI |
string | is the rdf:type URI for the entry to match. |
context |
Context | restrict to finding the entry in this context |
asyncCallType |
string | the callType used when making the search. |
Throws:
Error
Returns:
- Type
- Promise.<Entry>
getEntryListByResourceURI(resourceURI) → {Entry}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
resourceURI |
string | is the URI for the resource. |
Returns:
- Type
- Entry
getEntryStore() → {EntryStore}
- Source:
Returns:
- Type
- EntryStore
(async) loadEntriesByResourceURIs(resourceURIs, contextopt, acceptMissing, asyncCallType) → {Promise.<Array.<Entry>>}
- Description:
Loads entries by first checking if they are in the cache, second if there are ongoing loading attempts that can be waited on and lastly loads them itself by via a solr query. Note, if too many entries are asked for at once the solr query will be divided into smaller chunks.
- Source:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
resourceURIs |
Array.<String> | array of resourceURIs to load. |
||
context |
Context |
<optional> |
only look for entries in this context, may be left out. |
|
acceptMissing |
boolean |
false
|
if true then the array returned may contain holes |
|
asyncCallType |
string | the callType used when making the search. |
Returns:
- Type
- Promise.<Array.<Entry>>
loadOnlyPublicEntries(publicRead)
- Description:
When loading entries via solr queries restrict to those marked as public. Corresponds to calling publicRead on all solr queries used internally in these help functions.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
publicRead |
boolean |
preloadEntries(ofType, context) → {Entry}
- Description:
Preload entries of a specific type. Not strictly needed, used for optimization reasons. Up to a maximum of 100 entries are preloaded.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
ofType |
string | |
context |
Context | if provided limits the preload to a specific context. |
Returns:
- Type
- Entry
(async) removeAll(list) → {Promise.<Array.<String>>}
- Description:
Removes all entries matched by a search in a serial manner, also empties the cache from loaded entries so it should not overflow if the searchlist is big.
The removal is accomplished by first iterating through the searchlist and collecting uris to all entries that should be removed. After that the entries are removed.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
list |
SearchList |
Returns:
array of uris that where deleted
- Type
- Promise.<Array.<String>>