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

TRIG parser yields NULL-graph for quads in default graph

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Jena 3.14.0
    • Jena 3.15.0
    • RIOT
    • None

    Description

      Hi Jena Team and Andy, thanks for all your great work on Jena and fixing all my recent issues, but I found another one

      The Trig Parser yields quads with a null value in the graph component for data in the default graph. It should be Quad.defaultGraphNodeGenerated.

      Test data:

      # test.trig
      @base <http://www.example.org/base-> .
      @prefix : <http://www.example.org/prefx-> .
      
      <s> <p> <o> .
      :x :y :z .
      
      Iterator<Quad> it = RDFDataMgr.createIteratorQuads(RDFDataMgr.open("test.trig"), Lang.TRIG, null);
      while(it.hasNext()) {
      	Quad q = it.next();
      	System.out.println(q.getGraph());
      }
      
      null
      null
      

      This causes quite unexpected null pointer exceptions, such as in this simple scenario:

      		
      Dataset ds = RDFDataMgr.loadDataset("test.trig");
      System.out.println(ds.asDatasetGraph().size());
      

      Attachments

        Issue Links

          Activity

            People

              andy Andy Seaborne
              Aklakan Claus Stadler
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m