[
https://issues.apache.org/jira/browse/ANY23-396?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16612747#comment-16612747
]
ASF GitHub Bot commented on ANY23-396:
--------------------------------------
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?
> Add ability to run extractors in flow
> -------------------------------------
>
> Key: ANY23-396
> URL: https://issues.apache.org/jira/browse/ANY23-396
> Project: Apache Any23
> Issue Type: Improvement
> Components: core
> Affects Versions: 2.2
> Reporter: Jacek Grzebyta
> Assignee: Jacek Grzebyta
> Priority: Minor
>
> Currently extractors do not work in flows. I.E. Next extractor has no any
> access to triples made by previous one.
> It would be useful if an extractor has possibility to modify triples created
> by another extractor.
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)