Skip to content

Commit

Permalink
Removed support for blank nodes for DECONSTRUCT
Browse files Browse the repository at this point in the history
  • Loading branch information
apr94 committed Jul 25, 2017
1 parent cff771d commit 6f1520c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
8 changes: 0 additions & 8 deletions bql/grammar/grammar.go
Original file line number Diff line number Diff line change
Expand Up @@ -910,14 +910,6 @@ func BQL() *Grammar {
NewSymbol("MORE_DECONSTRUCT_TRIPLES"),
},
},
{
Elements: []Element{
NewTokenType(lexer.ItemBlankNode),
NewSymbol("CONSTRUCT_PREDICATE"),
NewSymbol("CONSTRUCT_OBJECT"),
NewSymbol("MORE_DECONSTRUCT_TRIPLES"),
},
},
{
Elements: []Element{
NewTokenType(lexer.ItemBinding),
Expand Down
16 changes: 13 additions & 3 deletions bql/grammar/grammar_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ func TestAcceptByParse(t *testing.T) {
`deconstruct {?s "new_predicate"@[] ?o} in ?a from ?b where {?s "old_predicate"@[,] ?o} having ?s = ?o;`,
`deconstruct {?s "new_predicate"@[] ?o} in ?a from ?b where {?s "old_predicate"@[,] ?o};`,
`deconstruct {?s ?p ?o.
_:v "_subject"@[] ?s.
_:v "_predicate"@[] ?p.
_:v "_object"@[] ?o}
?n "_subject"@[] ?s.
?n "_predicate"@[] ?p.
?n "_object"@[] ?o}
in ?a, ?b
from ?c, ?d
where {?n "_subject"@[] ?s.
Expand Down Expand Up @@ -297,6 +297,16 @@ func TestRejectByParse(t *testing.T) {
from ?b
where {?s "old_predicate_1"@[,] ?o1.
?s "old_predicate_2"@[,] ?o2};`,
// Deconstruct clause with blank nodes.
`deconstruct {?s ?p ?o.
_:v "_subject"@[] ?s.
_:v "_predicate"@[] ?p.
_:v "_object"@[] ?o}
in ?a, ?b
from ?c, ?d
where {?n "_subject"@[] ?s.
?n "_predicate"@[] ?p.
?n "_object"@[] ?o};`,
}
p, err := NewParser(BQL())
if err != nil {
Expand Down

0 comments on commit 6f1520c

Please sign in to comment.