Re: N-Triples Parser for Python

On Oct 20, 2004, at 4:07 AM, Ivan Herman wrote:

> As a user of Python and (at this moment, sorry Sean...) of rdflib, I 
> would love to see a Python/RDF environment improve! What I would like 
> to have is an RDQL (or should I say these days SPARQL?) layer.
>
> I actually did something on top of RDFLIB, see:
>
> http://www.ivan-herman.net/Python/rdqlDesc.html

Very nice to see some code for doing higher level queries with rdflib, 
great start Ivan. Certainly an area where some joint effort could be 
very effective.

> (there are some other stuffs in rdflibUtils, too, some of them may not 
> be really important). I plan to change this utility to be closer to 
> SPARQL soon (maybe this week).

Looking at rdflibUtils there are at least a couple methods that could 
be pushed down into rdflib, if desired. In particular, 
getPredicateValue and getPredicateSubject are similar to cwm's 
each/any/the methods which have come up in rdflib cwm api convergence 
discussions [1].


> What I did was a quick hack on the top of rdflib, to check how useful 
> something like that is for everyday use (it is VERY useful!). I am 
> sure that a more careful implementation that takes into account the 
> internals of rdflib might be much more efficient.

Your implementation and input is a great start for an eventual full 
blown implementation. I look forward to integrating such an 
implementation with rdflib and/or helping with its implementation. In 
particular, I'd like to help implement SPARQL once it starts to settle 
down some so that we have an RDF in Python implementation when the spec 
comes out.

> I am happy to play a guinea pig for testing...

Excellent!

> Ivan

And I'm happy to maintain rdflib as a stable library which people can 
build upon and also stabilize/incorporate any additional functionality 
people are willing to contribute.

eikeon, http://eikeon.com/

[1] 
http://rdfig.xmlhack.com/2004/03/30/2004-03-30.html#1080608148.345108


>
> Sean B. Palmer wrote:
>> I know I've written several N-Triples parsers before, but this one has
>> been particularly carefully crafted:
>>    http://inamidst.com/proj/rdf/ntriples.py
>>    - N-Triples Parser in python, 2004-10
>> It takes in buffered streams, deploys a customised readline method to
>> parse N-Triples's CRLF/CR/LF line-endings, does a recursive descent
>> parse on the lines, and then does string unescaping in as
>> specification compliant a manner as possible.
>> But I'm announcing this mainly because it's the first glimpse of the
>> fruits of a new labour of mine: both Daniel 'eikeon' Krech [BCC'd] and
>> I have been working on Python RDF APIs independently for some years
>> now, and we're finally just *starting* to look at one another's work.
>> Having done a prima facie comparison of our major toolkits, rdflib [1]
>> and pyrple [2], I've come to the conclusion that they both make up for
>> one another's deficiencies well, and that a joint effort--if
>> possible--might be an excellent step forwards for RDF in Python.
>> If any folk--especially rdflib and pyrple users--have comments, ideas,
>> or requests about any of the things mentioned in this email, they'd be
>> very gratefully received.
>> Cheers,
>> [1] http://rdflib.net/
>> [2] http://infomesh.net/pyrple/
>
> -- 
>
> Ivan Herman
> W3C Communications Team, Head of Offices
> C/o W3C Benelux Office at CWI, Kruislaan 413
> 1098SJ Amsterdam, The Netherlands
> tel: +31-20-5924163; mobile: +31-641044153;
> URL: http://www.w3.org/People/all?pictures=yes#ivan

Received on Thursday, 21 October 2004 01:58:34 UTC