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

"SELECT DISTINCT * " produces duplicates when blank nodes are used the graph pattern

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • ARQ 2.9.0, ARQ 2.9.1
    • ARQ 2.9.1
    • ARQ
    • None

    Description

      When using a blank node in the graph pattern of a query, using "select distinct *" can result in duplicate rows. There is a similar issue with "select reduced *"

      Steps to reproduce:

      1) Load the "books" database [1]
      2) Add an additional statement [2]
      3) Run the following query:
      PREFIX books: <http://example.org/book/>
      PREFIX dc: <http://purl.org/dc/elements/1.1/>
      select distinct *
      where

      { ?book dc:title ?title . ?book dc:creator [] . }

      You see that you get a duplicate result for book5.

      If you change the query to:
      PREFIX books: <http://example.org/book/>
      PREFIX dc: <http://purl.org/dc/elements/1.1/>
      select distinct ?book ?title
      where

      { ?book dc:title ?title . ?book dc:creator [] . }

      You do not get duplicates.

      [1] http://svn.apache.org/repos/asf/incubator/jena/Jena2/Fuseki/trunk/Data/books.ttl
      [2] <http://example.org/book/book5> <http://purl.org/dc/elements/1.1/creator> "Sir Example" .

      Attachments

        Activity

          People

            Unassigned Unassigned
            sallen Stephen Allen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: