Saturday, 21 August 2004
sparta.py 0.5: RDF made easy
Version 0.5 of sparta.py is now available; with this release, I think it’s roughly feature-complete.
sparta is a Python wrapper API for RDF libraries that allows you to easily access and manipulate RDF data. In particular, it now:
- makes RDF properties available as object attributes that can be get, set and deleted
- coerces literals’ types to the appropriate Python types
- exposes RDF lists as Python lists
A couple of non-compatible changes have been made in this round. By default, properties are exposed as generators. However, if the owl:maxCardinality of that property is “1”, it will be exposed as a simple, non-generator value. Also, typing is no longer inferred by the rdf:type of a property; it’s now inferred by its rdfs:range*.
Once again, this is experimental software, and isn’t yet ready for production use; use at your own risk.
* I understand that the use of rdfs:range to type a literal is somewhat controversial; I get conflicting advice about whether it’s legal. However, I like it, and I don’t think it breaks anything; if anyone can give me a real-world use case where this specific use of it causes a problem, I’d love to hear about it.