Simple RDF store and RDF/Turtle parser/serialiser written in Standard ML
606236f5d8fc — Chris Cannam default tip a month ago
Use category logger
c39c10d29da1 — Chris Cannam 2 months ago
Make this message a bit more informative
b2151637c816 — Chris Cannam 3 months ago
Update Repoint

heads

tip
browse log

clone

read-only
https://hg.sr.ht/~cannam/sml-ttl
read/write
ssh://hg@hg.sr.ht/~cannam/sml-ttl

#sml-ttl

#Simple RDF store and RDF/Turtle parser/serialiser written in Standard ML

https://hg.sr.ht/~cannam/sml-ttl

This is an in-memory RDF triple store and RDF/Turtle parser/serialiser written in Standard ML.

This library provides:

  • A 100% spec-compliant RDF/Turtle parser with fair performance

  • An RDF/Turtle serialiser

  • A simple single-graph datastore capable of doing reasonably quick indexed lookups (but not SPARQL queries)

The Turtle parser passes all current W3C spec tests at the time of writing. The serialiser successfully serialises all of the test files (plus some additional tests) such that they can be parsed in again.

An example program and a file conversion utility are included.

#To build

A Makefile is provided. Some additional SML libraries are pulled in at build time using Repoint.

To build and run tests using Poly/ML:

$ make

To build and run tests using MLton (slower compiling, faster runtime):

$ make release

You can build the bundled programs (e.g. example.sml, convert.sml) with MLton using the supplied .mlb files, so long as Repoint has pulled in the necessary dependencies (which the Makefile would do for you):

$ ./repoint install
$ mlton example.mlb
$ mlton convert.mlb

To extract the API documentation (must have smldoc installed, e.g. from the fork at https://github.com/cannam/smldoc ):

$ ./repoint install
$ make doc

The code has been tested with a number of compilers on various platforms:

  • Linux and macOS CI build using Poly/ML, MLton, and SML/NJ: Build Status
  • Windows CI build using SML/NJ: Build status

#Origin

Written by Chris Cannam, cannam@all-day-breakfast.com. MIT licence, see the file COPYING for details.

This code has something in common with the Yertle library I wrote a couple of years previously, which provided a very similar set of features in the Yeti language. Both were initially language-learning exercises.