Return-Path: X-Original-To: apmail-marmotta-commits-archive@minotaur.apache.org Delivered-To: apmail-marmotta-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 805CF10C03 for ; Tue, 26 Nov 2013 09:07:25 +0000 (UTC) Received: (qmail 88012 invoked by uid 500); 26 Nov 2013 09:07:23 -0000 Delivered-To: apmail-marmotta-commits-archive@marmotta.apache.org Received: (qmail 87949 invoked by uid 500); 26 Nov 2013 09:07:22 -0000 Mailing-List: contact commits-help@marmotta.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@marmotta.apache.org Delivered-To: mailing list commits@marmotta.apache.org Received: (qmail 87918 invoked by uid 99); 26 Nov 2013 09:07:20 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 26 Nov 2013 09:07:20 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 4C8CF918050; Tue, 26 Nov 2013 09:07:20 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sschaffert@apache.org To: commits@marmotta.apache.org Date: Tue, 26 Nov 2013 09:07:20 -0000 Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: [1/3] git commit: move drop/create indexes and initialise connection to separate initialise() and shutdown methods to avoid dropping indexes for every file Updated Branches: refs/heads/develop 8841aea52 -> 2b6337d5e move drop/create indexes and initialise connection to separate initialise() and shutdown methods to avoid dropping indexes for every file Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/e4a9abdc Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/e4a9abdc Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/e4a9abdc Branch: refs/heads/develop Commit: e4a9abdc0245ebbd52a6c728b648dfd41b46a604 Parents: 70b4146 Author: Sebastian Schaffert Authored: Tue Nov 26 10:03:26 2013 +0100 Committer: Sebastian Schaffert Committed: Tue Nov 26 10:03:26 2013 +0100 ---------------------------------------------------------------------- .../apache/marmotta/kiwi/loader/KiWiLoader.java | 45 ++++++++------ .../kiwi/loader/generic/KiWiBatchHandler.java | 53 ++++++++++------ .../kiwi/loader/generic/KiWiHandler.java | 31 ++++++++-- .../kiwi/loader/mysql/MySQLLoadUtil.java | 63 +++++++++++++------- .../marmotta/kiwi/loader/pgsql/PGCopyUtil.java | 63 +++++++++++++------- .../marmotta/kiwi/loader/KiWiLoaderTest.java | 7 ++- 6 files changed, 171 insertions(+), 91 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/marmotta/blob/e4a9abdc/libraries/kiwi/kiwi-loader/src/main/java/org/apache/marmotta/kiwi/loader/KiWiLoader.java ---------------------------------------------------------------------- diff --git a/libraries/kiwi/kiwi-loader/src/main/java/org/apache/marmotta/kiwi/loader/KiWiLoader.java b/libraries/kiwi/kiwi-loader/src/main/java/org/apache/marmotta/kiwi/loader/KiWiLoader.java index 2bdbddb..9543806 100644 --- a/libraries/kiwi/kiwi-loader/src/main/java/org/apache/marmotta/kiwi/loader/KiWiLoader.java +++ b/libraries/kiwi/kiwi-loader/src/main/java/org/apache/marmotta/kiwi/loader/KiWiLoader.java @@ -128,6 +128,7 @@ public class KiWiLoader { protected KiWiStore store; protected SailRepository repository; + protected KiWiHandler handler; public KiWiLoader(KiWiConfiguration kiwi, String baseUri, String context) { this.kiwi = kiwi; @@ -327,6 +328,9 @@ public class KiWiLoader { } catch (RepositoryException e) { log.error("Sesame-Exception: {}", e.getMessage(), e); System.exit(2); + } catch (RDFHandlerException e) { + log.error("RDFHandler-Exception: {}", e.getMessage(), e); + System.exit(3); } } @@ -344,23 +348,6 @@ public class KiWiLoader { */ public void load(InputStream inStream, RDFFormat forFileName) throws RDFParseException, IOException { try { - KiWiLoaderConfiguration config = new KiWiLoaderConfiguration(); - if (context != null) { - config.setContext(context); - } - config.setStatistics(isStatisticsEnabled); - config.setStatisticsGraph(statisticsGraph); - - KiWiHandler handler; - if(kiwi.getDialect() instanceof PostgreSQLDialect) { - config.setCommitBatchSize(100000); - handler = new KiWiPostgresHandler(store,config); - } else if(kiwi.getDialect() instanceof MySQLDialect) { - config.setCommitBatchSize(100000); - handler = new KiWiMySQLHandler(store,config); - } else { - handler = new KiWiHandler(store,config); - } RDFParser parser = Rio.createParser(forFileName); parser.setRDFHandler(handler); @@ -394,10 +381,11 @@ public class KiWiLoader { * Shutdown the Repository, close all database connections. * @throws RepositoryException */ - public synchronized void shutdown() throws RepositoryException { + public synchronized void shutdown() throws RepositoryException, RDFHandlerException { if (repository == null || !repository.isInitialized()) { throw new IllegalStateException("repository was not initialized!"); } + handler.shutdown(); repository.shutDown(); repository = null; } @@ -424,7 +412,7 @@ public class KiWiLoader { * Initialize the KiWiStore, connect to the database. * @throws RepositoryException */ - public synchronized void initialize() throws RepositoryException { + public synchronized void initialize() throws RepositoryException, RDFHandlerException { if (repository != null && repository.isInitialized()) { throw new IllegalStateException("repository already initialized"); } @@ -433,6 +421,25 @@ public class KiWiLoader { repository = new SailRepository(store); repository.initialize(); + + + KiWiLoaderConfiguration config = new KiWiLoaderConfiguration(); + if (context != null) { + config.setContext(context); + } + config.setStatistics(isStatisticsEnabled); + config.setStatisticsGraph(statisticsGraph); + + if(kiwi.getDialect() instanceof PostgreSQLDialect) { + config.setCommitBatchSize(100000); + handler = new KiWiPostgresHandler(store,config); + } else if(kiwi.getDialect() instanceof MySQLDialect) { + config.setCommitBatchSize(100000); + handler = new KiWiMySQLHandler(store,config); + } else { + handler = new KiWiHandler(store,config); + } + handler.initialise(); } private static String getPassword(CommandLine cmd, String jdbc, String user, String password) throws ParseException { http://git-wip-us.apache.org/repos/asf/marmotta/blob/e4a9abdc/libraries/kiwi/kiwi-loader/src/main/java/org/apache/marmotta/kiwi/loader/generic/KiWiBatchHandler.java ---------------------------------------------------------------------- diff --git a/libraries/kiwi/kiwi-loader/src/main/java/org/apache/marmotta/kiwi/loader/generic/KiWiBatchHandler.java b/libraries/kiwi/kiwi-loader/src/main/java/org/apache/marmotta/kiwi/loader/generic/KiWiBatchHandler.java index 8e12416..3448d77 100644 --- a/libraries/kiwi/kiwi-loader/src/main/java/org/apache/marmotta/kiwi/loader/generic/KiWiBatchHandler.java +++ b/libraries/kiwi/kiwi-loader/src/main/java/org/apache/marmotta/kiwi/loader/generic/KiWiBatchHandler.java @@ -71,9 +71,42 @@ public abstract class KiWiBatchHandler extends KiWiHandler implements RDFHandler this.backend = backend; } + /** + * Perform initialisation, e.g. dropping indexes or other preparations. + */ + @Override + public void initialise() throws RDFHandlerException { + super.initialise(); + + if(config.isDropIndexes()) { + try { + log.info("{}: dropping indexes before import", backend); + dropIndexes(); + connection.commit(); + } catch (SQLException e) { + throw new RDFHandlerException("error while dropping indexes", e); + } + } + } - /** + /** + * Peform cleanup on shutdown, e.g. re-creating indexes after import completed + */ + @Override + public void shutdown() throws RDFHandlerException { + if(config.isDropIndexes()) { + try { + log.info("{}: re-creating indexes after import", backend); + createIndexes(); + connection.commit(); + } catch (SQLException e) { + throw new RDFHandlerException("error while dropping indexes", e); + } + } + } + + /** * Signals the start of the RDF data. This method is called before any data * is reported. * @@ -92,15 +125,6 @@ public abstract class KiWiBatchHandler extends KiWiHandler implements RDFHandler super.startRDF(); - if(config.isDropIndexes()) { - try { - log.info("{}: dropping indexes before import", backend); - dropIndexes(); - connection.commit(); - } catch (SQLException e) { - throw new RDFHandlerException("error while dropping indexes", e); - } - } } @@ -119,15 +143,6 @@ public abstract class KiWiBatchHandler extends KiWiHandler implements RDFHandler throw new RDFHandlerException(e); } - if(config.isDropIndexes()) { - try { - log.info("{}: re-creating indexes after import", backend); - createIndexes(); - connection.commit(); - } catch (SQLException e) { - throw new RDFHandlerException("error while dropping indexes", e); - } - } super.endRDF(); http://git-wip-us.apache.org/repos/asf/marmotta/blob/e4a9abdc/libraries/kiwi/kiwi-loader/src/main/java/org/apache/marmotta/kiwi/loader/generic/KiWiHandler.java ---------------------------------------------------------------------- diff --git a/libraries/kiwi/kiwi-loader/src/main/java/org/apache/marmotta/kiwi/loader/generic/KiWiHandler.java b/libraries/kiwi/kiwi-loader/src/main/java/org/apache/marmotta/kiwi/loader/generic/KiWiHandler.java index 03704e2..8eaa151 100644 --- a/libraries/kiwi/kiwi-loader/src/main/java/org/apache/marmotta/kiwi/loader/generic/KiWiHandler.java +++ b/libraries/kiwi/kiwi-loader/src/main/java/org/apache/marmotta/kiwi/loader/generic/KiWiHandler.java @@ -113,6 +113,31 @@ public class KiWiHandler implements RDFHandler { } + + /** + * Perform initialisation, e.g. dropping indexes or other preparations. + */ + public void initialise() throws RDFHandlerException { + try { + this.connection = store.getPersistence().getConnection(); + } catch (SQLException e) { + throw new RDFHandlerException(e); + } + } + + + /** + * Peform cleanup on shutdown, e.g. re-creating indexes after import completed + */ + public void shutdown() throws RDFHandlerException { + try { + connection.close(); + } catch (SQLException e) { + throw new RDFHandlerException(e); + } + + } + /** * Signals the end of the RDF data. This method is called when all data has * been reported. @@ -129,7 +154,6 @@ public class KiWiHandler implements RDFHandler { try { connection.commit(); - connection.close(); } catch (SQLException e) { throw new RDFHandlerException(e); } @@ -147,11 +171,6 @@ public class KiWiHandler implements RDFHandler { @Override public void startRDF() throws RDFHandlerException { log.info("KiWiLoader: starting RDF bulk import"); - try { - this.connection = store.getPersistence().getConnection(); - } catch (SQLException e) { - throw new RDFHandlerException(e); - } this.start = System.currentTimeMillis(); this.previous = System.currentTimeMillis(); http://git-wip-us.apache.org/repos/asf/marmotta/blob/e4a9abdc/libraries/kiwi/kiwi-loader/src/main/java/org/apache/marmotta/kiwi/loader/mysql/MySQLLoadUtil.java ---------------------------------------------------------------------- diff --git a/libraries/kiwi/kiwi-loader/src/main/java/org/apache/marmotta/kiwi/loader/mysql/MySQLLoadUtil.java b/libraries/kiwi/kiwi-loader/src/main/java/org/apache/marmotta/kiwi/loader/mysql/MySQLLoadUtil.java index 43cb3c0..26a47b8 100644 --- a/libraries/kiwi/kiwi-loader/src/main/java/org/apache/marmotta/kiwi/loader/mysql/MySQLLoadUtil.java +++ b/libraries/kiwi/kiwi-loader/src/main/java/org/apache/marmotta/kiwi/loader/mysql/MySQLLoadUtil.java @@ -108,14 +108,24 @@ public class MySQLLoadUtil { public static InputStream flushTriples(Iterable tripleBacklog) throws IOException { StringWriter out = new StringWriter(); CsvListWriter writer = new CsvListWriter(out, CsvPreference.STANDARD_PREFERENCE); - for(KiWiTriple t : tripleBacklog) { - List row = Arrays.asList( - t.getId(), t.getSubject(), t.getPredicate(), t.getObject(), t.getContext(), t.getCreator(), t.isInferred(), t.isDeleted(), t.getCreated(), t.getDeletedAt() - ); - if(row != null) { - writer.write(row, tripleProcessors); - } + // reuse the same array to avoid unnecessary object allocation + Object[] rowArray = new Object[10]; + List row = Arrays.asList(rowArray); + + for(KiWiTriple t : tripleBacklog) { + rowArray[0] = t.getId(); + rowArray[1] = t.getSubject(); + rowArray[2] = t.getPredicate(); + rowArray[3] = t.getObject(); + rowArray[4] = t.getContext(); + rowArray[5] = t.getCreator(); + rowArray[6] = t.isInferred(); + rowArray[7] = t.isDeleted(); + rowArray[8] = t.getCreated(); + rowArray[9] = t.getDeletedAt(); + + writer.write(row, tripleProcessors); } writer.close(); @@ -127,46 +137,55 @@ public class MySQLLoadUtil { public static InputStream flushNodes(Iterable nodeBacklog) throws IOException { StringWriter out = new StringWriter(); CsvListWriter writer = new CsvListWriter(out, nodesPreference); + + // reuse the same array to avoid unnecessary object allocation + Object[] rowArray = new Object[10]; + List row = Arrays.asList(rowArray); + for(KiWiNode n : nodeBacklog) { - List row = null; if(n instanceof KiWiUriResource) { KiWiUriResource u = (KiWiUriResource)n; - row = createNodeList(u.getId(), u.getClass(), u.stringValue(), null, null, null, null, null, null, u.getCreated()); + createNodeList(rowArray, u.getId(), u.getClass(), u.stringValue(), null, null, null, null, null, null, u.getCreated()); } else if(n instanceof KiWiAnonResource) { KiWiAnonResource a = (KiWiAnonResource)n; - row = createNodeList(a.getId(), a.getClass(), a.stringValue(), null, null, null, null, null, null, a.getCreated()); + createNodeList(rowArray, a.getId(), a.getClass(), a.stringValue(), null, null, null, null, null, null, a.getCreated()); } else if(n instanceof KiWiIntLiteral) { KiWiIntLiteral l = (KiWiIntLiteral)n; - row = createNodeList(l.getId(), l.getClass(), l.getContent(), l.getDoubleContent(), l.getIntContent(), null, null, l.getDatatype(), l.getLocale(), l.getCreated()); + createNodeList(rowArray, l.getId(), l.getClass(), l.getContent(), l.getDoubleContent(), l.getIntContent(), null, null, l.getDatatype(), l.getLocale(), l.getCreated()); } else if(n instanceof KiWiDoubleLiteral) { KiWiDoubleLiteral l = (KiWiDoubleLiteral)n; - row = createNodeList(l.getId(), l.getClass(), l.getContent(), l.getDoubleContent(), null, null, null, l.getDatatype(), l.getLocale(), l.getCreated()); + createNodeList(rowArray, l.getId(), l.getClass(), l.getContent(), l.getDoubleContent(), null, null, null, l.getDatatype(), l.getLocale(), l.getCreated()); } else if(n instanceof KiWiBooleanLiteral) { KiWiBooleanLiteral l = (KiWiBooleanLiteral)n; - row = createNodeList(l.getId(), l.getClass(), l.getContent(), null, null, null, l.booleanValue(), l.getDatatype(), l.getLocale(), l.getCreated()); + createNodeList(rowArray, l.getId(), l.getClass(), l.getContent(), null, null, null, l.booleanValue(), l.getDatatype(), l.getLocale(), l.getCreated()); } else if(n instanceof KiWiDateLiteral) { KiWiDateLiteral l = (KiWiDateLiteral)n; - row = createNodeList(l.getId(), l.getClass(), l.getContent(), null, null, l.getDateContent(), null, l.getDatatype(), l.getLocale(), l.getCreated()); + createNodeList(rowArray, l.getId(), l.getClass(), l.getContent(), null, null, l.getDateContent(), null, l.getDatatype(), l.getLocale(), l.getCreated()); } else if(n instanceof KiWiStringLiteral) { KiWiStringLiteral l = (KiWiStringLiteral)n; - row = createNodeList(l.getId(), l.getClass(), l.getContent(), null, null, null, null, l.getDatatype(), l.getLocale(), l.getCreated()); + createNodeList(rowArray, l.getId(), l.getClass(), l.getContent(), null, null, null, null, l.getDatatype(), l.getLocale(), l.getCreated()); } else { log.warn("unknown node type, cannot flush to import stream: {}", n.getClass()); } - if(row != null) { - writer.write(row, nodeProcessors); - } + writer.write(row, nodeProcessors); } writer.close(); return IOUtils.toInputStream(out.toString()); } - private static List createNodeList(Long id, Class type, String content, Double dbl, Long lng, Date date, Boolean bool, URI dtype, Locale lang, Date created) { - return Arrays.asList(new Object[]{ - id, type, content, dbl, lng, date, bool, dtype, lang, created - }); + private static void createNodeList(Object[] a, Long id, Class type, String content, Double dbl, Long lng, Date date, Boolean bool, URI dtype, Locale lang, Date created) { + a[0] = id; + a[1] = type; + a[2] = content; + a[3] = dbl; + a[4] = lng; + a[5] = date; + a[6] = bool; + a[7] = dtype; + a[8] = lang; + a[9] = created; } } http://git-wip-us.apache.org/repos/asf/marmotta/blob/e4a9abdc/libraries/kiwi/kiwi-loader/src/main/java/org/apache/marmotta/kiwi/loader/pgsql/PGCopyUtil.java ---------------------------------------------------------------------- diff --git a/libraries/kiwi/kiwi-loader/src/main/java/org/apache/marmotta/kiwi/loader/pgsql/PGCopyUtil.java b/libraries/kiwi/kiwi-loader/src/main/java/org/apache/marmotta/kiwi/loader/pgsql/PGCopyUtil.java index 2631258..3cf6448 100644 --- a/libraries/kiwi/kiwi-loader/src/main/java/org/apache/marmotta/kiwi/loader/pgsql/PGCopyUtil.java +++ b/libraries/kiwi/kiwi-loader/src/main/java/org/apache/marmotta/kiwi/loader/pgsql/PGCopyUtil.java @@ -106,14 +106,24 @@ public class PGCopyUtil { public static void flushTriples(Iterable tripleBacklog, OutputStream out) throws IOException { CsvListWriter writer = new CsvListWriter(new OutputStreamWriter(out), CsvPreference.STANDARD_PREFERENCE); - for(KiWiTriple t : tripleBacklog) { - List row = Arrays.asList( - t.getId(), t.getSubject(), t.getPredicate(), t.getObject(), t.getContext(), t.getCreator(), t.isInferred(), t.isDeleted(), t.getCreated(), t.getDeletedAt() - ); - if(row != null) { - writer.write(row, tripleProcessors); - } + // reuse the same array to avoid unnecessary object allocation + Object[] rowArray = new Object[10]; + List row = Arrays.asList(rowArray); + + for(KiWiTriple t : tripleBacklog) { + rowArray[0] = t.getId(); + rowArray[1] = t.getSubject(); + rowArray[2] = t.getPredicate(); + rowArray[3] = t.getObject(); + rowArray[4] = t.getContext(); + rowArray[5] = t.getCreator(); + rowArray[6] = t.isInferred(); + rowArray[7] = t.isDeleted(); + rowArray[8] = t.getCreated(); + rowArray[9] = t.getDeletedAt(); + + writer.write(row, tripleProcessors); } writer.close(); } @@ -122,43 +132,52 @@ public class PGCopyUtil { public static void flushNodes(Iterable nodeBacklog, OutputStream out) throws IOException { CsvListWriter writer = new CsvListWriter(new OutputStreamWriter(out), nodesPreference); + + // reuse the same array to avoid unnecessary object allocation + Object[] rowArray = new Object[10]; + List row = Arrays.asList(rowArray); + for(KiWiNode n : nodeBacklog) { - List row = null; if(n instanceof KiWiUriResource) { KiWiUriResource u = (KiWiUriResource)n; - row = createNodeList(u.getId(), u.getClass(), u.stringValue(), null, null, null, null, null, null, u.getCreated()); + createNodeList(rowArray, u.getId(), u.getClass(), u.stringValue(), null, null, null, null, null, null, u.getCreated()); } else if(n instanceof KiWiAnonResource) { KiWiAnonResource a = (KiWiAnonResource)n; - row = createNodeList(a.getId(), a.getClass(), a.stringValue(), null, null, null, null, null, null, a.getCreated()); + createNodeList(rowArray, a.getId(), a.getClass(), a.stringValue(), null, null, null, null, null, null, a.getCreated()); } else if(n instanceof KiWiIntLiteral) { KiWiIntLiteral l = (KiWiIntLiteral)n; - row = createNodeList(l.getId(), l.getClass(), l.getContent(), l.getDoubleContent(), l.getIntContent(), null, null, l.getDatatype(), l.getLocale(), l.getCreated()); + createNodeList(rowArray, l.getId(), l.getClass(), l.getContent(), l.getDoubleContent(), l.getIntContent(), null, null, l.getDatatype(), l.getLocale(), l.getCreated()); } else if(n instanceof KiWiDoubleLiteral) { KiWiDoubleLiteral l = (KiWiDoubleLiteral)n; - row = createNodeList(l.getId(), l.getClass(), l.getContent(), l.getDoubleContent(), null, null, null, l.getDatatype(), l.getLocale(), l.getCreated()); + createNodeList(rowArray, l.getId(), l.getClass(), l.getContent(), l.getDoubleContent(), null, null, null, l.getDatatype(), l.getLocale(), l.getCreated()); } else if(n instanceof KiWiBooleanLiteral) { KiWiBooleanLiteral l = (KiWiBooleanLiteral)n; - row = createNodeList(l.getId(), l.getClass(), l.getContent(), null, null, null, l.booleanValue(), l.getDatatype(), l.getLocale(), l.getCreated()); + createNodeList(rowArray, l.getId(), l.getClass(), l.getContent(), null, null, null, l.booleanValue(), l.getDatatype(), l.getLocale(), l.getCreated()); } else if(n instanceof KiWiDateLiteral) { KiWiDateLiteral l = (KiWiDateLiteral)n; - row = createNodeList(l.getId(), l.getClass(), l.getContent(), null, null, l.getDateContent(), null, l.getDatatype(), l.getLocale(), l.getCreated()); + createNodeList(rowArray, l.getId(), l.getClass(), l.getContent(), null, null, l.getDateContent(), null, l.getDatatype(), l.getLocale(), l.getCreated()); } else if(n instanceof KiWiStringLiteral) { KiWiStringLiteral l = (KiWiStringLiteral)n; - row = createNodeList(l.getId(), l.getClass(), l.getContent(), null, null, null, null, l.getDatatype(), l.getLocale(), l.getCreated()); + createNodeList(rowArray, l.getId(), l.getClass(), l.getContent(), null, null, null, null, l.getDatatype(), l.getLocale(), l.getCreated()); } else { log.warn("unknown node type, cannot flush to import stream: {}", n.getClass()); } - if(row != null) { - writer.write(row, nodeProcessors); - } + writer.write(row, nodeProcessors); } writer.close(); } - private static List createNodeList(Long id, Class type, String content, Double dbl, Long lng, Date date, Boolean bool, URI dtype, Locale lang, Date created) { - return Arrays.asList(new Object[]{ - id, type, content, dbl, lng, date, bool, dtype, lang, created - }); + private static void createNodeList(Object[] a, Long id, Class type, String content, Double dbl, Long lng, Date date, Boolean bool, URI dtype, Locale lang, Date created) { + a[0] = id; + a[1] = type; + a[2] = content; + a[3] = dbl; + a[4] = lng; + a[5] = date; + a[6] = bool; + a[7] = dtype; + a[8] = lang; + a[9] = created; } } http://git-wip-us.apache.org/repos/asf/marmotta/blob/e4a9abdc/libraries/kiwi/kiwi-loader/src/test/java/org/apache/marmotta/kiwi/loader/KiWiLoaderTest.java ---------------------------------------------------------------------- diff --git a/libraries/kiwi/kiwi-loader/src/test/java/org/apache/marmotta/kiwi/loader/KiWiLoaderTest.java b/libraries/kiwi/kiwi-loader/src/test/java/org/apache/marmotta/kiwi/loader/KiWiLoaderTest.java index 86c31f1..8896e58 100644 --- a/libraries/kiwi/kiwi-loader/src/test/java/org/apache/marmotta/kiwi/loader/KiWiLoaderTest.java +++ b/libraries/kiwi/kiwi-loader/src/test/java/org/apache/marmotta/kiwi/loader/KiWiLoaderTest.java @@ -17,6 +17,7 @@ import org.openrdf.repository.Repository; import org.openrdf.repository.RepositoryConnection; import org.openrdf.repository.RepositoryException; import org.openrdf.rio.RDFFormat; +import org.openrdf.rio.RDFHandlerException; import org.openrdf.rio.RDFParseException; import java.io.File; @@ -105,7 +106,7 @@ public class KiWiLoaderTest { @Test public void testLoadFile() throws RepositoryException, RDFParseException, - IOException { + IOException, RDFHandlerException { KiWiTestLoader loader = new KiWiTestLoader(getKiWiConfig(), "http://example.com/test/", null); loader.initialize(); @@ -128,7 +129,7 @@ public class KiWiLoaderTest { @Test public void testLoadFile_GZ() throws RepositoryException, RDFParseException, - IOException { + IOException, RDFHandlerException { File gz = temp.newFile(dataFile.getName() + ".gz"); OutputStream os = new GZIPOutputStream(new FileOutputStream(gz)); FileInputStream is = new FileInputStream(dataFile); @@ -175,7 +176,7 @@ public class KiWiLoaderTest { } @Test - public void testLoadInputStream() throws RepositoryException, RDFParseException, IOException { + public void testLoadInputStream() throws RepositoryException, RDFParseException, IOException, RDFHandlerException { KiWiTestLoader loader = new KiWiTestLoader(getKiWiConfig(), "http://example.com/test/", null); loader.initialize();