Sord 0.12.0

Sord 0.12.0 is out. Sord is a lightweight C library for storing RDF statements in memory.

Changes:

  • Add sord_get() for easily getting single property values
  • sord_validate: Pass type check when range is xsd:anyURI and value is a URI
  • sord_validate: Support any subClassOf rdf:Property, not just baked-in ones
  • sordmm.hpp: Add convenient constructors for decimal and integer literals
  • sordmm.hpp: Add Node::to_serd_node()
  • sordmm.hpp: Don’t automatically add RDF namespace prefix to world
  • Update to waf 1.7.9 and autowaf r90 (install docs to versioned directory)

(Flattr this)

Serd 0.18.2

Serd 0.18.2 is out. Serd is a lightweight, high-performance, dependency-free C library for RDF syntax which supports reading and writing Turtle and NTriples.

This release fixes a few potential crashes caused by garbage input, and incorrect abbreviation of rdf:type in subject and object position.

Changes:

  • Fix crash when serd_node_new_decimal is called with infinity or NaN
  • Fix crash when resolving against non-standard base URIs
  • Fix bug that caused “a” abbreviation in non-predicate position
  • Disable timestamps in HTML documentation for reproducible build
  • Fix clashing symbol “error” in amalgamation build
  • Update to waf 1.7.8 and autowaf r90 (install docs to versioned directory)

(Flattr this)

Sord 0.10.4

Sord 0.10.4 is out. Sord is a lightweight C library for storing RDF statements in memory.

This release updates sord_validate to properly implement datatype validation as described in my previous post.

Changes:

  • Implement better data type validation in sord_validate conformant with the XSD and OWL specifications
  • Fix memory leaks in sord_validate
  • Install sord_validate man page
  • Disable timestamps in HTML documentation for reproducible build

(Flattr this)

How to define a datatype in RDF

I had to do some digging around to figure out how to define a new Datatype with restrictions in RDF, so I thought it might make a useful post to save someone else the trouble in the future.

RDF datatypes are based on XSD datatypes, which are often used directly. Unfortunately, most implementations simply have the XSD types baked in and do not support or validate new datatype descriptions (though at least sord_validate can). Regardless, it is sometimes necessary to define a datatype with a specific restriction so it can be machine validated. It’s a bit tricky to figure out how to do this, since everything is buried in specifications that aren’t as triple oriented as they should be. So, here is an example of defining a datatype restricted by regular expression in Turtle, derived from the OWL documentation:

<http://example.org/CSymbol>
	a rdfs:Datatype ;
	rdfs:comment "A symbol in the C programming language" ;
	owl:onDatatype xsd:string ;
	owl:withRestrictions (
		[
			xsd:pattern "[_a-zA-Z][_a-zA-Z0-9]*"
		]
	) .

The XSD specification defines several constraining facets you can use in this way. See the XSD specification for details, but the most obvious and useful for RDF are: xsd:length, xsd:minLength, xsd:maxLength, xsd:pattern, xsd:maxInclusive, xsd:maxExclusive, xsd:minInclusive, xsd:minExclusive. For example, you can define a numeric type with restricted range like so:

<http://example.org/AnswerishInteger>
	a rdfs:Datatype ;
	rdfs:comment "An integer between 24 and 42 inclusive" ;
	owl:onDatatype xsd:integer ;
	owl:withRestrictions (
		[
			xsd:minInclusive 24
		] [
			xsd:maxInclusive 42
		]
	) .

Defining datatypes in this way and using them as the rdfs:range for properties is a good idea because it describes which values are valid in a machine readable way. This makes it possible for simple generic tools to validate data, ensuring that all literals are valid values for the property they describe.

(Flattr this)

Sratom 0.4.0

Sratom 0.4.0 is out. Sratom is a small C library for serialising LV2 atoms to/from Turtle.

This release fixes reading objects with several rdf:type properties, and adds support for serialising blank nodes more elegantly, particularly useful for serialising messages to and from plugins for human inspection, storage, or network transmission. API has been added, but it remains backwards compatible with all previous releases.

Changes:

  • Correctly read objects with several rdf:type properties
  • Support writing Object Atoms as top level descriptions if subject and predicate are not given
  • Fix various hyper-strict warnings
  • Upgrade to waf 1.7.2

(Flattr this)

Sord 0.10.0

Sord 0.10.0 is out. Sord is a lightweight C library for storing RDF statements in memory.

This release contains significant performance improvements, fixes problems with static builds, and adds to the API, though it remains compatible with all previous versions.

Changes:

  • Add error callback to world for custom error reporting
  • Performance and space (per node) improvements
  • SSE4.2 accelerated hashing for node interning, where available
  • Make all ‘zix’ symbols private to avoid symbol clashes in static builds
  • Remove problematic “Loaded n statements” output from serdi
  • Strip down API documentation to a single clean page
  • Fix various hyper-strict warnings
  • Do not require a C++ compiler to build
  • Add option to build utilities as static binaries
  • Upgrade to waf 1.7.2
  • sordmm.hpp: Add indices and graphs parameters to Model constructor
  • sordmm.hpp: Remove overzealous URI scheme assertion
  • sordmm.hpp: Correctly handle Sord::Node self-assignment

(Flattr this)

Serd 0.18.0

Serd 0.18.0 is out. Serd is a lightweight dependency-free C library for RDF syntax which supports reading and writing Turtle and NTriples.

This release contains numerous improvements and makes additions to the API, but remains backwards compatible with all previous releases.

Changes:

  • Support digits at start of local names as per new Turtle grammar
  • Add incremental read interface suitable for reading from infinite streams
  • Add -e option to serdi to use incremental reading
  • Add error callback to reader and writer for custom error reporting
  • Add -q option to serdi to suppress all non-data output, e.g. errors
  • Reset indent when finishing a write
  • Report write size correctly when invalid UTF-8 is encountered and a replacement character is written
  • Strip down API documentation to a single clean page
  • Fix various hyper-strict warnings
  • Do not require a C++ compiler to build
  • Add option to build utilities as static binaries
  • Upgrade to waf 1.7.2
  • Support digits at start of local names as per new Turtle grammar

(Flattr this)

Lilv 0.14.0

Lilv 0.14.0 is out. Lilv is a library to make the use of LV2 plugins as simple as possible for applications.

This release includes many improvements, most notably built-in support for saving/restoring plugin state (including powerful non-destructive saving of plugin state which contains files), as well as many bug and portability fixes.

Changes:

  • Add lilv_plugin_get_extension_data
  • Use path variables in pkgconfig files
  • Install man page to DATADIR (e.g. PREFIX/share/man, not PREFIX/man)
  • Make Lilv::uri_to_path static inline (fix linking errors)
  • Use correct URI for dcterms:replaces (for hiding old plugins): “http://purl.org/dc/terms/replaces”
  • Fix compilation on BSD
  • Only load dynmanifest libraries once per bundle, not once per plugin
  • Fix lilv_world_find_nodes to work with wildcard subjects
  • Add lilv_plugin_get_related to get resources related to plugins that are not directly rdfs:seeAlso linked (e.g. presets)
  • Add lilv_world_load_resource for related resources (e.g. presets)
  • Print presets in lv2info
  • Remove locale smashing kludges and use new serd functions for converting nodes to/from numbers.
  • Add LilvState API for handling plugin state. This makes it simple to save and restore plugin state both in memory and on disk, as well as save presets in a host-sharable way since the disk format is identical to the LV2 presets format.
  • Update old references to lv2_list (now lv2ls)
  • Support compilation as C++ under MSVC++.
  • Remove use of wordexp.
  • Add lilv_plugin_get_port_by_designation() and lilv_port_get_index() as an improved generic alternative to lilv_plugin_get_latency_port_index().
  • Add lilv_plugin_get_project() and get author information from project if it is not given directly on the plugin.

(Flattr this)

Sratom 0.2.0

Sratom is a new C library for serialising LV2 atoms to/from Turtle. It is intended to be a full serialisation solution for LV2 atoms, allowing implementations to serialise binary atoms to strings and read them back again. This is particularly useful for saving plugin state, or implementing plugin control with network transparency. Sratom uses Serd and Sord to do the work, it is a small library implemented in a single source file, suitable for direct inclusion in projects if avoiding a dependency is desired.

Download Sratom 0.2.0

(Flattr this)

Sord 0.8.0

Sord 0.8.0 is out. Sord is a lightweight C library for storing RDF statements in memory.

This release fixes some minor bugs, adds some convenient API (though the API is compatible with all previous releases), and adds a sord_validate tool which can be used to validate RDF data against RDFS/OWL schemas.

Changes:

  • Use path variables in pkgconfig files
  • Install man page to DATADIR (e.g. PREFIX/share/man, not PREFIX/man)
  • Tolerate serd passing NULL nodes to reader callback (serd 0.6.0)
  • Fix comparison of typed literals
  • Take advantage of interning in sord_node_equals()
  • Support compilation as C++ under MSVC++.
  • Add sord_iter_get_node()
  • Refuse to intern relative URIs in sord_new_uri*()
  • Add sord_new_relative_uri()
  • Add SordInserter for writing to a model via Serd sink functions.
  • Add convenient sord_search(), sord_ask(), and sord_count()
  • Add sord_validate tool for validating data against RDF/OWL schemas

(Flattr this)