incubator-any23-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter Ansell (JIRA)" <j...@apache.org>
Subject [jira] [Created] (ANY23-89) Remove BufferRDFHandler from RDFUtils
Date Mon, 14 May 2012 01:23:47 GMT
Peter Ansell created ANY23-89:
---------------------------------

             Summary: Remove BufferRDFHandler from RDFUtils
                 Key: ANY23-89
                 URL: https://issues.apache.org/jira/browse/ANY23-89
             Project: Apache Any23
          Issue Type: Improvement
          Components: core
            Reporter: Peter Ansell


Sesame provides an implementation of RDFHandler, similar to BufferRDFHandler, in sesame-rio-api.jar.
The only difference from StatementCollector to BufferRDFHandler is that StatementCollector
also collects namespaces, which in most cases should not incur too much of a memory or performance
cost. BufferRDFHandler is a private inner class so there are no repercussions to the API or
other classes.

It is a simple switch out with the following two lines affected after removing BufferRDFHandler.

    public static Statement[] parseRDF(RDFFormat p, InputStream is, String baseURI)
     throws RDFHandlerException, IOException, RDFParseException {
-        final BufferRDFHandler handler = new BufferRDFHandler();
+        final StatementCollector handler = new StatementCollector();
         parser.setVerifyData(true);
         parser.setStopAtFirstError(true);
         parser.setPreserveBNodeIDs(true);
         parser.setRDFHandler(handler);
         parser.parse(is, baseURI);
-        return handler.statements.toArray( new Statement[handler.statements.size()] );
+        return handler.getStatements().toArray( new Statement[handler.getStatements().size()]
);
     }


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message