anchor.diff:      ;
   
   triplesSameSubject
  -    : varOrTerm! propertyListNotEmpty[(CommonTree) $varOrTerm.tree]
  -    | triplesNode propertyListNotEmpty[(CommonTree) $triplesNode.tree]?
  +    : varOrTerm propertyListNotEmpty[(CommonTree) $varOrTerm.tree] -> propertyListNotEmpty
  +    | triplesNode propertyListNotEmpty[(CommonTree) $triplesNode.tree]? -> triplesNode propertyListNotEmpty?
       ;
   
   propertyListNotEmpty[CommonTree subject]
  
positive.code:     | MAX OPEN_BRACE DISTINCT? expression CLOSE_BRACE -> ^(MAX DISTINCT* expression)
      | AVG OPEN_BRACE DISTINCT? expression CLOSE_BRACE -> ^(AVG DISTINCT* expression)
      | SAMPLE OPEN_BRACE DISTINCT? expression CLOSE_BRACE -> ^(SAMPLE DISTINCT? expression)
      | GROUP_CONCAT OPEN_BRACE DISTINCT? expression ( SEMICOLON SEPARATOR '=' string )? CLOSE_BRACE -> ^(GROUP_CONCAT DISTINCT* expression string*)
      ;
      
  iriRefOrFunction
  
negative.code:     ;
      
  pathMod
      : ASTERISK 
      | QUESTION_MARK 
      | PLUS 
      | OPEN_CURLY_BRACE ( INTEGER ( COMMA ( CLOSE_CURLY_BRACE | INTEGER CLOSE_CURLY_BRACE ) | CLOSE_CURLY_BRACE ) | COMMA INTEGER CLOSE_CURLY_BRACE ) 
      ;
  
  pathPrimary
      : iriRef 
      | A 
      | NEGATION pathNegatedPropertySet 
      | OPEN_BRACE! path CLOSE_BRACE!
      ;
  
  pathNegatedPropertySet
  