This is the cl-rdfxml Reference Manual, version 0.9, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 05:18:53 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
cl-rdfxml
The CL-RDFXML system provides functionality for processing RDF/XML serializations of RDF graphs. RDF/XML processes XML using Closure XML (CXML), and handles URIs using PURI.
Joshua Taylor
0.9
cxml
(system).
puri
(system).
package.lisp
(file).
utilities.lisp
(file).
constants.lisp
(file).
rdfxml.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
cl-rdfxml/cl-rdfxml.asd
cl-rdfxml/package.lisp
cl-rdfxml/utilities.lisp
cl-rdfxml/constants.lisp
cl-rdfxml/rdfxml.lisp
cl-rdfxml/utilities.lisp
package.lisp
(file).
cl-rdfxml
(system).
doalist
(macro).
prompt-for-line
(function).
prompt-for-uri
(function).
strcat
(function).
cl-rdfxml/constants.lisp
package.lisp
(file).
utilities.lisp
(file).
cl-rdfxml
(system).
+rdf-about+
(special variable).
+rdf-about-each+
(special variable).
+rdf-about-each-prefix+
(special variable).
+rdf-alt+
(special variable).
+rdf-bag+
(special variable).
+rdf-bag-id+
(special variable).
+rdf-datatype+
(special variable).
+rdf-description+
(special variable).
+rdf-first+
(special variable).
+rdf-id+
(special variable).
+rdf-li+
(special variable).
+rdf-list+
(special variable).
+rdf-namespace+
(special variable).
+rdf-nil+
(special variable).
+rdf-node-id+
(special variable).
+rdf-object+
(special variable).
+rdf-parse-type+
(special variable).
+rdf-predicate+
(special variable).
+rdf-property+
(special variable).
+rdf-rdf+
(special variable).
+rdf-resource+
(special variable).
+rdf-rest+
(special variable).
+rdf-seq+
(special variable).
+rdf-statement+
(special variable).
+rdf-subject+
(special variable).
+rdf-type+
(special variable).
+rdf-value+
(special variable).
+rdf-xml-literal+
(special variable).
+rdfs-class+
(special variable).
+rdfs-comment+
(special variable).
+rdfs-container+
(special variable).
+rdfs-container-membership-property+
(special variable).
+rdfs-datatype+
(special variable).
+rdfs-domain+
(special variable).
+rdfs-is-defined-by+
(special variable).
+rdfs-label+
(special variable).
+rdfs-literal+
(special variable).
+rdfs-member+
(special variable).
+rdfs-namespace+
(special variable).
+rdfs-range+
(special variable).
+rdfs-resource+
(special variable).
+rdfs-see-also+
(special variable).
+rdfs-subclass-of+
(special variable).
+rdfs-subproperty-of+
(special variable).
define-prefixed-name
(macro).
define-rdf-term
(macro).
define-rdfs-term
(macro).
cl-rdfxml/rdfxml.lisp
package.lisp
(file).
constants.lisp
(file).
cl-rdfxml
(system).
*coerce-datatyped-empty-properties*
(special variable).
*parse-uris-strictly*
(special variable).
*warn-on-non-namespaced-names*
(special variable).
*warn-on-parse-type-other*
(special variable).
*warn-on-rdf-prefixed-non-rdf-names*
(special variable).
bad-node-element-uri
(condition).
bad-property-element-uri
(condition).
bad-uri
(condition).
blank-node
(function).
blank-node
(class).
blank-node-id
(generic reader).
datatyped-empty-property
(condition).
duplicate-attribute
(condition).
ignore-attribute
(function).
ignore-attributes
(function).
ignore-characters
(function).
ignore-language
(function).
illegal-namespace-name
(condition).
intern-plain-literal
(function).
intern-typed-literal
(function).
invalid-attribute-value
(condition).
invalid-language-tag
(condition).
literal
(class).
literal-datatype
(generic reader).
literal-language
(generic reader).
literal-string
(generic reader).
mutually-exclusive-attributes
(condition).
non-namespaced-attribute
(condition).
non-namespaced-name
(condition).
non-nc-name-id
(condition).
other-parse-type
(condition).
parse-as-typed-literal
(function).
parse-document
(function).
parse-uri-non-strictly
(function).
plain-literal
(class).
print-object
(method).
print-object
(method).
print-object
(method).
prohibited-attribute
(condition).
rdf-prefixed-non-rdf-name
(condition).
rdfxml-error
(condition).
rdfxml-warning
(condition).
repeated-id
(condition).
typed-literal
(class).
unexpected-characters
(condition).
*blank-nodes*
(special variable).
*current-xml-lang*
(special variable).
*element-ids*
(special variable).
*li-counter*
(special variable).
*object*
(special variable).
*plain-literals*
(special variable).
*predicate*
(special variable).
*subject*
(special variable).
*triple-receiver*
(special variable).
*typed-literals*
(special variable).
+xml-namespace+
(special variable).
add-fragment
(function).
attribute
(reader method).
attribute
(reader method).
attribute
(reader method).
attribute-uri
(function).
attributes
(reader method).
characters
(reader method).
check-for-illegal-namespace-names
(function).
consume-whitespace
(function).
core-syntax-term-p
(function).
current-position
(function).
element-attributes
(function).
element-literal-content
(function).
element-uri
(function).
emit-triple
(function).
empty-property-element
(function).
empty-property-element-components
(function).
ensure-non-repeated-id
(function).
expanded-li-uri
(function).
expecting-element
(macro).
id-name-p
(function).
immediate-xml-lang
(function).
intern-uri
(function).
language-tag-p
(function).
literal-property-element
(function).
membership-fragment-p
(function).
membership-property-element-p
(function).
merge-uris
(function).
name
(reader method).
name
(reader method).
node-element
(function).
node-element-components
(function).
node-element-list
(function).
node-element-subject
(function).
node-element-uri-p
(function).
non-parse-type-property-element
(function).
old-term-p
(function).
parse-type
(reader method).
parse-type-collection-property-element
(function).
parse-type-literal-property-element
(function).
parse-type-property-element-id
(function).
parse-type-resource-property-element
(function).
peek-skipping-comments
(function).
prefix
(reader method).
prefixp
(function).
property-attribute-uri-p
(function).
property-element
(function).
property-element-list
(function).
property-element-uri-p
(function).
rdf-name-p
(function).
rdf-namespace-prefixed-p
(function).
reify-triple
(function).
resource-property-element
(function).
source
(reader method).
syntax-term-p
(function).
tag
(reader method).
unique-attributes
(function).
uri
(reader method).
uri
(reader method).
value
(reader method).
with-alist-restarts
(macro).
with-xml-lang
(macro).
xml-attribute-p
(function).
xml-lang-attribute-p
(function).
xml-whitespace-p
(function).
Packages are listed by definition order.
cl-rdfxml
The cl-rdfxml package provides functionality for processing RDF/XML representations of RDF graphs. RDF/XML processes XML using Closure XML (CXML) and handles URIs using PURI.
common-lisp
.
*coerce-datatyped-empty-properties*
(special variable).
*parse-uris-strictly*
(special variable).
*warn-on-non-namespaced-names*
(special variable).
*warn-on-parse-type-other*
(special variable).
*warn-on-rdf-prefixed-non-rdf-names*
(special variable).
+rdf-about+
(special variable).
+rdf-about-each+
(special variable).
+rdf-about-each-prefix+
(special variable).
+rdf-alt+
(special variable).
+rdf-bag+
(special variable).
+rdf-bag-id+
(special variable).
+rdf-datatype+
(special variable).
+rdf-description+
(special variable).
+rdf-first+
(special variable).
+rdf-id+
(special variable).
+rdf-li+
(special variable).
+rdf-list+
(special variable).
+rdf-namespace+
(special variable).
+rdf-nil+
(special variable).
+rdf-node-id+
(special variable).
+rdf-object+
(special variable).
+rdf-parse-type+
(special variable).
+rdf-predicate+
(special variable).
+rdf-property+
(special variable).
+rdf-rdf+
(special variable).
+rdf-resource+
(special variable).
+rdf-rest+
(special variable).
+rdf-seq+
(special variable).
+rdf-statement+
(special variable).
+rdf-subject+
(special variable).
+rdf-type+
(special variable).
+rdf-value+
(special variable).
+rdf-xml-literal+
(special variable).
+rdfs-class+
(special variable).
+rdfs-comment+
(special variable).
+rdfs-container+
(special variable).
+rdfs-container-membership-property+
(special variable).
+rdfs-datatype+
(special variable).
+rdfs-domain+
(special variable).
+rdfs-is-defined-by+
(special variable).
+rdfs-label+
(special variable).
+rdfs-literal+
(special variable).
+rdfs-member+
(special variable).
+rdfs-namespace+
(special variable).
+rdfs-range+
(special variable).
+rdfs-resource+
(special variable).
+rdfs-see-also+
(special variable).
+rdfs-subclass-of+
(special variable).
+rdfs-subproperty-of+
(special variable).
bad-node-element-uri
(condition).
bad-property-element-uri
(condition).
bad-uri
(condition).
blank-node
(function).
blank-node
(class).
blank-node-id
(generic reader).
datatyped-empty-property
(condition).
duplicate-attribute
(condition).
ignore-attribute
(function).
ignore-attributes
(function).
ignore-characters
(function).
ignore-language
(function).
illegal-namespace-name
(condition).
intern-plain-literal
(function).
intern-typed-literal
(function).
invalid-attribute-value
(condition).
invalid-language-tag
(condition).
literal
(class).
literal-datatype
(generic reader).
literal-language
(generic reader).
literal-string
(generic reader).
mutually-exclusive-attributes
(condition).
non-namespaced-attribute
(condition).
non-namespaced-name
(condition).
non-nc-name-id
(condition).
other-parse-type
(condition).
parse-as-typed-literal
(function).
parse-document
(function).
parse-uri-non-strictly
(function).
plain-literal
(class).
prohibited-attribute
(condition).
rdf-prefixed-non-rdf-name
(condition).
rdfxml-error
(condition).
rdfxml-warning
(condition).
repeated-id
(condition).
typed-literal
(class).
unexpected-characters
(condition).
*blank-nodes*
(special variable).
*current-xml-lang*
(special variable).
*element-ids*
(special variable).
*li-counter*
(special variable).
*object*
(special variable).
*plain-literals*
(special variable).
*predicate*
(special variable).
*subject*
(special variable).
*triple-receiver*
(special variable).
*typed-literals*
(special variable).
+xml-namespace+
(special variable).
add-fragment
(function).
attribute
(generic reader).
attribute-uri
(function).
attributes
(generic reader).
characters
(generic reader).
check-for-illegal-namespace-names
(function).
consume-whitespace
(function).
core-syntax-term-p
(function).
current-position
(function).
define-prefixed-name
(macro).
define-rdf-term
(macro).
define-rdfs-term
(macro).
doalist
(macro).
element-attributes
(function).
element-literal-content
(function).
element-uri
(function).
emit-triple
(function).
empty-property-element
(function).
empty-property-element-components
(function).
ensure-non-repeated-id
(function).
expanded-li-uri
(function).
expecting-element
(macro).
id-name-p
(function).
immediate-xml-lang
(function).
intern-uri
(function).
language-tag-p
(function).
literal-property-element
(function).
membership-fragment-p
(function).
membership-property-element-p
(function).
merge-uris
(function).
name
(generic reader).
node-element
(function).
node-element-components
(function).
node-element-list
(function).
node-element-subject
(function).
node-element-uri-p
(function).
non-parse-type-property-element
(function).
old-term-p
(function).
parse-type
(generic reader).
parse-type-collection-property-element
(function).
parse-type-literal-property-element
(function).
parse-type-property-element-id
(function).
parse-type-resource-property-element
(function).
peek-skipping-comments
(function).
prefix
(generic reader).
prefixp
(function).
prompt-for-line
(function).
prompt-for-uri
(function).
property-attribute-uri-p
(function).
property-element
(function).
property-element-list
(function).
property-element-uri-p
(function).
rdf-name-p
(function).
rdf-namespace-prefixed-p
(function).
reify-triple
(function).
resource-property-element
(function).
source
(generic reader).
strcat
(function).
syntax-term-p
(function).
tag
(generic reader).
unique-attributes
(function).
uri
(generic reader).
value
(generic reader).
with-alist-restarts
(macro).
with-xml-lang
(macro).
xml-attribute-p
(function).
xml-lang-attribute-p
(function).
xml-whitespace-p
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
A boolean (whose default value is false) that controls whether an empty property element that contains a datatype attribute (a case which is prohibited by the RDF/XML Syntax Specification) is coerced to a typed literal with the specified datatype and the empty string "" as a lexical form. Also see the condition type datatyped-empty-property and the keyword argument coerce-datatyped-empty-properties to the function parse-document.
A boolean (whose default value is true) that controls whether URIs are parsed strictly. This determines whether, within parse-document, a handler is established for conditions of type puri:uri-parse-error which will attempt to parse malformed URIs in a non-strict way. Also see the restart function parse-uri-non-strictly, and the parse-uris-strictly keyword argument to parse-document.
A boolean (whose default value is true) that controls whether a warning is signalled when a permitted non-namespaced attribute is encountered. The only attributes which may appear without namespaces are ID, about, resource, parseType, and type. New documents should not use unqualified forms, though they may appear in legacy documents. See Section 6.1.4 of the RDF/XML Syntax Specification.
A boolean (whose default value is false) that controls whether a warning is signalled when an element is encountered that specifies the rdf:parseType attribute with a value other than "Literal", "Resource", or "Collection". Such an element is treated as though the value were "Literal", and this situation is not an error. Nonetheless, it seems likely that one might be interested in knowing when it occurs.
According to to Section 5.1, The RDF Namespace and Vocabulary of the RDF/XML Syntax Specification, warnings SHOULD be generated when a name is encountered that begins with the RDF namespace name, but is not an RDF name. If *warn-on-rdf-prefixed-non-rdf-names* is true (the default), then such warnings are generated, but are muffled otherwise.
The string prefix of RDF terms: http://www.w3.org/1999/02/22-rdf-syntax-ns# .
The string prefix of RDFS terms: http://www.w3.org/2000/01/rdf-schema#
blank-node [id [namespace]] => blank-node
id—a string
namespace—an equal hash-table
Blank-node returns a blank node. If id is specified, then if there is
already a blank node in namespace whose id is equal to id, then that
blank node is returned. Otherwise, a new blank node is created,
inserted into namespace, and returned. If id is not specified, then a
new blank node is returned, and namespace is not modified.
ignore-attribute [condition] => |
condition—a condition
Ignore-attribute attempts to invoke the restart named
ignore-attribute. This is intended for use when an attribute appears
in a place where it is prohibited, but parsing would continue
successfully if the attribute had not been specified.
ignore-attributes [condition] => |
condition—a condition
Ignore-attributes attempts to invoke the restart named
ignore-attributes. This is intended for use when duplicate attributes
are provided and all can be ignored, or when mutually exclusive
attributes appear, and all can be ignored.
ignore-characters [condition] => |
condition—a condition
Ignore-characters attempts to invoke the restart named
ignore-characters. This is intended for use when character data
appears in a place that should have been whitespace.
ignore-language [condition] => |
condition—a condition
Ignore-language treats a xml:lang attribute whose value was not a
language tag conforming to RFC 3066 as though the attribute had not
been specified. This occurs by invoking the restart ignore-language.
intern-plain-literal string [language] => plain-literal
string, language—strings
plain-literal—a plain literal
Intern-plain-literal returns a literal with the specified string and
language. Calls to intern-plain-literal with strings that are equal
and languages that are equal return the same literal object.
intern-plain-literal string datatype => typed-literal
string—a string
datatype—a URI designator
typed-literal—a typed literal
intern-typed-literal returns a literal with the specified string and
datatype. Calls to intern-plain-literal with strings that are equal
and designators for the same URI return the same literal object.
parsed-as-typed-literal [condition] => |
condition—a condition
parse-as-typed-literal attempts to parse an empty-property-element as
typed literal. This is intended to be used when an rdf:datatype
attribute is present on an empty property element. Strictly speaking,
this is prohibited by the RDF/XML specification (see errata), but some
RDF/XML parses output it anyway.
parse-document function input => |
function—a function of three arguments
input—an input suitable for cxml:make-source
Parse-document parses input, binds *triple-receiver* to function, and
calls emit-triple with each triple that can be extracted from the
input. *blank-nodes* is rebound to a new equal hash table and maps
blank node identifiers to their blanks nodes. If the document element
is rdf:RDF, then its children are processed as node elements,
otherwise, the body of the document is parsed as a sequence of node
elements.
parse-uri-non-strictly condition => result*
condition—a condition
Parse-uri-non-strictly is a restart function that invokes the restart
named parse-uri-non-strictly. If no such restart is available,
parse-uri-non-strictly returns NIL, otherwise the results of invoking
the restart are returned.
blank-node-id blank-node => id
blank-node—a blank-node
id—a string
Blank-node-id returns the ID of the blank-node. Blank-node-ids are
intended to be used for readability purposes. Blank-nodes should be
compared directly using object equality. That two blank-nodes have ids
that are string= does not mean that they represent the same RDF
blank-node.
blank-node
)) ¶The graph-local ID of the blank-node. This slot is
unbound if the blank node has no id. The id of a blank node is used to
identify the blank node within the scope of a particular graph. That
two blank-nodes happen to have the same ID is not an indication that
they represent the same blank node.
id
.
literal-datatype typed-literal => datatype
typed-literal—a typed-literal
datatype—an interned PURI uri
Literal-datatype returns the datatype of a typed-literal. The datatype
URI is interned, and may be compared with eq.
typed-literal
)) ¶The datatype of a typed-literal, which is not optional, is a URI designating the datatype.
literal-language plain-literal => result
plain-literal—a plain-literal
result—a string or nil
Literal-language return the language tag of the plain-literal, if
there is one, and nil if no language tag is associated with the
literal.
plain-literal
)) ¶The language tag associated with a plain literal.
If language is nil, the the plain-literal has no language type. If
language is non-nil, it should be a string that conforms to RDF 3066.
literal-string literal => string
literal—a literal
string—a string
Literal-string returns the lexical form of the literal.
typed-literal
) stream) ¶print-object typed-literal stream => typed-literal
typed-literal—a typed-literal
stream—an output stream
Print-object prints the typed-literal in a form similar to the W3C RDF
Validation output. The literal string appears with double quotation
marks, and the datatype URI is printed with a ^^ prefix.
plain-literal
) stream) ¶print-object plain-literal stream => plain-literal
plain-literal—a plain-literal
stream—an output stream
Print-object prints the plain-literal in a form similar to the W3C RDF
Validation output. The literal string appears with double quotation
marks, and the language-tag, if provided is output with an asperand.
blank-node
) stream) ¶print-object bnode stream => bnode
bnode—a blank-node
stream—an output stream
Print-objects prints a representation of the blank node to stream. The
representation is not readable.
Errors of type bad-node-element-uri are signalled
when a URI that is not a node-element-uri is specified in a position
where a node-element-uri is expected.
Errors of type bad-property-element-uri are
signalled when a URI that is not a property-element-uri is specified
in a position where a property-element-uri is expected.
Errors that are subclasses of bad-uri are signalled
when a URI appears in a place that a URI is required, but the provided
URI is not a valid URI for that place.
uri
.
Errors of type datatyped-empty-property are
signaled when the parser is attempting to parser an empty property,
but an rdf:datatype attribute is specified. rdf:datatype is not a
permissible attribute on on empty properties, but it is expected that
this case will most likely arise when the intent was to generate a
literal element with an empty string. When this type of error is
signalled, it is expected that one of the available restarts will make
an attempt to parse the element as a literal with a null string. This
issue is also in the errata of the RDF/XML syntax specification.
Errors of type duplicate-attribute are signalled
when attributes are specified more than once and the XML parser did
not flag the error. This happens when, according to the RDF/XML
specification, certain non-namespaced attributes are interpreted as
being in the RDF namespace. A duplicate attribute can appear, for
instance, when rdf:ID is specified in conjunction with ID, which is
interpreted as rdf:ID.
According to Section 5.1 of the RDF/XML Syntax
Specification, Within RDF/XML documents it is not permitted to use XML
namespaces whose namespace name is the RDF namespace URI reference
concatenated with additional characters.
Conditions of type invalid-attribute-value are
signalled when an attribute value is not appropriate for the
particular attribute. This kind of situation may happen, for instance,
if a xml:lang value is not RFC 3066 compliant, or if an rdf:ID or
rdf:nodeID value is not an XML NCName. Note that these situations are
distinct from those in which an attribute appears where it should not.
Language tags in RDF/XML (and more generally, XML)
must be in accordance with RFC 3066. When a language tag is specified
that is not of the proper form, an error of type invalid-language-tag
is signalled.
tag
.
Some elements are permitted to contain one of a set
of attributes, but no more than one of the set. That is, there are
attributes that are permitted on an element, but are mutually
exclusive. This class of error is signalled when such attributes are
encountered.
:attributes
This slot is read-only.
Certain attribute, namely rdf:ID, rdf:about,
rdf:resource, rdf:parseType, and rdf:type are permitted to appear
without a namespace specified. These attributes are automatically
treated as though they had appeared with the RDF namespace prefix. Any
other attributes without namespaces, however, must not appear.
According to 6.1.4 of the RDF/XML Syntax
Specification, the attributes ID, about, resource, parseType, and type
may appear without a namespace prefix, and are interpreted as the
corresponding RDF names. Also, "new documents SHOULD NOT use these
unqualified attributes, and applications MAY choose to warn when the
unqualified form is seen in a document." non-namespaced-name is the
class of warnings that are signalled in such situations.
name
.
Errors of type non-nc-name-id are raised when
attributes rdf:ID or rdf:nodeID appear with values that are not valid
NCNames.
The rdf:parseType attribute has three explicitly
meaning values, "Resource", "Literal", and "Collection". If
rdf:parseType is encountered with a different value, the element is
processed as though the value had been "Literal". The specification
does not indicate that a warning should be signalled, and so such
warnings are not generated in the default case, but if the user
requests warnings on such attribute values, a warning of type
other-parse-type is signalled.
:parse-type
This slot is read-only.
At various places in RDF/XML, the set of attributes
permissible on an element is restricted. When an attribute appears on
an element but is not allowed there, an prohibited-attribute error is
signalled.
According to "Section 5.1 The RDF Namespace and
Vocabulary" of the RDF/XML Syntax Specification, certain names are
defined as RDF names, and these begin with the RDF namespace name, but
"any other names [beginning with the RDF namespace name] are not
defined and SHOULD generate a warning when encountered, but should
otherwise behave normally." rdf-prefixed-non-rdf-name is the class of
warnings that are signalled in such situations.
name
.
The class of errors signalled by the RDF/XML parser.
error
.
The class of warnings signalled by the RDF/XML parser.
warning
.
Errors of type repeated-id are signalled when the
value of an rdf:ID on an element is the same as the value of an rdf:ID
attribute on another element. rdf:IDs should be unique within the a
document.
Excess whitespace is always permitted between
elements, but arbitrary character data is not. When non-whitespace
character data is encountered where whitespace is expected, an error
of type unexpected characters is signalled.
:characters
This slot is read-only.
The blank-node class represents blank nodes in a
graph. Blanks nodes are local to a graph, and can be identified within
a graph by their ID. The blank-node id is used for refering to the
same blank node in an RDF/XML document, and so in general, blank-nodes
ought to compared using object equality, i.e., eq.
The graph-local ID of the blank-node. This slot is
unbound if the blank node has no id. The id of a blank node is used to
identify the blank node within the scope of a particular graph. That
two blank-nodes happen to have the same ID is not an indication that
they represent the same blank node.
string
:id
This slot is read-only.
The literal class is the superclass of both the
plain-literal and the typed literal. Every literal has some lexical
form, and the slot storing this form is defined in the literal class,
and may be read with literal-string.
The lexical form of the literal.
common-lisp
.
string
:string
This slot is read-only.
The plain-literal class is the class comprising all plain-literals. These literals have a lexical form, inherited from the superclass literal, and an optional language tag. The language tag, when provided, should be of the form specified by RFC 3066, and is normalized to lowercase.
The language tag associated with a plain literal.
If language is nil, the the plain-literal has no language type. If
language is non-nil, it should be a string that conforms to RDF 3066.
(or null string)
:language
This slot is read-only.
The typed-literal class is the class comprising all typed-literals. These literals have a lexical form, inherited from the superclass literal, and a required datatype. The datatype is a puri:uri.
The datatype of a typed-literal, which is not optional, is a URI designating the datatype.
puri:uri
:datatype
This slot is read-only.
An equal hash table that is used for ‘interning’ blank node IDs within the scope of a single graph. Initially nil, but should be bound for each graph being processed.
The most recent xml:lang attribute that was specified in the RDF/XML text. The initial value is nil, and *current-xml-lang* is always rebound to nil when document parsing begins.
During parsing, an ’equal hash table that functions as a set of the IDs that have been processed. Duplicate IDs in an RDF/XML document are prohibited, i.e., it is an error for two elements to have the same value on an rdf:ID attribute.
A list of li-counters. With each expecting-element’, a new counter is pushed onto *li-counter*, and so incrementing the counter of an element’s parent is done by (incf (cadr *li-counter*)).
The predicate of the triples being processed.
An equal hash-table used for interning plain literals, that is, literals with a string component and an optional language tag.
The predicate of the triples being processed.
The subject of the triples being processed.
A function that receives the triples.
An equal hash-table used for interning typed literals, that is, literals with a string component and a datatype.
The string form of the URI XML namespace.
define-prefixed-name name prefix suffix
name—a symbol, not evaluated
prefix, suffix—evaluated to produce strings
Define-prefixed-term defines name as a constant. The value of the
constant is an interned puri URI generated by concatenating the
strings designated by prefix and suffix.
define-rdf-term name suffix
name—a symbol, not evaluated
suffix—evaluated to produce a string designator
define-rdf-term defines name as a constant. The value of the new
constant is a PURI uri constructed by concatenating
+rdf-namespace+ and the suffix.
define-rdfs-term name suffix
name—a symbol, not evaluated
suffix—evaluated to produce a string designator
define-rdfs-term defines name as a constant. The value of the new
constant is a PURI uri constructed by concatenating
+rdfs-namepsace+ and the string designated by suffix.
doalist ((key value [pair]) list-form [result-form]) {tag | statement}* => result*
key, value, pair—symbols
list-form, result-form,, statement—forms
tag—a go tag; not evaluated
results—if a return or return from form is executed, the values
passed from that form; otherwise, the values returned by the
result-form or nil if there is no result form.
Doalist iterates over the keys and values (and conses) in an
association list. The body of doalist is like a tagbody. doalist is
similar to a dolist, but rather than binding a single variable to each
element of a list, doalist binds key and value to the car and cdr of
each cons in an association list, and pair to the cdr.
expecting-element (source [lname [uri]]) form*
expecting-element is a wrapper around klacks:expecting element that
ensures proper binding of the *current-xml-lang* variable, so that
plain literals can properly inherit the value of xml:lang attributes.
Within this RDF/XML parser, expecting-element should always be used
rather than klacks:expecting-element.
with-alist-restarts (thing alist) form &body body
thing—a symbol
alist—an association list
restartable-form—a form
body—forms
With-alist-restarts evaluates restartable form within a dynamic
context in which a restart is established for each entry in alist. If
the restart corresponding to an entry is invoked, then thing is bound
to the entry’s cons cell, and body is evaluated, and the result of
body is the result of the form. If restartable-form does not signal an
error, then the result is the result of restartable form.
with-xml-lang lang form*
With-xml-lang evalutes lang to generate a new language, and evalutes
body with a new binding of *current-xml-lang*. If the result of
evalating lang is null, then *current-xml-lang* is rebound to its
current value, if it is "", then *current-xml-lang* is bound to nil,
otherwise, *current-xml-lang* is bound to the new language.
add-fragment id base => interned-uri
id—a uri fragment id
base—a uri designator
Add-fragment merges "#<id>" with base, and returns the result of
interning the merged URI.
attribute-uri attribute source => uri
attribute—a sax:attribute
source—a cxml:source
uri—a PURI uri
Attribute-uri returns the URi associated with the attribute, as
described by Section 6.1.4 Attribute Event in the RDF/XML Syntax
specification. In general this is the concatenation of the namespace
URI with the local name. If no namespace is provided, and the local
name is ID, about, resource, parseType, or type, then the
corresponding RDF term URI is returned. Otherwise, an error is
signalled.
check-for-illegal-namespace-names attributes => |
attributes—a list of attributes
check-for-illegal-namespace-names enforces the restriction of Section
5.1 of the RDF/XML Syntax Specification that states that "within
RDF/XML documents it is not permitted to use XML namespaces whose
namespace name is the RDF namespace URI reference concatenated with
additional characters." If such a namespace binding is encountered,
an error of type illegal-namespace-name is signalled.
consume-whitespace source => |
source—a cxml source
Consume-whitespace peeks and consumes events from source while the
events are of type :characters and the associated string satisfies
xml-whitespace-p, or if the event is :comment.
core-syntax-term-p object => boolean
core-syntax-term-p returns true if object is in +core-syntax-terms+.
current-position source => position
source—a cxml:source
position—a string
Current-position returns a string of the form <line>.<column>
indicating the approximate position of source.
element-attributes source => attributes
source—a cxml:source
attributes—an alist
Element-attributes returns an association list whose keys are the
attribute URIs of the attributes of the current element and whose
values are the corresponding values. The attributes used in RDF/XML
are the atributes of the element, except that xml attributes are
removed (those satisfying xml-attribute-p) according to Section 6.1.2
"Element Event" in the RDF/XML Syntax Specification.
element-literal-content source &key consume-end => content
source—a cxml:source
content—a string
consume-end—a boolean
Element-literal-content returns a string that is the literal content
of the of element at source. The current event of source should be
:start-element of the element whose literal content is to be
extracted. The corresponding :end-element is consumed if consume-end
is non-nil (the default).
element-uri source => uri
source—a cxml:source
uri—a URI
Element-uri returns the result of interning the concatenation of the
current element’s uri and lname. Element-uri calls klacks:current-uri
and klacks:current-lname, which signal an error if the current event is
not :start-element or :end-element.
emit-triple &key subject predicate object => value*
subject, predicate, object—objects
Emit-triple calls the value of *triple-receiver* with the three values
subject, predicate, and object. subject, predicate, and object, if not
provided, default, respecively, to *subject*, *predicate*, and
*object*.
empty-property-element source attributes => |
source—a cxml:source
attributes—an alist
Processes an empty property element, emitting the appropriate triples
for property attributes on the element, as well as the triple of which
the empty property is the object. The triple of which the empty
property element is the object is also reified when the ID attribute
is present.
empty-property-element-components source attributes => pattributes, id, thing
source—a cxml:source
attributes, pattributes—association lists
id—a PURI uri or nil
thing—a indicator of the empty property element
Empty-property-element-components returns as multiple values the
property attributes of the element (as an association list), an id
corresponding to the element (which is NIL if no ID was provided), and
an indicator of the element, which is either a plain literal with the
empty string as its lexical component, a blank node, or a URI.
ensure-non-repeated-id attributes => new-attributes
attributes, new-attributes—association lists
Ensure-non-repeated-id ensures that if the association list attributes
contains a value for the key rdf:ID, that *element-ids* does not
currently map value to t, that is, that the element has not appeared
on another element. If there is an rdf:ID value and it has already
been specified on another element, restarts include using this value
anyway, ignoring the rdf:ID attribute, and using a different value. In
any of the cases that an ID is eventually specified, *element-ids* is
updated to include the new ID.
expanded-li-uri => uri
uri—a puri:uri
Expanded-li-uri returns the uri generated by incrementing the current
element’s parent’s li counter and adding the fragment _n (where n is
the incremented counter) to the RDF namespace.
id-name-p string => boolean
string—a string
Id-name-p returns true if string is a valid XML NCName, which are the
only valid names attribute values for rdf:ID and rdf:nodeID.
immediate-xml-lang source => result
source—a cxml:source
result—a string or nil
Immediate-xml-lang returns the value of the xml:lang attribute on the
source. Source’s current event should be :start-element. If the
attribute is specified, its value, a string, is returned. If the
attribute is not specified, nil is returned.
intern-uri xuri => uri
xuri—a uri designator
uri—a puri:uri
Intern URI is a wrapper around puri:intern-uri that provides a
use-value restart, so that a new uri designator can be provided.
language-tag-p string => boolean
string—a string
language-tag-p return true if the designated string is in the form
specified by RFC-3066. the general form of such a language tag is
<ALPHA>{1,8} [’-’ [<ALPHA> | <DIGIT>]{1,8}]*, that is, a string of at
least 1 and at most 8 alphabetic characters followed by any number of
subtags that are a hypen followed by at least 1 and at most 8
alphabetic or digit characters. RFC-3066 also specifies what
particular strings may appear based on country codes, etc., but these
constraints are not enforced here.
literal-property-element source attributes text => |
source—a cxml:source
attributes—an alist
text—a string
Literal-property-element emits the triple corresponding to the literal
property element. Text is the literal text of the literal property.
Attributes is the alist of attributes of the property-element that
originally contained text.
membership-fragment fragment => boolean
fragment—a string or NIL
Membership-fragment-p returns true if fragment is of the form "_n
where n is a decimal integer greater than zero with no leading
zeros." (RDF/XML Syntax Specification, Section 5.1)
membership-property-element-p xuri => boolean
xuri—a uri designator
Membership-property-element-p returns true if the designated URI is
either rdf:li or of the form rdf:_n where n standard for a sequence of
base-10 digits.
merge-uris uri base => interned-uri
uri, base—uri designators
interned-uri—a uri
merge-uris is a convenience function that merges uri and base and
interns the result.
node-element source => node
source—a cxml source
Node-element processes the source’s current node. Source should be at
a :start-element, and the element should correspond to a node. Triples
represented in the node will be emitted. The node is returned.
node-element-components source => property-attributes, this
source—a cxml:source
property-attributes—an alist
this—a blank node or a URI
Node-element-components returns an alist of the property-attributes on
the element at which source should be positioned, and a blank node or
URI indicating the object that this node element represents. At most
one of rdf:ID, rdf:nodeID, and rdf:about should be specified, and an
error is signalled if more than one is specified. An error is also
signalled if any the URI of any attribute is not a valid
property-attribute URI.
node-element-list source &key collect => [nodes]
source—a cxml-source
Node-element-list processes a node element list, corresponding to
production 7.2.10, ws* (nodeElement ws*)*. If collect is non-nil, then
the nodes are collected and returned.
node-element-subject this base => result
this—a cons, or nil
source—a cxml:source
Node-element-subject returns the object designated by this (the second
return value of node-element-attributes) and base. If this is null,
then a blank-node is returned. Otherwise, the car of this should be
either +rdf-node-id+, +rdf-about+, or +rdf-id+, and result is
determined as follows: If the uri is +rdf-node-id+, then a blank node
with an id is returned, where the id is the cdr of this. If the uri is
+rdf-about+, then the cdr of the this is mergedd with base. If uri is
+rdf-id+, then the cdr of this is added as a fragment to base.
node-element-uri-p xuri => boolean
xuri—a URI designator
Node-element-uri-p determines whether the designated URI is a valid
node element URI. Node element URIs are all URIs except core syntax
terms, rdf:li, and old RDF terms.
non-parse-type-property-element source => |
source—a cxml:source
If a property element does not specify the rdf:parseType attribute,
then the property-element is parsed with either
resource-property-element, literal-property-element, or
empty-property-element. Resource-property-element matches in the case
that there is a single element within the property-element,
literal-property-element matches when there is only text content
within the property-element, and empty-property-element matches when
there is no content whatsoever within the property-element.
old-term-p object => boolean
old-term-p returns true if object is in +old-terms+.
parse-type-collection-property-element source => |
source—a cxml source
parse-type-collection-property-element processes the content of a
property element that has parseType="Collection". Triples are
emitted that describe the sequence of nodes within the property
element.
parse-type-literal-property-element source => |
source—a cxml source
Parse-type-literal-property-element binds *object* to a typed literal
whose type is rdf:XMLLiteral, and whose content is the text content of
the current element. If the current element has an rdf:ID attribute,
then the triple is reified with the ID.
parse-type-property-element-id source => id
source—a cxml:source
id—a URI or nil
Elements that specify the rdf:parseType attribute may only have one
other attribute, rdf:ID. This function extracts the value of the
rdf:ID attribute if specified and returns a URI which is the base uri
with the value of the ID attribute as a fragment id or nil if there is
no such attribute. An error is signalled if rdf:ID is specified more
than once, or if an attribute other than rdf:parseType or rdf:ID is
specified.
parse-type-resource-property-element source => |
source—a cxml source
parse-type-resource-property-element processes a property element with
parseType Resource, according to production 7.2.18.
peek-skipping-comments source => result*
souce—a cxml:source
Peek-skipping-comments returns the same values that klacks:peek
returns, with the exception that if the next event from source is
:comments, the event is consumed. The values of the first non-comment
event are returned.
prefixp prefix sequence => boolean, properp
prefix, string—sequences
properp—a boolean
prefixp returns true if prefix is a prefix of sequence. Elements of
prefix and sequence are compared using test. A second value, properp,
is true when the length of the prefix is less than the length of the
sequence, regardless of whether prefix is actually a prefix of
sequence.
prompt-for-line message &rest args => line, okp
message—a format control
args—format arguments for message
line—a string
okp—a boolean
Prompt-for-line displays the prompt specified by message and args on
*query-io* and reads a line from *query-io*. If the reading is
successful, the line is returned and okp is true. If reading fails,
say, from an EOF, then line is the empty string, and okp is false.
prompt-for-uri => result
result—a list of two values.
prompt-for-uri returns the list of values that result from invoking
prompt-for-line with the message "Enter a URI:".
property-attribute-uri-p xuri => boolean
xuri—a URI designator
Property-attribute-uri-p determines whether the designated URI is a
valid property attribute URI. Property attribute URIs are all URIs
except core syntax terms, rdf:Description, rdf:li, and old RDF terms.
property-element source => |
source—a cxml source
Property-element processes the current property element, according to
production 7.2.14. There are actually a number of different kinds of
property elements that can appear, and so process-property element
processes enough of the element to determine which type, and then
dispatches to more specific property element processing functions.
property-element-list source => |
source—a cxml source
Property-element-list processes a property element list, corresponding
to production 7.2.13, ws* (propertyElt ws*)*.
property-element-uri-p xuri => boolean
xuri—a URI designator
Property-element-uri-p determines whether the designated URI is a
valid property element URI. Property element URIs are all URIs except
core syntax terms, rdf:Description, and old RDF terms.
rdf-name-p xuri => boolean
xuri—a URI designator
Rdf-name-p returns true if the designated URI is an RDF name,
including the infinite set of rdf:_n names.
rdf-namespace-prefixed xuri => boolean
xuri—a uri designator
Rdf-namespace-prefixed-p returns true if xuri is prefixed with
+rdf-namespace+.
reify-triple triple-uri => |
triple-uri—a PURI URI
Reify-triple emits the four triples that reify the triple <*subject*
*predicate* *object*>. Triple-uri is the URI of the reified triple.
resource-property-element source attributes => |
source—a cxml:source
attributes—an alist
resource-property-element finished the processing of a resource
property element that should have begun with
non-parse-type-property-element. source should be positioned at the
:start-element of the node element within the property-element.
resource-property-element does not consume trailing whitespace after
the node element. The only attribute permitted on the resource
property-element is rdf:ID, and an error is signalled if other
attributes are specified, or rdf:ID is specified more than once.
strcat string* => string
strings, string—strings
strcat returns the concatentation of the strings.
syntax-term-p object => boolean
syntax-term-p returns true if object is a syntax term (a core syntax
term, rdf:Description, or rdf:li).
unique-attributes attributes source => uniques
attributes, uniques—associaation lists
source—a cxml:source
Unique-attributes returns an association list that no entries with the
same key. The entries of the new association list are those of the
original association list, but in the event that a duplicate is
detected, an error of type duplicate-attribute is signalled, and
various options are provided.
xml-attribute-p attribute => boolean
attribute—a sax:attribute
Xml-attribute-p returns true if attribute has a prefix that begins
with "xml", or if the attribute has no prefix and the attribute’s
local name begins with "xml". or if attribute satisfies
xml-lang-attribute-p.
xml-lang-attribute-p attribute => boolean
attribute—a sax:attribute
xml-lang-attribute-p returns true if attribute has a local-name
"name" and a namespace-uri +xml-namespace+.
xml-whitespace-p string => boolean
string—a string-designator
xml-whitespace-p returns true if every element of the string is an XML
whitespace character (i.e., is #x20, #x9, #xD, or #xA), or if string is
the empty string.
prohibited-attribute
)) ¶duplicate-attribute
)) ¶invalid-attribute-value
)) ¶mutually-exclusive-attributes
)) ¶unexpected-characters
)) ¶non-namespaced-name
)) ¶name
.
rdf-prefixed-non-rdf-name
)) ¶name
.
other-parse-type
)) ¶illegal-namespace-name
)) ¶rdfxml-error
)) ¶invalid-language-tag
)) ¶tag
.
invalid-attribute-value
)) ¶Jump to: | A B C D E F G I L M N O P R S T U V W X |
---|
Jump to: | A B C D E F G I L M N O P R S T U V W X |
---|
Jump to: | *
+
A C D I L N P S T U V |
---|
Jump to: | *
+
A C D I L N P S T U V |
---|
Jump to: | B C D F I L M N O P R S T U |
---|
Jump to: | B C D F I L M N O P R S T U |
---|