[
https://issues.apache.org/jira/browse/JENA-1390?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16163271#comment-16163271
]
ASF subversion and git services commented on JENA-1390:
-------------------------------------------------------
Commit 0d15462fa9b40b22127e514bea6689c77179dafa in jena's branch
refs/heads/master from [~andy.seaborne]
[ https://git-wip-us.apache.org/repos/asf?p=jena.git;h=0d15462 ]
JENA-1390: Add default method toModel().
> Add toModel() method in StmtIterator
> ------------------------------------
>
> Key: JENA-1390
> URL: https://issues.apache.org/jira/browse/JENA-1390
> Project: Apache Jena
> Issue Type: Improvement
> Components: Core
> Affects Versions: Jena 3.4.0
> Reporter: Adam Jacobs
> Priority: Trivial
> Labels: easytask
>
> Add direct conversion of org.apache.jena.rdf.model.StmtIterator to Model.
> This would align with the toList() and toSet() functionality of
> ExtendedIterator.
> The following method may be added to the StmtIterator interface.
> {noformat}
> /**
> Answer a Model of the [remaining] Statements of this iterator,
> consuming this iterator.
> */
> public default Model toModel() {
> Model m = ModelFactory.createDefaultModel();
> this.forEachRemaining(m::add);
> return m;
> }
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)