RDF Templates Data Model
To support access to the labels of nodes in an RDF graph, I need to clarify the RDF Templates data model which is a little fuzzy at the moment. I think the following data types are required for now (others will be required later):
- node — represents a node in the graph.
- node list — represents a list of nodes which currently is unordered but should be able to be ordered in the future.
- string — an ordered sequence of characters.
At the moment only the node and node list types are explicit and the string type is inferred. My thinking is that the rt:value-of element should return a string, therefore it needs to be able to convert nodes and node lists to strings. The current spec says: This element is replaced by the literal value of the concatenated values of the nodes selected by the NodePath specified in the select attribute. Each literal node specified is replaced by its label. Each resource node is replaced by its rdf:value property if present or an empty string if not.
. I can replace this wording with something like: This element evaluates the expression in the select attribute and returns the result converted to a string.. I then need to define the rules for converting nodes and node lists to strings:
- node list to string — concatenate the string representations of each node in the list. The order in which they are concatenated is determined by the ordering of the node list which may be undefined.
- node to string — if the node is a literal node then the string representation is equal to the node's label. If the node is a resource then the string representation is the value of the node's
rdf:valueproperty. If nordf:valueproperty is present then the string representation is the empty string.
These rules will need to be extended in the future when I start tackling literal datatypes and it might be prudent to allow other string representations of resources, such as the rdf:label property, but the above rules are intended to be clarifications, not extensions of the specification.
Comments
No comments yet.
Leave a comment
Sorry, the comment form is closed at this time.
