Uploaded image for project: 'Apache Jena'
  1. Apache Jena
  2. JENA-1390

Add toModel() method in StmtIterator

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Done
    • Affects Version/s: Jena 3.4.0
    • Fix Version/s: Jena 3.5.0
    • Component/s: Core
    • Labels:

      Description

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

        Attachments

          Activity

            People

            • Assignee:
              andy Andy Seaborne
              Reporter:
              jaco0646 Adam Jacobs
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: