W3C home > Mailing lists > Public > www-rdf-interest@w3.org > April 2002

n3s - A Notation3 Preprocessor

From: Sean B. Palmer <sean@mysterylights.com>
Date: Mon, 15 Apr 2002 01:55:13 +0100
Message-ID: <010a01c1e418$35f3c240$78bc0150@localhost>
To: <www-rdf-interest@w3.org>
n3s is a preprocessor and command line editor for the Notation3 [1]
serialization of RDF, written in Python [2], and available as a binary. It
converts abbreviated N3 into "proper" N3, pretty printing along the way -
getting rid of quirky whitespace and so on.

   Documentation: http://infomesh.net/2002/n3s/
   Source: http://infomesh.net/2002/n3s/n3s.txt

Example use:-

   $ n3s -s '{ ?x rdfs:label ?z } => { ?z :labelOf ?x }'

   @prefix : <#> .
   @prefix log: <http://www.w3.org/2000/10/swap/log#> .
   @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

   this log:forAll :z , :x .
   { :x rdfs:label :z } log:implies { :z :labelOf :x } .

It's for those of you who are sick of typing "@prefix log:..." constantly,
and always liked echo. Note that there are some other funky features, such
as the -i cmdline option (which can use a set of prefixes etc. from a
local/Web file); all documented, at the homepage.

Note also that n3s also understands the @keyword, @use, and @prefix default
constructs suggested by TimBL in [3]. Although I'm not quite sure of the
utility of these yet, I thought it would be a nice proof-of-concept to
implement them.

[1] http://www.w3.org/DesignIssues/Notation3
[2] http://www.python.org/
[3] "Re: n3 wishlist: automatic namespace selection"

Kindest Regards,
Sean B. Palmer
@prefix : <http://purl.org/net/swn#> .
:Sean :homepage <http://purl.org/net/sbp/> .
Received on Sunday, 14 April 2002 20:55:40 UTC

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