Property Types
Describing information associated with a thing
Overview
Property types provide semantic descriptions of properties, and specify the expected data types of their values.
Creating a new property type
You can create a new property type inline when editing an entity type, directly within the entity type editor. To create a new property type:
→
Open the editor for the entity type you'd like to add the property type to.→
Click "Add a new property" at the bottom of the list of any existing property types already expected.→
Type in the name of the property type you wish to create, as if searching for it in the suggestor that pops up. Next, click “Create<name>
PROPERTY TYPE”.→
You'll now be asked to provide a description. Your new property type will be available for use with other entity types in HASH, so describing the property type's semantic meaning in a way that isn't overly specific to your current open entity type works best.→
Next, choose one or more data types that define the allowed values of a property type.
→
Data types may be primitive, such asText
,Number
, orBoolean
(true/false), as well as more complex (Phone Number
) or specific (e.g. various units of length).→
You can also define "custom" expected values, by clicking “Specify a custom expected value”. A custom expected value uses one or both of theArray
andProperty Object
data types.→
Array
data types are lists of values, such as a list ofText
values→
Property Object
data types are sets of other property types, nested within the parent property type you are defining.→
Most users will never need to use these, and in many cases an object of property types would be better created as a separate entity with its own type that is then linked to other entities as required.→
Click ‘Save expected value’ if defining anArray
orProperty Object
data type, when finished, to return to the property type defintition.
→
Finally, click ‘Create new property type’. You'll see your new property type in the property types table of the entity type you're editing. You’ll notice that for each of the attributes of an entity type, you can also choose whether the attribute (such as the property type you just created) should be required, or whether it is just possible to associate the attribute with the entity. You're also able to specify whether multiple values for an attribute (such as instances of a link, or values of a property) can be provided.
→
Setting an attribute to required means that entities of an entity type cannot be created unless the required property value or link is present.→
Allowing multiple of the expected property type's value means that whatever the expected value is, there can be multiple of them (i.e. a list or array). If the property type expects a number, allowing multiple means the entity type will expect a list of numbers, and if the property type expects a list of numbers, allowing multiple would mean that the entity expects a list of list of numbers.
Best practices
When creating new property types, it's good to keep certain things in mind.
→
Be as specific as possible. Rather than name your property type something like "Temperature", try to be more specific. For example, "Average Temperature", "Current Temperature", or even "Estimated Current Temperature". The aim of property types is to provide semantic meaning to the information associated with an entity.→
Prefer data type groups where possible. If you have a "Current Temperature" property type, rather than specify "Celcius" and "Farenheit" on it separately as acceptable data types for its values, try to declare a data type group, such as "Temperature" instead. This allows values of one data type to be automatically converted to another, and prevents the need for separately (manually) declaring every different kind of temperature-related data type that might exist (with there being many more, for example "Kelvin", which is used in many scientific contexts).→
Consider if a property type should be a link type, instead. For example, should "Home Address" be stored as a string on an entity, or should each home address be its own "Street Address" entity in your web? Depending on your use case, the latter may be more appropriate (for example enabling you to quickly generate a graph representing a building's occupants).
Browsing property types
You can see all property types you have permission to view from the Types > Property Types page in HASH.
Create a free account
Sign up to try HASH out for yourself, and see what all the fuss is about
By signing up you agree to our terms and conditions and privacy policy