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

Odd MINUS behavior in a UNION

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Jena 3.0.0
    • Fix Version/s: Jena 3.0.1
    • Component/s: Jena
    • Labels:
      None

      Description

      Given the sample data:

      @prefix owl:    <http://www.w3.org/2002/07/owl#>
      @prefix rdfs:   <http://www.w3.org/2000/01/rdf-schema#> .
      @prefix :       <http://no.such.org/test#> .
      
      <urn:test:node1>
          a :TestNode ;
          rdfs:label "Node 1" .
      
      <urn:test:node2>
          a :TestNode ;
          rdfs:label "Node 2" .
      
      :TestNode
        a owl:Class ;
        rdfs:label "Test Node" .
      

      When I run the union query:

      PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
      PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
      PREFIX app: <http://no.such.org/test#>
       
      select distinct ?id where {
        ?id a app:TestNode .
        {
          ?id rdfs:label "Node 1" .
          minus { ?id a app:TestNode }
        } union {
          ?id rdfs:label "Node 1" .
          minus { ?id a app:TestNode }
        }
      }
      

      Observed:
      The query unexpectedly returns a single value: <urn:test:node1>

      Expected:
      The query should return no results.

      Unless, of course, I'm totally off-base here. I suspect an issue, since removing the union and having a single:

        {
          ?id rdfs:label "Node 1" .
          minus { ?id a app:TestNode }
        }
      

      returns the expected empty result set.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                andy Andy Seaborne
                Reporter:
                wtritch William Tritchler
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: