W3C home > Mailing lists > Public > www-rdf-interest@w3.org > August 2001

SWIPT: An RDF Parser/Tool in Python

From: Sean B. Palmer <sean@mysterylights.com>
Date: Wed, 8 Aug 2001 23:33:50 +0100
Message-ID: <007d01c1205a$6145e2c0$13dc93c3@z5n9x1>
To: <www-rdf-interest@w3.org>
Cc: <swi-dev@yahoogroups.com>, <Sem-Web@yahoogroups.com>
Hi Everyone,

This is a tentative release of the SWIPT RDF parser and toolbox in
Python. Details can be found at:-


SWIPT is built upon a number of new and existing Python hacks, and can
input and output a mixture of XML RDF, -spart N3, N-Triples, and SURF
[1] depending on the command line and how the file is configured.

SWIPT is in a very early stage of development, but is already a useful
tool. All input formats are parsed using a variety of parsers (3 for
N3-like formats (one doesn't work...), 2 for SURF, and one for XML
RDF), and stored into an internal Python list. The Python list,
implemented as a class (Doc), has a number of functions which can be
used, including counting the number of triples, appending a triple,
output as XRDF/SURF/N3, merging (experimental), filtering (buggy), and
simple inferences (it has a lite version of the RDF Lint [2] files
(being) built into it).

Simple example usage; convert the "x.rdf" XML RDF file into a SURF
file called "x.surf":-

   python swipt.py x.rdf -surf > x.surf

More tutorials and documentation will be forthcoming; think of this as
a pre-release.

For now, I'd be happy to hear suggestions, questions, improvements,
and other feedback. Doubtless, there are many things which need
improving, but the framework is as modularized and extensible as I
could make it, so it is very easy to customize to perform certain
tasks. In time, I'd like to add these as command line flags.

Many thanks to Aaron Swartz for a) teaching me a lot about Python, and
b) writing the SURFBoard handler and NTriples class, and to DanC and
TimBL for the excellent SWAP tools (notation3.py and SAX2RDF).

[1] SURF is basically a recasting of N-Triples in XML, under
development by SWAG.
[2] http://infomesh.net/2001/05/rdflint/

Kindest Regards,
Sean B. Palmer
@prefix : <http://webns.net/roughterms/> .
:Sean :hasHomepage <http://purl.org/net/sbp/> .
Received on Wednesday, 8 August 2001 18:33:11 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:44:31 UTC