GitHub user larsgsvensson opened a pull request:

    https://github.com/apache/any23/pull/116

    Any23 388

    Making the constructor of `RDFWriterTripleHandler` and its `writer` field 
protected, as 
[discussed](https://issues.apache.org/jira/browse/ANY23-388?focusedCommentId=16580679&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-16580679)
 by me, @lewismc and @HansBrende 

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/larsgsvensson/any23 ANY23-388

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/any23/pull/116.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #116
    
----
commit 95434efc84c190d3500101e0d4fc141074134c88
Author: Lars G. Svensson <lars.g.svensson@...>
Date:   2018-08-08T10:07:24Z

    Made access to RDFWriter protected
    
    Rationale:
    When using the NTriplesWriter, I wanted to configure it to write unicode 
points as escape sequences. Since there was no possibility to access the 
`RDFWriter`, I ended up copying the code...
    By making the `RDFWriter` protected, it's possible to use the 
`RDFWriter.setWriterConfig( WriterConfig )` method to configure the writer:
    ```Java
    private class MyNTriplesWriter extends NTriplesWriter {
        public MyNTriplesWriter( OutputStream os ) {
            super( os );
            final WriterConfig config = new WriterConfig();
        config.set(NTriplesWriterSettings.ESCAPE_UNICODE, Boolean.TRUE);
        super.writer.setWriterConfig(config);
        }
    
        public void doSomething() {
            Any23 runner = new Any23();
            DocumentSource source = ... ;
            TripleHandler handler = new MyNTriplesWriter( os );
            runner.extract( source, handler );
        }
    }

commit e38ff7e139c8310c646f9fcdd391d3902e471cd4
Author: Lars G. Svensson <lars.g.svensson@...>
Date:   2018-08-09T14:08:11Z

    Update RDFWriterTripleHandler.java

commit 68d12c14ebff57f5f5e56fbf8ae68b15b3c6b733
Author: larsgsvensson <lars.g.svensson@...>
Date:   2018-08-09T14:39:26Z

    updated type

commit bc127be4d7a86aaa36578907ad01a9350372ba9c
Author: larsgsvensson <lars.g.svensson@...>
Date:   2018-08-09T15:17:18Z

    ANY23-388 It should be possible to configure the NTriplesWriter

commit 8f08a3e65eda4e3d22182347fde1bab16d125711
Author: Lars G. Svensson <lars.g.svensson@...>
Date:   2018-08-16T16:38:34Z

    Made constructor and field writer protected

----


---

Reply via email to