Search the web
Sign In
New User? Sign Up
jena-dev · Jena Developers
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want to share photos of your group with the world? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
error loading N3 in Jena 2.6   Message List  
Reply | Forward Message #40802 of 42352 |
RDFReaderFImpl design

This is a FYGI concerning design decisions about I/O global settings in
Jena.

=====

Back in Jena 1 days, the issue of scope of the I/O subsystems was one
that I thought was questionable; and we decided not to change it in the
Jena 1 to Jena 2 migration.

I think the recent issues with the N3 and Turtle I/O at least gives some
data about the design choices.

In the TopBraid Suite, we are prepared to say that we are the king pin,
and to make global decisions about these; since TDB also makes such an
assumption, I ended up writing the following code snippet:


// force TDB initialization
TDB.init();
// overrule TDB's choice of N3/Turtle reader

String readerTTL =
org.topbraid.n3legacy.n3.N3JenaReader.class.getName() ;
RDFReaderFImpl.setBaseReaderClassName("N3", readerTTL) ;
RDFReaderFImpl.setBaseReaderClassName("TURTLE", readerTTL) ;
RDFReaderFImpl.setBaseReaderClassName("Turtle", readerTTL) ;
RDFReaderFImpl.setBaseReaderClassName("TTL", readerTTL) ;


Obviously as some of the fixes already in Jena SVN work there way
through to the jars, we will review these decisions; which deliberately
make us too lax in our N3 parsing.

Other than the observation that is ugly to have to access an Impl class
to do this, it is not clear that there is a design error here; but it is
also unclear that the design is correct.
This message is not meant to advocate any particular design.

A further observation is that one impact of the globals was that, given
our immediately presenting problem which we decided to fix by using the
Jena 2.5.7 N3JenaReader (renamed as above), the immediate behavior was
unpredictable, and caused us a further build/test cycle. The reason for
this was the initial fix missed out the TDB.init() and worked, accept in
situations in which we were using TDB. This took us a while to detect,
and then a bit longer until the stack trace got passed to the person who
had done the N3 fix (me!).

If at any point you would like to brainstorm this area of the design
further, I would be happy to join in.

Jeremy






Sat Jul 11, 2009 12:27 am

jeremy.carro...
Offline Offline
Send Email Send Email

Forward
Message #40802 of 42352 |
Expand Messages Author Sort by Date

Hello, I switched my Jena libraries to those distributed with TDB 0.8.1 (Jena 2.6.0, I believe). My code for loading RDF worked previously. model.read(in,...
David Donohue
schtickdisc
Offline Send Email
Jul 9, 2009
9:21 pm

... Oh yes! TDB now has it's own Turtle parser (N3 is parsed as Turtle nowadays in Jena) as well as it's own N-triples parser. They are faster - and...
Andy Seaborne
andyseaborne
Offline Send Email
Jul 9, 2009
10:18 pm

Thanks, Andy, your workaround worked perfectly for me. My how the loader has sped up! I continue to be amazed at your results and your service (it's late...
David Donohue
schtickdisc
Offline Send Email
Jul 10, 2009
2:48 am

Hi, I just noticed a similar problem when upgrading to TDB 0.8.1 and Jena 2.6.0. I have previously been loading N3 successfully, but now I get an exception ...
jmoscato
Offline Send Email
Jul 9, 2009
10:25 pm

Hello Andy, I just saw your reply in the middle of creating and sending my message. I'll try your suggested workaround and post the results. Thanks! John ... ...
jmoscato
Offline Send Email
Jul 9, 2009
10:33 pm

I still get the Bad IRI exception. I do a TDBFactory.createModel(), then your suggested workaround. Loading the N3 data happens after that, which is when I get...
jmoscato
Offline Send Email
Jul 9, 2009
10:56 pm

... I can't reproduce this - I wrote a datafile withj that IRI and it worked fine. Could you provide a small N3 data file that illustrates the problem? Also,...
Andy Seaborne
andyseaborne
Offline Send Email
Jul 10, 2009
11:01 am

This is a FYGI concerning design decisions about I/O global settings in Jena. ===== Back in Jena 1 days, the issue of scope of the I/O subsystems was one that...
Jeremy Carroll
jeremy.carro...
Offline Send Email
Jul 11, 2009
12:30 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help