Valid Names, Values, Character sets in DCH
Last updated
Last updated
Semantic models, BRICK, and DCH enforce limits on allowable names and values for various fields. This section provides a reference for what DCH accepts in supplied TTL files.
The turtle file format has the following constraints/rules:
TTL is agnostic about newlines convention (\n or \r\n are both fine, just be consistent).
TTL is not sensitive to whitespace placement, but does care about the whitespace characters you use. Use only tab, space, CR and/or LF. Never use non-breaking spaces or other weird whitespace (see ). Note: Copying text from a browser can get you into trouble here.
TTL assumes unicode UTF-8 encoding.
There are restrictions on what can be used for the URI for the site or building. This applies irrespective of whether or not you use a prefix in the TTL file. There are also limits on the value of the prefix if a prefix is used.
Using a declared prefix
prefix_str:
The prefix can be empty but if not, it must start with a letter, only have letters, numbers, dashes, dots & and underscores, must not end in a dot, and be no longer than 64 characters long.
<URI#>
To recognise site or building URIs DCH requires that the URI must be surrounded by angle brackets < > and be of the form dch:[ref_text]#
where [ref_text] can be empty or a string of a maximum length of 507 characters (why? - the total length limit for the full 'dch:[ref_text]#' is 512 characters). It must start with a letter, and only containing letters, numbers, underscores, dashes, dots or forward slashes.
Recommended DCH URI's should be of the form <dch:org/someOrgIdHere/site/someSiteIdHere#> or <dch:org/someOrgIdHere/site/someSiteIdHere/building/someBuildingIdHere#> , where the org, site and building id's start with a letter and only contain letters, numbers, underscores, dashes or dots, and each is no longer than 128 characters.
Using full URIs (i.e., not using a prefix)
URI#
Here the URI# should follow the same rules as the <URI#> above. Rules for the fragment are discussed below:
These are the name part of the prefix_str:name or the fragment part of the <URI#fragment> in the above examples.
Entity names should not be empty*. They should start with a letter, only have letters, numbers, dashes, dots & and underscores, must not end in a dot, and be no longer than 64 characters long. Entity Names have a maximum length of 64 characters.
*Note, whilst not recommended, empty entity names can used for the site or building declaration.
Labels can contain most alphanumeric characters but not newlines, maximum length is 64 characters. Whilst not recommended, labels can contain quotation marks (double quotation marks need to be escaped), as well as escaped unicode characters.
Comments similar to Labels, with tow exceptions, comments can be up to 256 characters long, and comments can contain new lines.
Timeseries_id can contain letters, numbers, dots, dashes, and underscores. They must start with a letter or number, and maximum length is 512 characters.
Different properties expect different types of inputs (numeric, string etc.). Text property values follow the same restrictions as comments.
Units must be valid QUDT units (see ), specified as unit:<qudt_unit> e.g. unit:DEG_C