Return-Path: X-Original-To: apmail-incubator-jena-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-jena-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D114078D7 for ; Mon, 26 Sep 2011 12:30:34 +0000 (UTC) Received: (qmail 92859 invoked by uid 500); 26 Sep 2011 12:30:34 -0000 Delivered-To: apmail-incubator-jena-dev-archive@incubator.apache.org Received: (qmail 92818 invoked by uid 500); 26 Sep 2011 12:30:34 -0000 Mailing-List: contact jena-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jena-dev@incubator.apache.org Delivered-To: mailing list jena-dev@incubator.apache.org Received: (qmail 92810 invoked by uid 99); 26 Sep 2011 12:30:34 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Sep 2011 12:30:34 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of laurent.pellegrino@gmail.com designates 209.85.210.41 as permitted sender) Received: from [209.85.210.41] (HELO mail-pz0-f41.google.com) (209.85.210.41) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Sep 2011 12:30:28 +0000 Received: by pzk5 with SMTP id 5so15310313pzk.0 for ; Mon, 26 Sep 2011 05:30:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=AFe8doHUuukQFN3MfeVVpY/MhU7/Qkxsuu0qs+Z2+9I=; b=eItNkVcVjrxexgSp9qDwXVzRUsfJ7t07wMIivoK/hupdq7wh/SixbkJMtcWS2Xr8MZ d+cAyBoWsaB7WHWm0V/ftlIpd2cSQPU4Y5qfIgQU3UsOQDEpoqcy9lGzd6IBYFmwZ+Fl tmNGhSeMbkyhe9vL1oBrLfm0LYCOMGeZ6DIl8= MIME-Version: 1.0 Received: by 10.68.19.6 with SMTP id a6mr29716542pbe.46.1317040207060; Mon, 26 Sep 2011 05:30:07 -0700 (PDT) Received: by 10.68.66.162 with HTTP; Mon, 26 Sep 2011 05:30:07 -0700 (PDT) Date: Mon, 26 Sep 2011 14:30:07 +0200 Message-ID: Subject: org.openjena.riot.RiotException: [line: X, col: Y] Too many items in a line From: Laurent Pellegrino To: jena-dev@incubator.apache.org Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked by ClamAV on apache.org Hi all, It seems that BIO does not work with some payload. I am trying to serialize/deserialize (with BIO) the node values of a quad which is parsed by a NQuads parser but I get: Exception in thread "main" org.openjena.riot.RiotException: [line: 2, col: 15] Too many items in a line. Expected 1 at org.openjena.riot.ErrorHandlerFactory$ErrorHandlerStd.fatal(ErrorHandlerFactory.java:110) at org.openjena.riot.lang.LangEngine.raiseException(LangEngine.java:157) at org.openjena.riot.lang.LangEngine.exceptionDirect(LangEngine.java:150) at org.openjena.riot.lang.LangEngine.exception(LangEngine.java:143) at com.hp.hpl.jena.sparql.engine.binding.BindingInputStream.access$400(BindingInputStream.java:70) at com.hp.hpl.jena.sparql.engine.binding.BindingInputStream$IteratorTuples.moveToNext(BindingInputStream.java:180) at com.hp.hpl.jena.sparql.engine.binding.BindingInputStream$IteratorTuples.moveToNext(BindingInputStream.java:139) at org.openjena.atlas.iterator.IteratorSlotted.hasNext(IteratorSlotted.java:55) at org.openjena.atlas.iterator.IteratorSlotted.next(IteratorSlotted.java:64) at com.hp.hpl.jena.sparql.engine.binding.BindingInputStream.next(BindingInputStream.java:129) The quadruple is correctly parsed but the deserialization fails. Hereunder is a test case: final List quadruples = new ArrayList(); Sink sink = new Sink() { @Override public void send(final Quad quad) { quadruples.add(quad); } @Override public void close() { } @Override public void flush() { } }; FileInputStream fis = null; LangRIOT parser = null; try { fis = new FileInputStream("/path/to/nquads-test1"); parser = RiotReader.createParserNQuads(fis, sink); parser.parse(); } catch (FileNotFoundException e) { e.printStackTrace(); } finally { try { fis.close(); } catch (IOException e) { e.printStackTrace(); } } Quad q = quadruples.get(0); ByteArrayOutputStream baos = new ByteArrayOutputStream(); Binding b = BindingFactory.create(); // b.add(Var.alloc("g"), q.getGraph()); // b.add(Var.alloc("s"), q.getSubject()); // b.add(Var.alloc("p"), q.getPredicate()); b.add(Var.alloc("o"), q.getObject()); BindingOutputStream bos = new BindingOutputStream(baos); bos.write(b); bos.close(); BindingInputStream bis = new BindingInputStream(new ByteArrayInputStream( baos.toByteArray())); System.out.println(bis.next()); The file nquads-test1 is available from: http://commondatastorage.googleapis.com/nquads/nquads-test1 It seems that BIO does not like the object value of the quadruple which is contained by nquads-test1. However this value seems correct. Any idea? Kind Regards, Laurent