All Downloads are FREE. Search and download functionalities are using the official Maven repository.

reference.language.attributes.html Maven / Gradle / Ivy




    
    Attribute type
    
    

    
    

    
    

    
    
    
    

    


Attribute

The Attribute type is a semantic type.
Prompto encourages technologists to use semantic types rather than technical ones.
A semantic type is a type defined by meaning rather than structure.
For example dateOfBirth is a semantic type, while Date is a technical type.
In Prompto, semantic types are defined through attribute definitions.
An attribute is defined by simply combining a name with a technical or category type.

Constraints

Additionally, attributes may also have to fit within value domains.
These can be defined using lexical patterns, lists of values or computable expressions.
Computable expressions can refer to the underlying value using the keyword value.

Storage

Finally, attributes are used to define the data store schema.
To achieve this, storable attribute definitions must be preceded with the storable keyword.
If the attribute is to be searchable, it must also be indexed.
For all technical types except Text, this is achieved by simply adding with index to the attribute definition.

Indexing Text

Indexing Text attributes requires a bit more attention.
Text attributes may be used as unique identifiers. Examples of such are a product reference or social security number.
Such Text attributes should be indexed using key indexing, which is case sensitive.
Most Text attributes are better indexed insensitively of case, and would happily benefit from a phonetic search.
Such Text attributes should be indexed using value indexing, which is not case sensitive.
(depending on the data store implementation, phonetic search may or not be available).
Finally, some Text attributes are actually sentences rather than 'atomic' values.
For these, it is often preferable to use words indexing.
Prompto lets you combine the 3 index types. It is rare however to simultaneously need more than 1 of them.





© 2015 - 2025 Weber Informatics LLC | Privacy Policy