Usage of RDFa attributes
The IoTEntity and Event models apply the simple but powerful W3C Recommendation RDFa approach to semantic annotation of data carried in Events and RESTful APIs. As is stated in http://www.w3.org/TR/rdfa-primer/ “It is worth emphasizing that RDFa uses URLs to identify just about everything… The reason behind this design decision is rooted in data portability, consistency, and information sharing. Using URLs removes the possibility for ambiguities in terminology“.
RDFa is a way of expressing RDF-style relationships using simple attributes in existing markup languages. A subset of RDFa attributes has been adopted by the IoTEntity and Event models:
- @about – used for stating what the data is about (a ‘subject’ in RDF terminology). It is used for recording identifiers for Event, IoTEntity and IoTProperty resources (see also section on Evaluation Context below).
- @datatype – to express the datatype of a literal
- @property – a white space separated list of property references, used for expressing relationships between a subject and either a resource object if given or some literal text (also a ‘predicate’);
- @typeof – a white space separated list of type references that indicate the RDF type(s) to associate with a subject;
- @prefix – a white space separated list of prefix-name IRI pairs of the form “ab:http://tempuri.org
XML Schema datatypes for these attributes have been defines in the RDFaTypeDefinitions.xsd schema file, imported by the IoTEntity schema.
See the RDFa Recommendation for full details on usage of these attributes.
The key addressing component of RDF is the IRI (the internationalized resource identifier, IRI, is a generalization of the URI), but these are usually long and unwieldy. RDFa therefore supports a mechanism by which IRIs can be abbreviated, called ‘compact URI expressions’ or simply, CURIEs. It is RECOMMENDED to use CURIEs in IoTEntity and Event document instances.
For example, a type definition using the @datatype attribute with the value “xs:int” includes a prefix “xs” followed by a reference “int” and separated by a colon “:”. The prefix MUST have been earlier defined using a @prefix attribute at an appropriate level. With a prefix definition such as “xs:http://www.w3.org/2001/XMLSchema”, the “int” reference points to the “int” datatype as defined in the XML Schema W3C Recommendation.
Note the possible usage of multiple CURIE values to assert multiple type classifications according to RDFa.
For further information about CURIE syntax, see Section 6 of the RDFa Recommendation. CURIE processing is described in Section 7.4 of the RDFa Recommendation.
Evaluation Context – xml:base and about attributes
The initial evaluation context for relative URIs in the document being processed is usually given by the URI of the document itself, but it can also be explicitly set by using the @xml:base attribute on the Event, IoTEntity or IoTProperty elements (when it appear at the root level). For example, an IoTEntity identifier provided in the @about attribute is relative to the initial evaluation context, and the id of the IoTProperty is relative to the IoTEntity.
See Section 7.2 of the RDFa Recommendation for further details.