Uploaded image for project: 'Blazegraph (by SYSTAP)'
  1. Blazegraph (by SYSTAP)
  2. BLZG-874

GRAPH ?g { FILTER NOT EXISTS { ?s ?p ?o } } not respecting ?g

    Details

      Description

      This is an initial report that needs cleaning up.
      With my current set up the commented line makes a difference to the answer and should not:

      base <http://localhost:8000/>
      prefix owl: <http://www.w3.org/2002/07/owl#>
      prefix xsd: <http://www.w3.org/2001/XMLSchema#>
      prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
      prefix dc: <http://purl.org/dc/elements/1.1/>
      prefix s: <http://localhost:8000/bdm/api/>
      prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
      prefix bds: <http://www.bigdata.com/rdf/search#>
      prefix skos: <http://www.w3.org/2004/02/skos/core#>
      prefix syapse: <http://localhost:8000/graph/syapse#>
      SELECT ?vocab_id ?term ?classification
      FROM <http://localhost:8000/graph/vocabulary>
      FROM <http://localhost:8000/graph/southParkUniversity/vocabulary>
      FROM <http://localhost:8000/graph/syapse>
      FROM NAMED <http://localhost:8000/graph/vocabulary>
      FROM NAMED <http://localhost:8000/graph/southParkUniversity/vocabulary>
      FROM NAMED <http://localhost:8000/graph/syapse>
      
      WHERE {
      
              {
                  GRAPH <http://localhost:8000/graph/southParkUniversity/vocabulary> {
                      ?c skos:altLabel ?term .
                      ?c skos:prefLabel ?pref .
                  }
                  BIND ('/' as ?classification )
              } UNION {
                  GRAPH <http://localhost:8000/graph/southParkUniversity/vocabulary> {
                      ?c skos:prefLabel ?term
                  }
                  BIND ('+' as ?classification )
              } UNION {
                  GRAPH <http://localhost:8000/graph/southParkUniversity/vocabulary> {
                      ?c skos:altLabel ?term .
                      FILTER NOT EXISTS {
      # The test is whether the prefLabel is in a different graph from
      # the altLabel (all my concepts have a prefLabel some where.
      # I should not need to specify the graph name again.                    
      #            GRAPH <http://localhost:8000/graph/southParkUniversity/vocabulary> {
                          ?c skos:prefLabel ?pref .
      #            }
                      }
                  }
                  BIND ('|' as ?classification )
              }
              ?c syapse:inScheme ?vocab .
              ?vocab syapse:shortId ?any_vocab .
              ?vocab syapse:shortId ?vocab_id .
              BIND ( LCASE(?term) as ?termlc )
              
      }
      ORDER BY ?termlc
      
      

      The work around is to include the redundant GRAPH stuff.
      (It is plausible that I have misunderstood the spec. The first task in fielding this bug is to read the spec carefully, the second is to reproduce with a small test case)

      See BLZG-964, which might be a duplicate of this ticket.

        Activity

        Hide
        bryanthompson bryanthompson added a comment -

        There is also BLZG-800 (select ?g { Graph ?g {} } incorrect) which would appear to be related.

        See the ASTGraphGroupOptimizer for both tickets.

        Show
        bryanthompson bryanthompson added a comment - There is also BLZG-800 (select ?g { Graph ?g {} } incorrect) which would appear to be related. See the ASTGraphGroupOptimizer for both tickets.
        Hide
        bryanthompson bryanthompson added a comment -

        Actually, this could be a bottom-up optimizer issue rather than a named graphs issue.

        Show
        bryanthompson bryanthompson added a comment - Actually, this could be a bottom-up optimizer issue rather than a named graphs issue.
        Hide
        michaelschmidt michaelschmidt added a comment -

        Resolved in branch quads_issues. The problem was that the triple pattern inside the FILTER NOT EXISTS clause did not inherit the graph context, but was evaluated over the DEFAULT_CONTEXT. This was an issue while translating the Sesame parse tree into a bigdata AST.

        Executed CI, looks good. Issuing pull request.

        Show
        michaelschmidt michaelschmidt added a comment - Resolved in branch quads_issues. The problem was that the triple pattern inside the FILTER NOT EXISTS clause did not inherit the graph context, but was evaluated over the DEFAULT_CONTEXT. This was an issue while translating the Sesame parse tree into a bigdata AST. Executed CI, looks good. Issuing pull request.
        Hide
        michaelschmidt michaelschmidt added a comment -

        Merged branch into master, closing issue.

        Show
        michaelschmidt michaelschmidt added a comment - Merged branch into master, closing issue.

          People

          • Assignee:
            michaelschmidt michaelschmidt
            Reporter:
            jeremycarroll jeremycarroll
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: