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

Re: n3s - A Notation3 Preprocessor

From: <tony_hammond@harcourt.com>
Date: Tue, 16 Apr 2002 12:11:49 +0100
To: "Sean B. Palmer" <sean@mysterylights.com>
Cc: www-rdf-interest@w3.org
Message-ID: <OF2862F7BD.B81972AE-ON80256B9D.003CB5CA@harcourtbrace.com>

Sean:

Thanks - really nice peace of work. Course I tripped up with inline
commments before I noticed your limitations on the document page. One
question: Would you not consider an option to pass comments through to the
output which since you're pretty printing I'm assuming you're also
intending this to be for human consumption?

Tony




                                                                                                                     
                    "Sean B. Palmer"                                                                                 
                    <sean@mysterylights.c       To:     <www-rdf-interest@w3.org>                                    
                    om>                         cc:                                                                  
                    Sent by:                    Subject:     n3s - A Notation3 Preprocessor                          
                    www-rdf-interest-requ                                                                            
                    est@w3.org                                                                                       
                                                                                                                     
                                                                                                                     
                    15/04/2002 01:55                                                                                 
                                                                                                                     
                                                                                                                     




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"
http://www.w3.org/2002/02/mid/003301c1c621$15be54a0$84001d12@w3.org

--
Kindest Regards,
Sean B. Palmer
@prefix : <http://purl.org/net/swn#> .
:Sean :homepage <http://purl.org/net/sbp/> .
Received on Tuesday, 16 April 2002 07:14:59 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:51:53 GMT