Overview Usage Downloads

CL-RDFXML, RDF/XML Parser for Common Lisp

Overview

There are now a number of libraries for processing some of the technologies upon which RDF/XML is built. Particularly, Closure XML is a robust, mature XML parser, and manipulation of URIs is easy using Puri.

This RDF/XML parser builds upon these libraries so as to minimize the amount of code that is not directly related to parsing RDF/XML, and provides a simple interface for extracting triples from RDF/XML documents.

Usage

This parser is designed to be easy to use. It is distributed as an ASDF package, so getting it up and running should be as simple as:

CL-USER> (load #P".../cl-rdfxml.asd")
CL-USER> (asdf:oos 'asdf:load-op '#:cl-rdfxml)

Parsing a document is performed using cl-rdfxml:parse-document. cl-rdfxml:parse-document takes two arguments, the first is a function designator for a function that accepts three arguments, the second represents the is a value suitable to cxml:make-source. For each triple in the graph, the provided function (the first argument) is called with three arguments, the subject, predicate, and object of the triple.

URIrefs in the graph are interned PURI URIs, and are comparable with eq. Blank nodes are represented by blank node objects which may have an id, local with respect to calls to parse-document (i.e., local to a single graph). Blank nodes are comparable under object equality, that is, using eq. Literals, both plain (with optional language tags) and typed are interned globally, and so are comparable by eq, even across graphs.

Downloads

Get the latest version, or browse the source.