mnot’s blog

Design depends largely on constraints.” — Charles Eames

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:

See spartaTest.py and its output, spartaTest.txt for more information. Note that I said “RDF libraries” above; the next step for sparta is to wrap Redland as well as rdflib.

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.


Filed under: Python Semantic Web

1 Comment

Kendall Clark said:

Hmm, I'm looking at this and thinking that, eventually, like when we're done with DAWG, sparta could be the basis of a new kind of object-relational mapper for Python; i.e., object-graph mapper. That is, this kind of interface could shield most folks from learning much, if any DAWG query language. Well, perhaps.

Neat stuff, Mark. Should go into rdflib distribution eventually, IMO.

Friday, August 27 2004 at 8:03 AM +10:00

Creative Commons