Posts

Sratom 0.4.4

Sratom 0.4.4 has been released. Sratom is a small library for serialising LV2 atoms to and from RDF, for converting between binary and text or storing in a model. For more information, see http://drobilla.net/software/sratom.

Changes:

  • Escape invalid characters when writing paths as URIs
  • Fancier printing without subject and predicate

Sratom 0.4.2

Sratom 0.4.2 has been released. Sratom is a small library for serialising LV2 atoms to and from RDF, for converting between binary and text or storing in a model. For more information, see http://drobilla.net/software/sratom.

Changes:

  • Disable timestamps in HTML documentation for reproducible build
  • Fix memory leaks
  • Fix serialisation of nested tuples
  • Update to waf 1.7.9 and autowaf r90 (install docs to versioned directory)
  • Use new sord API to clean up and shrink code

Sord 0.12.0

Sord 0.12.0 has been released. Sord is a lightweight C library for storing RDF statements in memory. For more information, see http://drobilla.net/software/sord.

Changes:

  • Add sord_get() for easily getting single property values
  • Update to waf 1.7.9 and autowaf r90 (install docs to versioned directory)
  • 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 Node::to_serd_node()
  • sordmm.hpp: Add convenient constructors for decimal and integer literals
  • sordmm.hpp: Don't automatically add RDF namespace prefix to world

Serd 0.18.2

Serd 0.18.2 has been released. Serd is a lightweight C library for RDF syntax which supports reading and writing [Turtle][], [TriG][], [NTriples][], and [NQuads][]. Serd is suitable for performance-critical or resource-limited applications, such as serialising very large data sets or embedded systems.

Changes:

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

Sord 0.10.4

Sord 0.10.4 has been released. Sord is a lightweight C library for storing RDF statements in memory. For more information, see http://drobilla.net/software/sord.

Changes:

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

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.

Sratom 0.4.0

Sratom 0.4.0 has been released. Sratom is a small library for serialising LV2 atoms to and from RDF, for converting between binary and text or storing in a model. For more information, see http://drobilla.net/software/sratom.

Changes:

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

Sord 0.10.0

Sord 0.10.0 has been released. Sord is a lightweight C library for storing RDF statements in memory. For more information, see http://drobilla.net/software/sord.

Changes:

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

Serd 0.18.0

Serd 0.18.0 has been released. Serd is a lightweight C library for RDF syntax which supports reading and writing [Turtle][], [TriG][], [NTriples][], and [NQuads][]. Serd is suitable for performance-critical or resource-limited applications, such as serialising very large data sets or embedded systems.

Changes:

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

Sratom 0.2.0

Sratom 0.2.0 has been released. Sratom is a small library for serialising LV2 atoms to and from RDF, for converting between binary and text or storing in a model. For more information, see http://drobilla.net/software/sratom.

« Page 5 / 6 »