rselect is a Scheme macro that retrieves data from an RDF depository. It is assumed that every "item" (resource or literal) has a unique integer ID number.
(rselect (rv...) ((subjectpredicateobject)...))
The first argument is a list of zero or more return values.
The second argument is a list of zero or more statements. A statement is a list of three items, representing subject, predicate and object respectively. An item is one of:
a symbol beginning with $. These are considered variables.
an expression evaluating to an integer. These are considered to be ID numbers.
an expression evaluating to a string. These are considered to be resource URIs.
rselect returns a list of match lists, one for each set of variables that satisfy the statements. A match list is a list of values specified by the return value list. A return value is one of:
an item. These return ID values in the match lists as integers.
the special form (uri item) where item is an item. These return URIs as strings.
the special form (literal item) where item is an item. These return literals as byte arrays. In HScheme, byte arrays and strings are different things: the elements of strings, characters, are Unicode codepoints.
the special form (string-literal item) where item is an item. These return literals as strings.
the special form (mime-type item) where item is an item. These return the MIME types of items as strings.
This is the pure functional variant of HScheme, no set! etc.
All Literals
All literals, together with their IDs
All URIs
All URIs, together with their IDs
IDs and URIs
Conversion between ID and URI. Note how rselect returns an ID (integer) even when a URI (string) is specified as a return value. rselect always returns IDs unless one of the special forms (above) is used.
Classes
The URIs and labels of all classes. The symbols rdf and rdfs are predefined as functions that prefix the appropriate namespace strings.
Properties
The domains and ranges of properties in "property: domain -> range" form.
Class Hierarchy
The class hierarchy in (label (subclass...)) form.