W3C home > Mailing lists > Public > public-openannotation@w3.org > August 2012

Re: Looking for complacent RDF/XML <--> N3 converters

From: Sebastian Hellmann <hellmann@informatik.uni-leipzig.de>
Date: Sat, 18 Aug 2012 09:34:10 +0200
Message-ID: <502F4572.9090204@informatik.uni-leipzig.de>
To: Bob Morris <morris.bob@gmail.com>
CC: public-openannotation <public-openannotation@w3.org>
Dear Bob,
quite frankly said, you are asking too much. If I were to build an RDF 
parser, I would optimize the data structure and my first idea would be 
Nodes with a HashMap PropertyName->HashSet of Objects for triples, 
losing the order immediately (unordered is faster than ordered, O(1) on 
insert and polling ). I would assume that most parser are implemented 
this way, especially because ordering of triples is a really exotic 
requirement. Note that it is you that searches for a parser that does 
impose *your* own opinion on how the triples should be handled, not the 
other way round.

The only thing that might be close to what you require is an RDF parser, 
that is capable of streaming. This will preserve the order of triples 
(mostly).   The one that comes to my mind is OpenRDF Sesame, but then 
RDF stream readers are all developer libraries. They are pointless for 
web services as the data is transfered as a whole during request.

Maybe you should re-evaluate your own methods of handling and working 
with RDF. You could use Jena Eyeball [1] for example instead of your own 
eyeballs for validating data.
  Sounds like you need a tool that does a diff operation? Here is a list 
of tools, that I use:

I write RDF with Geany in Turtle (because of autocompletion)
- http://www.geany.org/

I convert/validate with
- Rapper http://librdf.org/raptor/rapper.html
- rdf.sh https://github.com/seebi/rdf.sh  (Note the RDF diff function)
- Jena Eyeball http://jena.sourceforge.net/Eyeball/
- Jena CLI http://jena.sourceforge.net/tools.html
- Pellet /  Pellint http://clarkparsia.com/pellet / 

If you have a Mac / Linux, then you can use them from the command line.

all the best,

[1] http://jena.sourceforge.net/Eyeball/

Am 18.08.2012 04:51, schrieb Bob Morris:
> I'm looking for a conversion tool between various RDF
> serializations---at least XML and N3---that doesn't impose its own
> opinions of how predicate clauses should be ordered, what if anything
> is the default prefix, etc.  I'd prefer a web service.
> I only know of two conversion web services:
> http://www.rdfabout.com/demo/validator/  and
> http://www.mindswap.org/2002/rdfconvert/
> When converting XML to N3, the mindswap tool gratuitously puts
> attributes in an order of its own choosing seemingly unrelated to the
> order presented in the XML. It also makes a mysterious choice of a
> default prefix, when no default namespace was indicated in the RDF/XML
> The rdfabout tool behaves similarly but doesn't choose a default prefix.
> OK, OK. Order is irrelevant in these cases from the RDF point of view.
>   But in both cases, my (pretty small), machine generated annotations
> have an order that corresponds to an (equally irrelevant) order that
> is in underlying data for the annotation, and eyeball debugging would
> be easier if all the players keep the same order. And I could also
> believe that preserving that order might be quadratic if the input
> parser is ordering things by its parse tree or something.  But am I
> asking too much?
> Bob

Dipl. Inf. Sebastian Hellmann
Department of Computer Science, University of Leipzig
   * http://sabre2012.infai.org/mlode (Leipzig, Sept. 23-24-25, 2012)
   * http://wole2012.eurecom.fr (*Deadline: July 31st 2012*)
Projects: http://nlp2rdf.org , http://dbpedia.org
Homepage: http://bis.informatik.uni-leipzig.de/SebastianHellmann
Research Group: http://aksw.org
Received on Saturday, 18 August 2012 07:34:39 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 18 August 2012 07:34:40 GMT