You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Andy Seaborne (JIRA)" <ji...@apache.org> on 2017/09/12 16:51:03 UTC
[jira] [Resolved] (JENA-1390) Add toModel() method in StmtIterator
[ https://issues.apache.org/jira/browse/JENA-1390?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andy Seaborne resolved JENA-1390.
---------------------------------
Resolution: Done
Assignee: Andy Seaborne
Fix Version/s: Jena 3.5.0
> 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
> Assignee: Andy Seaborne
> Priority: Trivial
> Labels: easytask
> Fix For: Jena 3.5.0
>
>
> 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)