Data Model

Versa operates on the abstract graph model of RDF. As such it operates on nodes, literals and arcs. Versa does not require that the abstract RDF graph support any of the entailments defined in the RDF semantics [SEMANTIC] specication even though this specification may reference terminology from that specification. For processing of Versa Queries, an implementation is required to support the following set of data types and result types.

Data Types

Data types are used internally in processing of a versa expression, as opposed to result types which are used to return a result from a completed versa query. The following are the set of data types that must be supported by a versa implementation.

Resource

A resource is a reference to a node or a literal in the data model. The actual form of the reference is left to the implementation, however, these can be thought of as the blank nodes allocated to the node or literal based on Simple entailment [SEMANTICS].

Node

A node is reference to a named or unnamed node in the model.

RDF Literal

A literal is reference to a literal in the model.

Lists

A heterogeneous ordered collection of any data type (including other lists or sets). Duplicates are allowed.

Sets

A heterogeneous unordered collection of any data type (including other sets or lists), with no duplicate values. See the section on equality for a definition of how members of a set are computed to be equal.

Result Types

As opposed to data types which are used for internal processing of a versa query, result types are meant to give a meaningful result to a query. The set of result types include all of the data types, as well as those defined below. Please see the Conversions section for the set of rules the govern the conversion of data types to result types.

As a note, results types are not purely limited to the results of a top level versa query. In some cases, data types may be converted to result types while processing. An example of this is the function concat which will convert its sub-expression to string result types before concatenating the strings.

String

Number

Boolean

Conversions

In some cases it is not possible to convert from one data type to another. In this case, the conversion produces a null output. This psuedo datatype is used as follows:

When implicit conversions between data types and result types are needed, the following matrix defines the operations applied.

Insert type conversion matrix

List and Set conversions

When any datatype is converted to a list or set, the results is a list or set of length one with that value as the only member.

When a list is converted to another data type (besides set) the first item in the list is converted to that data type. If the list is empty, the results are null. When a list is converted to a set it produces a set with the same entries as the list, except that if there are duplicate values, any equivalent values following the first are omitted (e.g. set(list(1,2,1)) = set(1,2))

When a set is converted to any data type it is first converted to a list, then the list conversions are applied. As sets are unordered it is not gaurenteed that two subsequent conversions to list will produce the same results. As an example, the following may not always be true string(list(1,2)) = string(list(1,2))

Comparisons

Comparisons between values follow specific rules for each data type. In general if two values are being compared, A and B, B is first converted to the same type as A before the comparison is made.

Comparisons can be explicitly applied in various operations, or can be explicitly made by invoking the relational functions (see below).

Comparisions are defined by three primary comparison operations. More complex comparisons are defined by a boolean combination of these primary comparisons. As an example, the comparison of <= is the results of < or =

The following are the comparison rules for the various types. Note, for comparison of resources, the super type of the resource (node or literal) is computed, then thos comparison rules are followed.

Insert comparison matrix

Versa/Specification/Domain_of_Operation (last edited 2008-11-24 18:46:30 by localhost)