Constructor
new $k.GQLQuery(sourceopt)
Constructs a GQL query
| Name | Type | Attributes | Description |
|---|---|---|---|
source | string | <optional> | The query source |
- Since
- 6.1.0
Extends
Methods
definedParameters() → {Array.<$k.QueryParameter>}
Returns the parameters of the query
- Since
- 4.0.0
- Inherited From
- Type:
- Array.<$k.QueryParameter>
deregister()
Deregisters the element. The ID will be undefined afterwards. Equivalent to setId(undefined)
- Inherited From
- See
- setId
jsDocNoAdminRights
explainElements(elements, parametersopt) → {Array.<$k.SemanticElement>}
Returns elements involved in the query
| Name | Type | Attributes | Description |
|---|---|---|---|
elements | Array.<$k.SemanticElement> | Elements to explain. Elements that do not match the query are ignored. | |
parameters | object | <optional> | The parameters object where the keys match the names of parameters defined in the query |
- Since
- 4.0.0
- Inherited From
When the query could not be solved, e.g. missing parameters
- Type:
- Array.<$k.SemanticElement>
filterElements(elements, searchStringopt, parametersopt) → {Array.<$k.SemanticElement>}
Returns all elements that match the query. The two optional parameters can be given in any order.
| Name | Type | Attributes | Description |
|---|---|---|---|
elements | Array.<$k.SemanticElement> | ||
searchString | string | <optional> | |
parameters | object | <optional> | The parameters object where the keys match the names of parameters defined in the query |
- Since
- 4.0.0
- Inherited From
When the query could not be solved, e.g. missing parameters
- Type:
- Array.<$k.SemanticElement>
var hits = $k.Registry.query("experts").filterElements(persons);findElements(searchStringopt, parametersopt) → {Array.<$k.SemanticElement>}
Search and return all found semantic elements. The two parameters can be given in any order.
| Name | Type | Attributes | Description |
|---|---|---|---|
searchString | string | <optional> | |
parameters | object | <optional> | The parameters object where the keys match the names of parameters defined in the query |
- Since
- 4.0.0
- Inherited From
When the query could not be solved, e.g. missing parameters
- Type:
- Array.<$k.SemanticElement>
var hits = $k.Registry.query("directSearch").findElements("Test");var hits = $k.Registry.query("compositeSearch").findElements("Test", { context: "portal" });findHits(searchStringopt, parametersopt) → {Array.<$k.Hit>}
Search and return all found hits. The two arguments can be given in any order.
| Name | Type | Attributes | Description |
|---|---|---|---|
searchString | string | <optional> | |
parameters | object | <optional> | The parameters object where the keys match the names of parameters defined in the query |
- Since
- 4.0.0
- Inherited From
When the query could not be solved, e.g. missing parameters
- Type:
- Array.<$k.Hit>
var hits = $k.Registry.query("directSearch").findHits("Test*");findResultSize(searchStringopt, parametersopt) → {number}
Search and return the number of found semantic elements. The two arguments can be given in any order.
| Name | Type | Attributes | Description |
|---|---|---|---|
searchString | string | <optional> | |
parameters | object | <optional> | The parameters object where the keys match the names of parameters defined in the query |
- Since
- 5.3.3
- Inherited From
When the query could not be solved, e.g. missing parameters
- Type:
- number
fullExplainElements(elements, parametersopt) → {Array.<$k.SemanticElement>}
Returns all elements involved in the query
| Name | Type | Attributes | Description |
|---|---|---|---|
elements | Array.<$k.SemanticElement> | Elements to fully explain. Elements that do not match the query are ignored. | |
parameters | object | <optional> | The parameters object where the keys match the names of parameters defined in the query |
- Since
- 4.3.1
- Inherited From
When the query could not be solved, e.g. missing parameters
- Type:
- Array.<$k.SemanticElement>
id() → {string|undefined}
Returns the registered ID, or undefined if not registered.
- Inherited From
- Type:
- string |
undefined
name() → {string}
Returns the name
- Since
- 4.0.0
- Inherited From
- Type:
- string
parentFolders() → {Array.<$k.Folder>}
Returns the folders that contain this element
- Inherited From
- Type:
- Array.<$k.Folder>
perform(parametersopt) → {$k.GQLQueryResult}
Performs the query and returns a query result object
| Name | Type | Attributes | Description |
|---|---|---|---|
parameters | object | <optional> | The parameters object where the keys match the names of parameters defined in the query |
- Version
- Experimental feature, might be removed at any time
- Since
- 6.1.0
When the query cannot be performed, e.g. missing parameters
The query result
- Type:
- $k.
GQLQueryResult
register(replaceScriptReferencesopt) → {string}
Registers the element with a private ID, if it has no registered ID yet.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
replaceScriptReferences | boolean | <optional> | false | True if ID references in scripts should be replaced. Only done when the old and the new ID is not undefined. |
- Since
- 6.1.1
- Inherited From
jsDocNoAdminRights
The registered ID
- Type:
- string
registryType() → {string}
Returns the name of the registry that contains elements of this type
- Inherited From
- Type:
- string
remove()
Deletes the element and removes it from all containing registries and folders
- Inherited From
jsDocNoAdminRights
If deleting the element is not possible, e.g. when trying to delete a system element
renderElements(tableConfiguration, keyFilteropt, detailFilteropt) → {Array.<object>}
Search and render found semantic elements using the given table configuration
| Name | Type | Attributes | Description |
|---|---|---|---|
tableConfiguration | $k. | ||
keyFilter | object | <optional> | Alternative 1 (preferred): a $k.JSONRenderContext Alternative 2 (compatibility only): A filter. See $k.JSONRenderContext.prototype.setFilters(). |
detailFilter | object | <optional> | Only used if the key filter is not a $k.JSONRenderContext. See $k.JSONRenderContext.prototype.setLevelsOfDetail() |
- Since
- 4.1.0
- Inherited From
- Deprecated
- This function is deprecated and might be removed in future releases
When the query could not be solved, e.g. missing parameters
The rendered objects
- Type:
- Array.<object>
renderHits(tableConfiguration, keyFilteropt, detailFilteropt) → {Array.<object>}
Search and render found hits using the given table configuration
| Name | Type | Attributes | Description |
|---|---|---|---|
tableConfiguration | $k. | ||
keyFilter | object | <optional> | Alternative 1 (preferred): a $k.JSONRenderContext Alternative 2 (compatibility only): A filter. See $k.JSONRenderContext.prototype.setFilters(). |
detailFilter | object | <optional> | Only used if the key filter is not a $k.JSONRenderContext. See $k.JSONRenderContext.prototype.setLevelsOfDetail() |
- Since
- 4.1.0
- Inherited From
- Deprecated
- This function is deprecated and might be removed in future releases
When the query could not be solved, e.g. missing parameters
The rendered objects
- Type:
- Array.<object>
searchString() → {string}
Returns the search string
- Since
- 4.0.0
- Inherited From
- Type:
- string
setAccessParameter(accessParameter, value)
Set a parameter of the query.
| Name | Type | Description |
|---|---|---|
accessParameter | string | One of the access parameters ("topic", "property", "accessedObject", "concept", "user" etc.) |
value | $k. | The value of the parameter. |
- Version
- Experimental feature, might be removed at any time
- Since
- 6.1.0
setDomain(domain)
Restrict the query results to objects/types of the domains
| Name | Type | Description |
|---|---|---|
domain | $k. | The domain or internal name of a type |
- Since
- 4.1.0
- Inherited From
setDomains(domains)
Restrict the query results to objects/types of the domains
| Name | Type | Description |
|---|---|---|
domains | Array.<$k.Domain> | | The domains or internal names of types |
- Since
- 4.0.0
- Inherited From
setFacetFilters(facetFiltersArray)
Set the selected facets and terms for the query
| Name | Type | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
facetFiltersArray | Array.<object> | Array with selected facets and terms Properties
|
- Since
- 5.1.3
- Inherited From
setId(id, replaceScriptReferencesopt)
Registers the element with the given ID. If the element has already been registered, the current ID will be changed to the new ID.
Deprecated option: If the given ID is undefined or null, the element will be deregistered. Use deregister() instead
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
id | string | | The ID to set | ||
replaceScriptReferences | boolean | <optional> | false | True if ID references in scripts should be replaced. Only done when the old and the new ID is not undefined. |
- Inherited From
- See
- deregister
jsDocNoAdminRights
setName()
Sets the name of the element
- Since
- 6.1.1
- Inherited From
jsDocNoAdminRights
setParameter(parameterId, value)
Set a parameter of the query.
| Name | Type | Description |
|---|---|---|
parameterId | string | The ID of the parameter |
value | The value of the parameter. The type (string etc.) depends on the parameter. |
- Version
- Experimental feature, might be removed at any time
- Since
- 6.1.0
- Overrides
When the value is not suitable for the parameter
setParameters(parameters)
Set the parameters of the query from the properties of the object
| Name | Type | Description |
|---|---|---|
parameters | object | The parameters object where the keys match the names of parameters defined in the query |
- Version
- Experimental feature, might be removed at any time
- Since
- 6.1.0
- Overrides
When a value is not a suitable parameter
setSearchString(searchString)
Set the string to search for
| Name | Type | Description |
|---|---|---|
searchString | string |
- Since
- 4.0.0
- Inherited From
setSource(source)
Sets the query source. A write transaction is required for modifying registered GQL queries.
| Name | Type | Description |
|---|---|---|
source | string | The new query source |
- Version
- Experimental feature, might be removed at any time
- Since
- 6.1.0
When this is a registered GQL query and no write transaction is active.
jsDocNoAdminRights
source() → {string}
Returns the query source
- Version
- Experimental feature, might be removed at any time
- Since
- 6.1.0
- Type:
- string