[Mulgara-general] Loading N3 fails
David Legg
david.legg at searchevent.co.uk
Sun Dec 7 12:07:28 UTC 2008
Paul + Ron,
>>> I've noticed that I typically have to convert any N3 files into
>>> RDF/XML-ABBREV using Jena's jena.rdfcopy utility before the TQL shell
>>> will upload the file into the graph. I've even tried converting from N3
>>> to RDF and back to N3 again with no success. Is this a known issue?
>>>
>
> No it's not. Can you send an example file that is causing you problems please?
I've enclosed two files... placeTerms.n3 and placeTerms.rdf
The N3 file fails to load but the rdf file (which was converted using
Jena from the N3 file) loads successfully.
Here are the steps I took...
1. Started Mulgara and the TQL shell
2. Using the TQL shell I created a test graph:
TQL> create <rmi://localhost/server1#place>;
Successfully created graph rmi://localhost/server1#place
3. I then attempted to load the placeTerm.n3 file:
TQL> load local <file:/d:/temp/placeTerms.n3> into
<rmi://localhost/server1#place> ;
Error: Unable to load file:/d:/temp/placeTerms.n3 into
rmi://localhost/server1#place
4. I then attempted to load the RDF version:
TQL> load local <file:/d:/temp/placeTerms.rdf> into
<rmi://localhost/server1#place> ;
Successfully loaded 17 statements from
file:/d:/temp/placeTerms.rdf into rmi://localhost/server1#place
I know it is strange that the Jena conversion tool seems to have no
problem parsing N3 but the TQL shell does. Maybe the version of Jena I
used (2.5.5) is more recent than the parser used in Mulgara?
Out of interest I tried doing the same thing from the web interface
(because that gives a stack error when things go wrong) and got the
following (partial) stack trace:
Caused by: org.mulgara.resolver.spi.ResolverException: Unable to read input statements
at org.mulgara.resolver.store.StatementStoreResolver.modifyModel(StatementStoreResolver.java:379)
at org.mulgara.resolver.InternalResolver.modifyModel(InternalResolver.java:164)
at org.mulgara.resolver.SetModelOperation.execute(SetModelOperation.java:155)
at org.mulgara.resolver.MulgaraInternalTransaction.execute(MulgaraInternalTransaction.java:623)
... 26 more
Caused by: org.mulgara.query.TuplesException: Exception while reading file:/d:/temp/placeTerms.n3
at org.mulgara.content.n3.Parser.checkForException(Parser.java:533)
at org.mulgara.content.n3.Parser.getTriple(Parser.java:542)
at org.mulgara.content.n3.N3Statements.next(N3Statements.java:389)
at org.mulgara.resolver.store.StatementStoreResolver.modifyModel(StatementStoreResolver.java:351)
... 29 more
Caused by: java.lang.Error: Unsupported N3 parser token type: 13
at org.mulgara.content.n3.Parser.toNode(Parser.java:397)
at org.mulgara.content.n3.Parser.quad(Parser.java:294)
at com.hp.hpl.jena.n3.N3AntlrParser.emitQuad(N3AntlrParser.java:66)
at com.hp.hpl.jena.n3.N3AntlrParser.objectList(N3AntlrParser.java:749)
at com.hp.hpl.jena.n3.N3AntlrParser.propValue(N3AntlrParser.java:622)
at com.hp.hpl.jena.n3.N3AntlrParser.propertyList(N3AntlrParser.java:336)
at com.hp.hpl.jena.n3.N3AntlrParser.statement0(N3AntlrParser.java:287)
at com.hp.hpl.jena.n3.N3AntlrParser.statement(N3AntlrParser.java:204)
at com.hp.hpl.jena.n3.N3AntlrParser.document(N3AntlrParser.java:153)
at com.hp.hpl.jena.n3.N3Parser.parse(N3Parser.java:54)
at org.mulgara.content.n3.Parser.run(Parser.java:236)
I think the key thing here is the 'Unsupported N3 parser token type:
13'. I don't know about you but '13' makes me think this is related to
Carriage Return characters and I think I've come across a message from
Alex somewhere mentioning this is a problem... but I can't find it again.
Regards,
David Legg
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: placeTerms.n3
URL: <http://lists.mulgara.org/pipermail/mulgara-general/attachments/20081207/47891ae8/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: placeTerms.rdf
Type: application/rdf+xml
Size: 1402 bytes
Desc: not available
URL: <http://lists.mulgara.org/pipermail/mulgara-general/attachments/20081207/47891ae8/attachment.rdf>
More information about the Mulgara-general
mailing list