Return-Path: Delivered-To: apmail-incubator-jena-dev-archive@minotaur.apache.org Received: (qmail 3415 invoked from network); 1 Mar 2011 13:16:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 Mar 2011 13:16:04 -0000 Received: (qmail 26080 invoked by uid 500); 1 Mar 2011 13:16:04 -0000 Delivered-To: apmail-incubator-jena-dev-archive@incubator.apache.org Received: (qmail 26031 invoked by uid 500); 1 Mar 2011 13:16:03 -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 25911 invoked by uid 99); 1 Mar 2011 13:16:02 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Mar 2011 13:16:02 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Mar 2011 13:15:59 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id DBF7C4312E for ; Tue, 1 Mar 2011 13:15:37 +0000 (UTC) Date: Tue, 1 Mar 2011 13:15:37 +0000 (UTC) From: "Richard Cyganiak (JIRA)" To: jena-dev@incubator.apache.org Message-ID: <1254990155.4946.1298985337897.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1661716659.442.1298756038671.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] Commented: (JENA-51) Turtle parser misses prefix declarations MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/JENA-51?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13000865#comment-13000865 ] Richard Cyganiak commented on JENA-51: -------------------------------------- Upgrading to 2.6.4 fixed the problem. Sorry, should have tried that first. Thanks for the help everyone. (Good to see that jena.jar and arq.jar now have the version number in the filename.) > Turtle parser misses prefix declarations > ---------------------------------------- > > Key: JENA-51 > URL: https://issues.apache.org/jira/browse/JENA-51 > Project: Jena > Issue Type: Bug > Components: Jena > Reporter: Richard Cyganiak > Assignee: Andy Seaborne > Priority: Minor > > Jena's Turtle parser doesn't capture @prefix declarations in the prefix mapping. Any triples are parsed correctly, but model.getNsPrefixMap() and friends show an empty prefix mapping. > The N3 parser handles this correctly. > ====== example code below ======= > import com.hp.hpl.jena.rdf.model.*; > public class Test { > public static void main(String[] args) { > String s = > "@prefix ex1: .\n" + > "@prefix ex2: .\n" + > "ex1:A a ex1:B ."; > > Model n3 = ModelFactory.createDefaultModel(); > System.out.println("Parsing with N3 parser and printing prefixes:"); > n3.read(new java.io.ByteArrayInputStream(s.getBytes()), null, "N3"); > System.out.println(n3.getNsPrefixMap()); > Model turtle = ModelFactory.createDefaultModel(); > System.out.println("Parsing with Turtle parser and printing prefixes:"); > turtle.read(new java.io.ByteArrayInputStream(s.getBytes()), null, "TURTLE"); > System.out.println(turtle.getNsPrefixMap()); > } > } > ===== output ====== > Parsing with N3 parser: > {ex2=http://example.com/2#, ex1=http://example.com/1#} > Parsing with Turtle parser: > {} -- This message is automatically generated by JIRA. - For more information on JIRA, see: http://www.atlassian.com/software/jira