Github user HansBrende commented on the issue:

    https://github.com/apache/any23/pull/121
  
    @jgrzebyta One easy solution to my above comment that I can think of right 
off the bat is as follows:
    
    First, we could extend the WriterFactory interface as follows (or similar):
    
    ```
    interface DelegatingWriterFactory extends WriterFactory {
        TripleHandler getWriter(TripleHandler delegate);
    }
    ```
    
    Second, in the rover `--format` flag (which actually accepts a 
WriterFactory *id*, not necessarily a format name), we could simply allow a 
comma-separated *list* of WriterFactory ids rather than a single id. Then, to 
construct the final writer, we'd compose each writer in the list with the 
previous one, i.e.:
    
    ```
    Collections.reverse(listOfIds);
    
    tripleHandler = 
getWriterFactoryForId(listOfIds.get(0)).getRdfWriter(outputStream);
    
    for (String id : listOfIds.subList(1, listOfIds.size())) {
        tripleHandler = 
((DelegatingWriterFactory)getWriterFactoryForId(id)).getWriter(tripleHandler);
    }
    ```
    This is just one initial idea, but food for thought. It also seems more in 
line with your concept of a "flow".
    
    What do you think?



---

Reply via email to