$k. PropertyFilter

new PropertyFilter(filterDescriptoropt)

Creates a new PropertyFilter. If the constructer is called as a function, it will construct a new filter, too.

The filter will be initialized from the optional filterDescriptor. The possible properties are:

type (Type or internal name)
abstract
attributes
exact
oneWayRelations
shortcutRelations
systemRelations
unconstrained
userRelations

Parameters:
NameTypeAttributesDescription
filterDescriptorobject<optional>
Example
// Returns a filter that returns properties with internal name "contains"
$k.PropertyFilter({ exact: true, type: "contains" });

Filters the possible properties of an element or domain.

Methods

includeAbstract() → {boolean}

Returns true if abstract properties should be returned. Default is false.

Returns:
Type: 
boolean

includeAttributes() → {boolean}

Returns true if attributes should be returned

Returns:
Type: 
boolean

includeOneWay() → {boolean}

Returns true if inverse one way relations should be returned. Default is false.

Returns:
Type: 
boolean

includeShortcutRelations() → {boolean}

Returns true if shortcut relations should be returned. Default is false.

Returns:
Type: 
boolean

includeSystemRelations() → {boolean}

Returns true if system relations should be returned. Default is false.

Returns:
Type: 
boolean

includeUserRelations() → {boolean}

Returns true if user relations should be returned

Returns:
Type: 
boolean

isExact() → {boolean}

Returns true if only properties of the specified type should be returned, false if also sub-properties should be included. Default is false.

Returns:
Type: 
boolean

possiblePropertiesOf(object) → {Array.<$k.PropertyType>}

Returns the possible properties of the semantic element / domain

Parameters:
NameTypeDescription
object$k.SemanticElement

Semantic element or domain

Returns:
Type: 
Array.<$k.PropertyType>

propertiesOf(semanticElement) → {Array.<$k.PropertyType>}

Returns the properties of the semantic element

Parameters:
NameTypeDescription
semanticElement$k.SemanticElement
Returns:
Type: 
Array.<$k.PropertyType>

setAbstract(abstract) → {$k.PropertyFilter}

Defines if abstract properties are returned.

Parameters:
NameTypeDescription
abstractboolean

True if not defined

Returns:

The filter

Type: 
$k.PropertyFilter

setAttributes(attributes) → {$k.PropertyFilter}

Defines if attributes should be returned. Default is true

Parameters:
NameTypeDescription
attributesboolean

True if not defined

Returns:

The filter

Type: 
$k.PropertyFilter

setExact(exact) → {$k.PropertyFilter}

Defines if only properties of the specified type should be returned, or also sub-properties.

Parameters:
NameTypeDescription
exactboolean

True if not defined

Returns:

The filter

Type: 
$k.PropertyFilter

setOneWayRelations(oneWayRelations) → {$k.PropertyFilter}

Defines if inverse one way relations should be returned.

Parameters:
NameTypeDescription
oneWayRelationsboolean

True if not defined

Returns:

The filter

Type: 
$k.PropertyFilter

setShortcutRelations(shortcutRelations) → {$k.PropertyFilter}

Defines if shortcut relations should be returned.

Parameters:
NameTypeDescription
shortcutRelationsboolean

True if not defined

Returns:

The filter

Type: 
$k.PropertyFilter

setSystemRelations(systemRelations) → {$k.PropertyFilter}

Defines if shortcut relations should be returned.

Parameters:
NameTypeDescription
systemRelationsboolean

True if not defined

Returns:

The filter

Type: 
$k.PropertyFilter

setType(type) → {$k.PropertyFilter}

Defines the type / internal name of the properties

Parameters:
NameTypeDescription
type

Type or internal name

Returns:

The filter

Type: 
$k.PropertyFilter

setUnconstrained(additionalOnly) → {$k.PropertyFilter}

Defines if properties should be returned that cannot be created due to cardinality constrains. This setting only has an effect when quering the possible properties of a semantic element, not of a domain

Parameters:
NameTypeDescription
additionalOnlyboolean

True if not defined

Returns:

The filter

Type: 
$k.PropertyFilter

setUserRelations(userRelations) → {$k.PropertyFilter}

Defines if user relations should be returned. Default is true

Parameters:
NameTypeDescription
userRelationsboolean

True if not defined

Returns:

The filter

Type: 
$k.PropertyFilter

toPropertyFilter() → {$k.PropertyFilter}

Returns this filter. To define custom property filters, define an object with a function toPropertyFilter(). If toPropertyFilter() does not return an object of kind $k.PropertyFilter, the object has to define the functions propertiesOf() and possiblePropertiesOf()

Returns:
Type: 
$k.PropertyFilter

type() → {string|$k.Type}

Returns the type / internal name that should be used for filtering properties

Returns:
Type: 
string | $k.Type

unconstrained() → {boolean}

Returns true if properties should be returned that cannot be created due to cardinality constrains. This setting only has an effect when quering the possible properties of a semantic element, not of a domain. Default is false

Returns:
Type: 
boolean