[ 
https://issues.apache.org/jira/browse/ANY23-388?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16582811#comment-16582811
 ] 

ASF GitHub Bot commented on ANY23-388:
--------------------------------------

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

----


> It should be possible to configure the NTriplesWriter to use unicode points
> ---------------------------------------------------------------------------
>
>                 Key: ANY23-388
>                 URL: https://issues.apache.org/jira/browse/ANY23-388
>             Project: Apache Any23
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 2.2
>            Reporter: Lars G. Svensson
>            Priority: Minor
>
> When using the NTriplesWriter, I wanted to configure it to write unicode 
> points as escape sequences. I tried to subclass 
> org.apache.any23.writer.TripleHandler and overwrite the access to the 
> org.eclipse.rdf4j.rio.ntriples.NTriplesWriter but couldn't do that since the 
> access to the NTriplesWriter is package protected. I ended up copying the 
> code which seems a bit clunky...
> I was [asked to create a pull 
> request|https://mail-archives.apache.org/mod_mbox/any23-user/201808.mbox/%3CCAGaRif3KAQbnK6XSKnVUZAJOn8aR_iCmJmGv_L05yg6nBkB%3DwA%40mail.gmail.com%3E],
>  this issue is there to track that.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to