Class: AttributeType

$k. AttributeType

new $k.AttributeType()

Represents a type of attributes

Extends

Methods

addTranslatedLanguage()

adds the language to the set of possible translations for this attribute

Throws:
Type Description
$k.exception.InvalidLanguage

If an invalid language was specified

$k.exception.TransactionError

If no write transaction is active

elementAtValue(value, language) : $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 Description
value object

The value to search for

language string optional

Language of the value. Either ISO 639-1 (2-letter code, e.g. "en") or ISO 639-2B (3-letter code, e.g. "eng"). If not defined, the current language will be used.
Ignored if the attribute is not translated

Throws:
Type Description
$k.exception.InvalidValue

If the value is not in the range of allowed values of the attribute

Returns:
Type Description
$k.SemanticElement

elementsAtValue(value, language) : Array.<$k.SemanticElement>

Returns all semantic elements with attributes of this types with the specified value

Name Type Description
value object

The value to search for

language string optional

Language of the value. Either ISO 639-1 (2-letter code, e.g. "en") or ISO 639-2B (3-letter code, e.g. "eng"). If not defined, the current language will be used.
Ignored if the attribute is not translated

Throws:
Type Description
$k.exception.InvalidValue

If the value is not in the range of allowed values of the attribute

Returns:
Type Description
Array.<$k.SemanticElement>

hasTranslatedValues() : boolean

True if the attributes have translated values

Returns:
Type Description
boolean

translatedLanguages() : Array.<string>

Returns the possible translated languages as 3-letter codes (ISO639 2b).
Empty if the attribute is not translated

Returns:
Type Description
Array.<string>

valueRange() : $k.ValueRange

Returns the range of the values of the attributes

Returns:
Type Description
$k.ValueRange

Intherited methods

addSupertype(type), allInstances(), allowsMultipleOccurrences(), allSubtypes(), allSupertypes(), attribute(type), attributes(type), attributeValue(type, language), attributeValueString(type, language), callBehaviour(method, args), canCreateExtensions(), canCreateInstances(), changeLog(), core(), createAttribute(type, value, language), createAttributeFromString(type, valueString, language), createRelation(type, target, inverse), definedDomains(), domain(), domains(), element(), ensureAttributeValue(type, value, language), ensureRelationTarget(type, target, inverse), estimatedNumberOfInstances(), getCounter(), hasPossibleAttribute(type), hasPossibleRelation(type), icon(size, language), iconAttribute(size, language), idNumber(), idString(), increaseCounter(), inheritedAttribute(type), inheritedAttributeValue(type, language), instances(), internalName(), isAbstract(), isInvalid(), isKindOf(type), locatorString(locatorTypes), modificationNumber(), name(language), numberOfInstances(), openInKnowledgeBuilder(user), possibleProperties(filter), primaryCore(), properties(filter), relation(type), relations(type), relationTarget(type), relationTargets(type), remove(), removeSupertype(), render(context, keyFilter, detailFilter), renderJSON(context, excludedKeys, detailFilter), renderTemplate(template, entity, conversion, variables), schemaReportOn(), setAttributeFromString(type, valueString, language), setAttributeValue(type, value, language), setCanCreateExtensions(canCreate), setCanCreateInstances(canCreate), setCounter(counterValue), setInternalName(name), setName(name, language), setRelationTarget(type, target, inverse), subtypes(), supertypes(), type(), typeDomain(), updateMapping()