Details

    • Type: Bug
    • Status: Done
    • Priority: Highest
    • Resolution: Done
    • Affects Version/s: BIGDATA_RELEASE_1_3_0
    • Fix Version/s: BLAZEGRAPH_2_2_0
    • Component/s: Query Engine
    • Labels:
      None

      Description

      Given the trig data:

      @prefix : <http://example.com/data/> .   
      @prefix base: <http://example.com/> .
      
      base:graph1
      {
      :person3                                                                                  
          a :Person ; 
          :age 3;                                                                     
          :name "Person 3 - graph1".
          
                                                                                        
      }
      
      base:graph2
      {
      :person3                                                                                  
          a :Person ; 
          :age 13;                                                                     
          :name "Person 3".
      }
      

      Running the query:

      PREFIX  rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
      PREFIX  rdfs: <http://www.w3.org/2000/01/rdf-schema#>
      PREFIX  xsd: <http://www.w3.org/2001/XMLSchema#>
      
      select  distinct ?ps ?p ?o
      #FROM NAMED  <http://example.com/graph1>
      where { 
              GRAPH <http://example.com/graph1>
              {
                      ?ps ?p ?o.
                      select ?ps
                      where  
                      {
                             ?ps a  <http://example.com/data/Person>. 
                             ?ps <http://example.com/data/age> ?age.
                             
                      }
                      order by desc(?age)
                      #LIMIT 1
              }
      
      }
      order by ?ps
      

      Running the query returns triples for "Person 3", but un-commenting "#FROM NAMED" causes all results to be filtered out.

        Activity

        Hide
        michaelschmidt michaelschmidt added a comment -

        Added test cases, can't reproduce the problem with the latest release, looks like this has been fixed meanwhile. Closing ticket.

        Show
        michaelschmidt michaelschmidt added a comment - Added test cases, can't reproduce the problem with the latest release, looks like this has been fixed meanwhile. Closing ticket.
        Hide
        alexr Alexandre Riazanov added a comment -

        Actually, the query with uncommented FROM NAMED should not return any results. Here is the explanation:

        (1) FROM NAMED makes the default graph in the dataset empty.
        See https://www.w3.org/TR/2013/REC-sparql11-query-20130321/#specifyingDataset

        (2) The body of the subquery ("select ?ps ..") is outside the scope of GRAPH <http://example.com/graph1> because of the bottom-up semantics of SPARQL, so it is evaluated over the (empty) default graph and returns no solutions.

        The test currently does not fail, despite wrong expected results, because there is another bug that breaks (2): see https://jira.blazegraph.com/browse/BLZG-1892

        Show
        alexr Alexandre Riazanov added a comment - Actually, the query with uncommented FROM NAMED should not return any results. Here is the explanation: (1) FROM NAMED makes the default graph in the dataset empty. See https://www.w3.org/TR/2013/REC-sparql11-query-20130321/#specifyingDataset (2) The body of the subquery ("select ?ps ..") is outside the scope of GRAPH < http://example.com/graph1 > because of the bottom-up semantics of SPARQL, so it is evaluated over the (empty) default graph and returns no solutions. The test currently does not fail, despite wrong expected results, because there is another bug that breaks (2): see https://jira.blazegraph.com/browse/BLZG-1892

          People

          • Assignee:
            michaelschmidt michaelschmidt
            Reporter:
            eugen forascu eugen forascu
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: