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

Add toModel() method in StmtIterator

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Done
    • Jena 3.4.0
    • Jena 3.5.0
    • Core

    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

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

            Dates

              Created:
              Updated:
              Resolved: