new AttributeType()
Represents a type of attributes
Extends
Methods
addSupertype(type)
Add a supertype
Name | Type | Description |
---|---|---|
type | Type or internal name |
- Inherited From
If the argument is not a valid supertype
If the argument cannot be added as supertype
If adding the type is not allowed
If no write transaction is active
addTranslatedLanguage()
adds the language to the set of possible translations for this attribute
If an invalid language was specified
If no write transaction is active
allInstances() → {Array.<$k.Instance>}
Returns all instances of this type and all subtypes. Avoid using this function if possible, use queries instead
- Inherited From
- Type:
- Array.<$k.Instance>
allowsMultipleOccurrences() → {boolean}
Returns true if multiple occurrences per semantic element are possible
- Inherited From
- Type:
- boolean
allSubtypes() → {Array.<$k.Type>}
Returns all subtypes
- Inherited From
- Type:
- Array.<$k.Type>
allSupertypes() → {Array.<$k.Type>}
Returns all supertypes
- Inherited From
- Type:
- Array.<$k.Type>
attribute(type) → {$k.Attribute}
Returns the attribute of the type (including sub-attributes), or undefined if no attribute exists
Name | Type | Description |
---|---|---|
type | AttributeType or internal name |
- Inherited From
If there is more than one attribute of this type
- Type:
- $k.Attribute
attributes(typeopt) → {Array.<$k.Attribute>}
Returns all attributes of the type (including sub-attributes). Returns all attributes if the type is undefined
Name | Type | Attributes | Description |
---|---|---|---|
type | <optional> | AttributeType or internal name or undefined |
- Inherited From
If type is not an attribute
- Type:
- Array.<$k.Attribute>
attributeValue(type, languageopt)
Returns the value of the attribute, or undefined if there is no such attribute
Name | Type | Attributes | Description |
---|---|---|---|
type | AttributeType or internal name | ||
language | string | <optional> | Either an ISO 639-1 or ISO 639-2B language code (e.g. "en" or "eng"), or a locale name without encoding (e.g. "en_US"). Locale names and language codes are not interchangeable, e.g. the values for "de" and "de_DE" are separated. If not defined, the locale/language of the process will be used. Ignored if the attribute is not translated. |
- Inherited From
If there is more than one attribute of this type
The value of the attribute
attributeValueString(type, languageopt) → {string}
Returns the value string of the attribute, or undefined if there is no such attribute
Name | Type | Attributes | Description |
---|---|---|---|
type | AttributeType or internal name | ||
language | string | <optional> | Either an ISO 639-1 or ISO 639-2B language code (e.g. "en" or "eng"), or a locale name without encoding (e.g. "en_US"). Locale names and language codes are not interchangeable, e.g. the values for "de" and "de_DE" are separated. If not defined, the locale/language of the process will be used. Ignored if the attribute is not translated. |
- Since
- 4.1.0
- Inherited From
If there is more than one attribute of this type
The value string of the attribute
- Type:
- string
baseUnit(domainopt) → {$k.Unit}
Name | Type | Attributes | Description |
---|---|---|---|
domain | $k.Domain | <optional> | The domain for which the base unit should be determined. |
- Since
- 5.4.2
The base unit for attributes of this type or undefined, when there is no base unit or multiple base units and no domain is given.
- Type:
- $k.Unit
callBehaviour(method, argsopt)
Calls an internal behavior method
Name | Type | Attributes | Description |
---|---|---|---|
method | string | Name of the method | |
args | Array.<object> | <optional> | Arguments of the call |
- Inherited From
When the behavior method raises an exception
canCreateExtensions() → {boolean}
Returns true if instances of this type can be created as extensions of instances. Only either canCreateExtensions() or canCreateInstances() can be true. isAbstract() is true if neither canCreateExtensions() nor canCreateInstances() is true.
- Inherited From
- Type:
- boolean
canCreateInstances() → {boolean}
Returns true if instances / properties of this type can be created. Only either canCreateExtensions() or canCreateInstances() can be true. isAbstract() is true if neither canCreateExtensions() nor canCreateInstances() is true.
- Inherited From
- Type:
- boolean
changeLog() → {Array.<object>}
Get the change log object of this SemanticElement as object
- Inherited From
A list of change log entries, each an conforming the below schema. Null if no change log is present for the SemanticElement.
{ "$schema" : "http://json-schema.org/draft-04/schema#", "type" : "object", "properties" : { "tag" : { "type" : "string", "enum" : ["AttributeEvent", "RelationEvent"], "description" : "is this a change for an attribute or a relation" }, "type" : { "type" : "string", "enum" : ["modify", "create", "delete", "executeMapping"], "description" : "what kind of change is logged in this event" }, "timestamp" : { "type" : "string", "description" : "time of the change; format: ISO 8601 timestamp string without timezone", }, "topic" : { "type" : "object", "description" : "id and label of the changed object", "properties" : { "label" : { "type" : "string" }, "id" : { "type" : "string" } } }, "user" : { "type" : "object", "description" : "id and name of the user object which performed the change", "properties" : { "label" : { "type" : "string" }, "id" :{ "type" : "string" } } }, "property" : { "type" : "object", "description" : "id and label of the changed property type", "properties" : { "conceptId" : { "type" : "string" }, "label" : { "type" : "string" } } }, "value" : { "type" : "string", "description" : "string representation of the new value" }, "language" : { "type" : "string", "description" : "language of the changed value; format: ISO639 3-letter code" }, "oldValue" : { "type" : "string", "description" : "string representation of the previous value" }, "target" : { "type" : "object", "description" : "id and label of the relation target object", "properties" : { "id" : { "type" : "string" }, "label" : { "type" : "string" } } }, "required" : [ "type", "tag", "timestamp", "topic" ] } }
- Type:
- Array.<object>
core() → {$k.SemanticElement}
Returns the extended element, if this is an extension. Returns the element itself otherwise
- Inherited From
- Type:
- $k.SemanticElement
createAttribute(type, value, languageopt) → {$k.Attribute}
Creates a new attribute with the given value
Name | Type | Attributes | Description |
---|---|---|---|
type | AttributeType or internal name | ||
value | Value of the attribute. Pass undefined for attribute types without value. | ||
language | string | <optional> | Either an ISO 639-1 or ISO 639-2B language code (e.g. "en" or "eng"), or a locale name without encoding (e.g. "en_US"). Locale names and language codes are not interchangeable, e.g. the values for "de" and "de_DE" are separated. If not defined, the locale/language of the process will be used. Ignored if the attribute is not translated. |
- Inherited From
If the value is not in the range of allowed values of the attribute
If type is not a possible attribute of the element, or if no additional attributes can be created, or if language is not declared in attribute schema.
If there is more than one attribute of this type
If creating an attribute is not allowed
If no write transaction is active
- Type:
- $k.Attribute
person.createAttribute("alias", "Tester");
createAttributeFromString(type, valueString, languageopt) → {$k.Attribute}
Creates a new attribute and set the value from the string representation
Name | Type | Attributes | Description |
---|---|---|---|
type | AttributeType or internal name | ||
valueString | string | String represantation of the value | |
language | string | <optional> | Either an ISO 639-1 or ISO 639-2B language code (e.g. "en" or "eng"), or a locale name without encoding (e.g. "en_US"). Locale names and language codes are not interchangeable, e.g. the values for "de" and "de_DE" are separated. If not defined, the locale/language of the process will be used. Ignored if the attribute is not translated. |
- Inherited From
- Deprecated
- Use
setAttributeValue($k.ValueString(valueString), language)
instead
- Use
If the value is not in the range of allowed values of the attribute
If type is not a possible attribute of the element, or if no additional attributes can be created, or if language is not declared in attribute schema.
If there is more than one attribute of this type
If creating an attribute is not allowed
If no write transaction is active
- Type:
- $k.Attribute
person.createAttributeFromString("dateOfBirth", "2.3.1968", "de");
createRelation(type, target, inverseopt) → {$k.Relation}
Creates a new relation
Name | Type | Attributes | Description |
---|---|---|---|
type | RelationType or internal name | ||
target | $k.SemanticElement | The relation target. | |
inverse | <optional> | RelationType or internal name of the inverse Relation. The default inverse relation type will be used if this parameter is undefined. |
- Inherited From
If type is not a possible relation of the element, or if no additional relations can be created.
If creating a relation is not allowed
If no write transaction is active
- Type:
- $k.Relation
defaultLanguage() → {string}
Returns the language that is used when no language is specified (e.g. attributeValue()
). The language is undefined if the attribute is not translated
- Since
- 5.6.1
Language code (e.g. "eng" or "de_DE")
- Type:
- string
definedDomains() → {Array.<$k.Domain>}
Returns the defined domains of the property.
- Inherited From
- Type:
- Array.<$k.Domain>
domain() → {$k.Domain}
Returns the domain of the instances of this type
- Inherited From
- Type:
- $k.Domain
domains() → {Array.<$k.Domain>}
Returns the effective domains of the property.
- If the property is defined as mixin, extended domains are substituted by all possible extensions.
- Domains that are sub-domains of other domains are discarded.
- If the domain is a relation, and symmetric properties are enabled, all possible inverse relations are also included.
- Inherited From
- Type:
- Array.<$k.Domain>
element() → {$k.SemanticElement}
Returns this element. Allows to send element() either to a $k.Hit or a semantic element
- Since
- 4.3.0
- Inherited From
- Type:
- $k.SemanticElement
elementAtValue(value, languageopt) → {$k.SemanticElement}
Returns the semantic element with an attribute of this type with the specified value, or undefined if there is either no such attribute or more than one
Name | Type | Attributes | Description |
---|---|---|---|
value | The value to search for | ||
language | string | <optional> | Either an ISO 639-1 or ISO 639-2B language code (e.g. "en" or "eng"), or a locale name without encoding (e.g. "en_US"). Locale names and language codes are not interchangeable, e.g. the values for "de" and "de_DE" are separated. If not defined, the locale/language of the process will be used. Ignored if the attribute is not translated. |
If the value is not in the range of allowed values of the attribute
- Type:
- $k.SemanticElement
elementsAtValue(value, languageopt) → {Array.<$k.SemanticElement>}
Returns all semantic elements with attributes of this types with the specified value
Name | Type | Attributes | Description |
---|---|---|---|
value | The value to search for | ||
language | string | <optional> | Either an ISO 639-1 or ISO 639-2B language code (e.g. "en" or "eng"), or a locale name without encoding (e.g. "en_US"). Locale names and language codes are not interchangeable, e.g. the values for "de" and "de_DE" are separated. If not defined, the locale/language of the process will be used. Ignored if the attribute is not translated. |
If the value is not in the range of allowed values of the attribute
- Type:
- Array.<$k.SemanticElement>
ensureAttributeValue(type, value, languageopt) → {$k.Attribute}
Returns an existing attribute with the given value. Otherwise creates and returns an additional attribute with the given value, or returns an existing attribute with modified value if the schema does not allow multiple occurrences.
Name | Type | Attributes | Description |
---|---|---|---|
type | AttributeType or internal name | ||
value | The value that should be set. | ||
language | string | <optional> | Either an ISO 639-1 or ISO 639-2B language code (e.g. "en" or "eng"), or a locale name without encoding (e.g. "en_US"). Locale names and language codes are not interchangeable, e.g. the values for "de" and "de_DE" are separated. If not defined, the locale/language of the process will be used. Ignored if the attribute is not translated. |
- Since
- 4.3.0
- Inherited From
If the value is not in the range of allowed values of the attribute
If an invalid language was specified
If type is not a possible attribute of the element, or if language is not declared in attribute schema
If modifying is not allowed
If no write transaction is active
- Type:
- $k.Attribute
ensureRelationTarget(type, target, inverseopt) → {$k.Relation}
Returns a existing relation to the target. Otherwise creates and returns an additional relation to the target, or returns an existing relation relocateded to the target if the schema does not allow multiple occurrences
Name | Type | Attributes | Description |
---|---|---|---|
type | RelationType or internal name | ||
target | $k.SemanticElement | The relation target. | |
inverse | <optional> | RelationType or internal name of the inverse Relation. Only applies, if a new relation will be created. The default inverse relation type will be used if this parameter is undefined. |
- Since
- 4.3.0
- Inherited From
If type is not a possible relation of the element, or if no additional relations can be created.
If creating a relation is not allowed
If no write transaction is active
If deleting the existing relation is not possible
- Type:
- $k.Relation
estimatedNumberOfInstances() → {number}
Returns the estimated number of instances of this type
- Inherited From
- Type:
- number
getCounter() → {number}
Returns the value of the counter associated with this type.
- Inherited From
- Type:
- number
hasPossibleAttribute(type) → {boolean}
Returns true if the type is a possible attribute of this element
Name | Type | Description |
---|---|---|
type | AttributeType or internal name |
- Inherited From
- Type:
- boolean
hasPossibleRelation(type) → {boolean}
Returns true if the type is a possible relation of this element
Name | Type | Description |
---|---|---|
type | RelationType or internal name |
- Inherited From
- Type:
- boolean
hasTranslatedValues() → {boolean}
True if the attributes have translated values
- Type:
- boolean
icon(sizeopt, languageopt) → {blob}
Returns the icon of the element as blob
Name | Type | Attributes | Description |
---|---|---|---|
size | array | <optional> | Size of icon as array |
language | string | <optional> | Either an ISO 639-1 or ISO 639-2B language code (e.g. "en" or "eng"), or a locale name without encoding (e.g. "en_US"). Locale names and language codes are not interchangeable, e.g. the values for "de" and "de_DE" are separated. If not defined, the locale/language of the process will be used. Ignored if the attribute is not translated. |
- Since
- 4.1.0
- Inherited From
- Type:
- blob
iconAttribute(sizeopt, languageopt) → {attribute}
Returns the icon of the element as blob attribute
Name | Type | Attributes | Description |
---|---|---|---|
size | array | <optional> | Size of icon as array |
language | string | <optional> | Either an ISO 639-1 or ISO 639-2B language code (e.g. "en" or "eng"), or a locale name without encoding (e.g. "en_US"). Locale names and language codes are not interchangeable, e.g. the values for "de" and "de_DE" are separated. If not defined, the locale/language of the process will be used. Ignored if the attribute is not translated. |
- Since
- 5.3.0
- Inherited From
- Type:
- attribute
idNumber()
- Inherited From
- Deprecated
- Use idString() instead
- See
- idString
idString() → {string}
Returns the element ID as string (ID123_456). Returns undefined for non-persistent elements (system relations etc.)
- Inherited From
- Type:
- string
increaseCounter() → {number}
Increases and returns the value of the counter associated with this type. The counter can be increased concurrently.
- Inherited From
- Type:
- number
inheritedAttribute(type) → {$k.Attribute}
Returns the own attribute or the inherited attribute of the supertype(s). If there is more than one supertype, the attribute must be unique. If this is not a type, then this function is equivalent to attribute().
Name | Type | Description |
---|---|---|
type | AttributeType or internal name |
- Inherited From
If there is more than one value of this type
The inherited attribute, or undefined if there is no attribute
- Type:
- $k.Attribute
inheritedAttributeValue(type, languageopt)
Returns the value of the own attribute or of the inherited value of the supertype(s). If there is more than one supertype, the value must be unique. If this is not a type, then this function is equivalent to attribute(value).
Name | Type | Attributes | Description |
---|---|---|---|
type | AttributeType or internal name | ||
language | string | <optional> | Either an ISO 639-1 or ISO 639-2B language code (e.g. "en" or "eng"), or a locale name without encoding (e.g. "en_US"). Locale names and language codes are not interchangeable, e.g. the values for "de" and "de_DE" are separated. If not defined, the locale/language of the process will be used. Ignored if the attribute is not translated. |
- Inherited From
If there is more than one value of this type
The inherited value, or undefined if there is no attribute
instances() → {Array.<$k.Instance>}
Returns all direct instances of this type. Avoid using this function if possible, use queries instead
- Inherited From
- Type:
- Array.<$k.Instance>
internalName() → {string}
Returns the internal name
- Inherited From
- Type:
- string
intrafindConvertAndTagDocument(urlopt) → {object}
Converts a document blob or URL located document to an object containing metadata and tags using intrafinds API functions
Name | Type | Attributes | Description |
---|---|---|---|
url | string | <optional> | Url to convert a document from instead of the semantic element this function was called for |
- Inherited From
If the configuration is missing or incomplete
- Type:
- object
intrafindConvertDocument(urlopt) → {object}
Converts a document blob or URL located document to an object containing the meta data using intrafinds API functions
Name | Type | Attributes | Description |
---|---|---|---|
url | string | <optional> | Url to convert a document from instead of the semantic element this function was called for |
- Inherited From
If the configuration is missing or incomplete
- Type:
- object
isAbstract() → {boolean}
Returns true if this is an abstract type (cannot create properties/instances/extensions). isAbstract() is true if neither canCreateExtensions() nor canCreateInstances() is true.
- Inherited From
- Type:
- boolean
isInvalid() → {boolean}
True if the semantic element was deleted (e.g. by a rollback or remove()
- Inherited From
- Type:
- boolean
isKindOf(type) → {boolean}
Returns true if this is equal to or a direct or indirect type of the other type
Name | Type | Description |
---|---|---|
type | Type or internal name |
- Inherited From
If the argument is not a type
If the argument is an unknown internal name
- Type:
- boolean
kPathEvaluate(pathString)
Name | Type | Description |
---|---|---|
pathString |
- Inherited From
locatorString(locatorTypesopt) → {string}
Returns the element locator as string
Name | Type | Attributes | Description |
---|---|---|---|
locatorTypes | array | <optional> |
- Since
- 4.0.2
- Inherited From
- Type:
- string
maxOccurrencesGuideline() → {number}
Returns max occurrences guideline of property type definition
- Inherited From
- Type:
- number
minOccurrencesGuideline() → {number}
Returns min occurrences guideline of property type definition
- Inherited From
- Type:
- number
modificationNumber() → {number}
Returns the modification number for the cluster conatining as 64 bit integer. Returns 0 for newly created topics that are not yet assigned to a cluster. Returns undefined for non-persistent elements (system relations etc.). An unchanged modification number indicates that the element is unchanged. A changed modification number does not necessarily indicate that the topic changed, because there might have been changes in other objects contained in the same cluster.
- Inherited From
- Type:
- number
name(languageopt) → {string}
Returns the name of the element
Name | Type | Attributes | Description |
---|---|---|---|
language | string | <optional> | Either an ISO 639-1 or ISO 639-2B language code (e.g. "en" or "eng"), or a locale name without encoding (e.g. "en_US"). Locale names and language codes are not interchangeable, e.g. the values for "de" and "de_DE" are separated. If not defined, the locale/language of the process will be used. Ignored if the attribute is not translated. |
- Inherited From
- Type:
- string
numberOfInstances() → {number}
Returns the exact number of instances of this type
- Inherited From
- Type:
- number
openInKnowledgeBuilder(user)
Name | Type | Description |
---|---|---|
user | $k.User |
- Version
- Experimental feature, might be removed at any time
- Inherited From
possibleProperties(filteropt) → {Array.<$k.PropertyType>}
Returns the possible properties of this element.
Name | Type | Attributes | Description |
---|---|---|---|
filter | string | $k.PropertyFilter | <optional> | Optional filter that defines which properties are returned |
- Inherited From
- Type:
- Array.<$k.PropertyType>
// Possible properties, excluding shortcut / system relations
possibleProperties();
// Possible properties, including system relations
possibleProperties($k.PropertyFilter.setSystemRelations());
// Same as above, using a literal object to define the filter
possibleProperties({ systemRelations: true });
primaryCore() → {$k.SemanticElement}
Returns the primary element.
- if the receiver is an instance or type, then the receiver itself is returned.
- if the receiver is an extension, then the extended instance is returned.
- if the receiver is a property, then the primary core of the source is returned.
- Since
- 4.2.0
- Inherited From
- Type:
- $k.SemanticElement
properties(filteropt) → {Array.<$k.Property>}
Returns all properties of the property type
Name | Type | Attributes | Description |
---|---|---|---|
filter | string | $k.PropertyFilter | <optional> | Filter that defines which properties are returned |
- Inherited From
- Type:
- Array.<$k.Property>
// All properties
properties();
// All relations with internal name "contains", including sub-relations
properties(new $k.PropertyFilter().setType("contains"));
// All relations with internal name "contains", without sub-relations
properties(new $k.PropertyFilter().setExact().setType("contains"));
// Same as above, using a literal object to define the filter
properties({ exact: true, type: "contains" });
relation(type) → {$k.Relation}
Returns the relation of the type (including sub-relations), or undefined if no relation exists
Name | Type | Description |
---|---|---|
type | RelationType or internal name |
- Inherited From
If type is not a possible relation of the topic
If type is not a relation type
If there is more than one relation of this type
- Type:
- $k.Relation
relations(typeopt) → {Array.<$k.Relation>}
Returns all relations of the type (including sub-relations). If type is undefined, all user relations (excluding inverse one way relations) are returned.
Name | Type | Attributes | Description |
---|---|---|---|
type | <optional> | RelationType or internal name or undefined |
- Inherited From
If type is not a relation type
- Type:
- Array.<$k.Relation>
relationTarget(type) → {$k.SemanticElement}
Returns the target of the relation of the relation type, or undefined if there is no such relation
Name | Type | Description |
---|---|---|
type | RelationType or internal name |
- Inherited From
If there is more than one relation of this type
If type is not a relation type
- Type:
- $k.SemanticElement
relationTargets(type) → {Array.<$k.SemanticElement>}
Returns the targets of the relations of the relation type. Each target is only returned once, even if multiple relations point to the same target. Returns all relation targets if the type is undefined
Name | Type | Description |
---|---|---|
type | RelationType or internal name or undefined |
- Inherited From
If type is not a relation type
- Type:
- Array.<$k.SemanticElement>
remove()
Deletes the element and all attached properties
- Inherited From
If deleting the element or any property not allowed
If deleting the element is not possible, e.g. when trying to delete a system element
removeProperties(filteropt)
Removes all properties of the property type
Name | Type | Attributes | Description |
---|---|---|---|
filter | string | $k.PropertyFilter | <optional> | Filter that defines which properties are removed |
- Since
- 5.4.0
- Inherited From
If deleting one of the properties is not allowed
removeSupertype()
Remove a supertype
- Inherited From
If the argument is not a valid supertype
If removing the type is not allowed
If no write transaction is active
render(contextopt, keyFilteropt, detailFilteropt) → {object}
Renders the element as a literal object using the associated view configuration. Uses the optional context topic to detect a suitable configuration
Name | Type | Attributes | Description |
---|---|---|---|
context | object | <optional> | Element that defines the context. |
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() |
- Inherited From
The rendered object
- Type:
- object
renderJSON(contextopt, excludedKeysopt, detailFilteropt) → {object}
Render the element as a JavaScript object using the associated view configuration. Uses the optional context topic to detect a suitable configuration
Name | Type | Attributes | Description |
---|---|---|---|
context | $k.SemanticElement | <optional> | Element that defines the context. |
excludedKeys | Array.<string> | <optional> | Collection of property names that are excluded |
detailFilter | object | <optional> | Only used if the key filter is not a $k.JSONRenderContext. See $k.JSONRenderContext.prototype.setLevelsOfDetail() |
- Inherited From
- Deprecated
- Use
render(context, {"exclude": excludedKeys})
instead
- Use
The rendered JSON object
- Type:
- object
renderTemplate(template, entity, conversionopt, variablesopt)
Render a document based on a given print template
Name | Type | Attributes | Description |
---|---|---|---|
template | $k.SemanticElement | the template that will be applied | |
entity | $k.NetEntity | The render target | |
conversion | $k.SemanticElement | <optional> | The semantic element representing the document conversion |
variables | object | <optional> | Additional variables to pass to the template |
- Since
- 4.4.0
- Inherited From
When the element could not be rendered
schemaReportOn(context)
Name | Type | Description |
---|---|---|
context | A $k.XMLWriter |
- Inherited From
- Deprecated
- This function is deprecated and might be removed in future releases
setAttributeFromString(type, valueString, languageopt)
Sets the value of the attribute from the string representation. Creates a new attribute if no such attribute exists
Name | Type | Attributes | Description |
---|---|---|---|
type | AttributeType or internal name | ||
valueString | string | String represantation of the value | |
language | string | <optional> | Either an ISO 639-1 or ISO 639-2B language code (e.g. "en" or "eng"), or a locale name without encoding (e.g. "en_US"). Locale names and language codes are not interchangeable, e.g. the values for "de" and "de_DE" are separated. If not defined, the locale/language of the process will be used. Ignored if the attribute is not translated. |
- Inherited From
- Deprecated
- Use
setAttributeValue(type, $k.ValueString(valueString), language)
instead
- Use
If the value is not in the range of allowed values of the attribute
If an invalid language was specified
If type is not a possible attribute of the element, or if language is not declared in attribute schema
If there is more than one attribute of this type
If modifying is not allowed
If no write transaction is active
setAttributeValue(type, value, languageopt)
Sets the value of the attribute. Creates a new attribute if no such attribute exists
Name | Type | Attributes | Description |
---|---|---|---|
type | AttributeType or internal name | ||
value | The value that should be set. | ||
language | string | <optional> | Either an ISO 639-1 or ISO 639-2B language code (e.g. "en" or "eng"), or a locale name without encoding (e.g. "en_US"). Locale names and language codes are not interchangeable, e.g. the values for "de" and "de_DE" are separated. If not defined, the locale/language of the process will be used. Ignored if the attribute is not translated. |
- Inherited From
If the value is not in the range of allowed values of the attribute
If type is not a possible attribute of the element, or if language is not declared in attribute schema
If an invalid language was specified
If there is more than one attribute of this type
If modifying is not allowed
If no write transaction is active
setCanCreateExtensions(canCreate)
Set to true if it should be possible to extend other instances with instances of this tyoe. The flag cannot be set to false if extensions exist. Only either canCreateExtensions() or canCreateInstances() can be true.
Name | Type | Description |
---|---|---|
canCreate | boolean |
- Inherited From
If it is not possible to change the schema, e.g. when the type already allows to create instances
setCanCreateInstances(canCreate)
Set to true if it should be possible to create instances / properties this type. The flag cannot be set to false if instances exist. Only either canCreateExtensions() or canCreateInstances() can be true.
Name | Type | Description |
---|---|---|
canCreate | boolean |
- Inherited From
If it is not possible to change the schema, e.g. when the type already allows to create extensions
setCounter(counterValue) → {number}
Set the initial value of the counter associated with this type. Note: this cannot be done concurrently. Use increaseCounter() instead.
Name | Type | Description |
---|---|---|
counterValue | number | Must be an integer |
- Inherited From
The counter value
- Type:
- number
setInternalName(name)
Sets the internal name, or removes the internal name if null is passed
Name | Type | Description |
---|---|---|
name | New internal name or null |
- Inherited From
If the argument is not a valid internal name
If modifying the type is not allowed
If the internal name is not unique
If no write transaction is active
setName(name, languageopt)
Sets the name of the element
Name | Type | Attributes | Description |
---|---|---|---|
name | string | The name | |
language | string | <optional> | Either an ISO 639-1 or ISO 639-2B language code (e.g. "en" or "eng"), or a locale name without encoding (e.g. "en_US"). Locale names and language codes are not interchangeable, e.g. the values for "de" and "de_DE" are separated. If not defined, the locale/language of the process will be used. Ignored if the attribute is not translated. |
- Inherited From
If the name is not a string
If no write transaction is active
If an invalid language was specified
If language is not declared in name attribute schema
setRelationTarget(type, target, inverseopt)
Sets the target of the relation. Creates a new relation if no such relation exists
Name | Type | Attributes | Description |
---|---|---|---|
type | RelationType or internal name | ||
target | $k.SemanticElement | The relation target. | |
inverse | <optional> | RelationType or internal name of the inverse Relation. Only applies, if a new relation will be created. The default inverse relation type will be used if this parameter is undefined. |
- Since
- 4.3.0
- Inherited From
If type is not a possible relation of the element, or if no additional relations can be created.
If there is more than one relation of this type
If creating a relation is not allowed
If no write transaction is active
If deleting the existing relation is not possible
subtypes() → {Array.<$k.Type>}
Returns the direct subtypes
- Inherited From
- Type:
- Array.<$k.Type>
supertypes() → {Array.<$k.Type>}
Returns the direct supertypes
- Inherited From
- Type:
- Array.<$k.Type>
translatedLanguages() → {Array.<string>}
Returns the possible translated languages as 3-letter codes (ISO639 2b). Empty if the attribute is not translated
- Type:
- Array.<string>
type() → {$k.Type}
Returns the type of the element. If the topic is a type, the type itself is returned
- Inherited From
- Type:
- $k.Type
typeDomain() → {$k.Domain}
Returns the domain that represents this type and its subtype
- Inherited From
- Type:
- $k.Domain
updateMapping()
Update the prototype after sending $k.mapInstances(). Only required if this element was referenced before setting the mapping.
- Inherited From
valueRange() → {$k.ValueRange}
Returns the range of the values of the attributes
- Type:
- $k.ValueRange