You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Adam Jacobs (JIRA)" <ji...@apache.org> on 2017/09/02 03:11:02 UTC

[jira] [Created] (JENA-1390) Add toModel() method in StmtIterator

Adam Jacobs created JENA-1390:
---------------------------------

             Summary: 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


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.

    /**
         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;
    }



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)