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

execConstructTriples() does not eliminate malformed triples from it's output

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: ARQ 2.9.4
    • Fix Version/s: Jena 2.10.0
    • Component/s: ARQ
    • Labels:

      Description

      Start from any model which has triples containing only literals as their subjects, then try the following:

      @Test public void testConstructRejectsBadTriples1()
      {
      String queryString = "CONSTRUCT

      { ?s ?p ?o } WHERE { ?o ?p ?s }";
      Query q = QueryFactory.create(queryString);

      QueryExecution qExec = QueryExecutionFactory.create(q, m);

      Model resultModel = qExec.execConstruct();
      assertEquals(0, resultModel.size());
      }

      @Test public void testConstructRejectsBadTriples2()
      {
      String queryString = "CONSTRUCT { ?s ?p ?o }

      WHERE

      { ?o ?p ?s }

      ";
      Query q = QueryFactory.create(queryString);

      QueryExecution qExec = QueryExecutionFactory.create(q, m);

      Iterator<Triple> ts = qExec.execConstructTriples();
      long count = 0;
      while (ts.hasNext())

      { count++; ts.next(); }

      assertEquals(0, count);
      }

      The first test passes because execConstruct() correctly rejects triples with literal subjects as invalid, the second test fails because execConstructTriples() does not follow this behavior.

        Attachments

          Activity

            People

            • Assignee:
              rvesse Rob Vesse
              Reporter:
              rvesse Rob Vesse
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: