Adds triple pattern to SPARQL expression

pull/171/head
Tpt 4 years ago
parent 10ee6e17f0
commit 98d98d9b85
  1. 8
      spargebra/src/parser.rs
  2. 4
      testsuite/tests/sparql.rs

@ -1741,7 +1741,8 @@ parser! {
l:RDFLiteral() { l.into() } /
l:NumericLiteral() { l.into() } /
l:BooleanLiteral() { l.into() } /
BuiltInCall()
BuiltInCall() /
TripleExpression()
//[120]
rule BrackettedExpression() -> Expression = "(" _ e:Expression() _ ")" { e }
@ -2094,6 +2095,11 @@ parser! {
t:GraphTerm() { t.into() } /
t:EmbTP() { t.into() }
// Extra rule not yet in the spec
rule TripleExpression() -> Expression = "<<" _ s:Expression() _ p:Expression() _ o:Expression() _ ">>" {
Expression::FunctionCall(Function::Triple, vec![s, p, o])
}
//space
rule _() = quiet! { ([' ' | '\t' | '\n' | '\r'] / comment())* }

@ -151,10 +151,6 @@ fn sparql_star_query_syntax_testsuite() -> Result<()> {
"https://w3c.github.io/rdf-star/tests/sparql/syntax#sparql-star-update-6",
"https://w3c.github.io/rdf-star/tests/sparql/syntax#sparql-star-update-7",
"https://w3c.github.io/rdf-star/tests/sparql/syntax#sparql-star-update-8",
// Not covered by grammar yet
"https://w3c.github.io/rdf-star/tests/sparql/syntax#sparql-star-expr-1",
"https://w3c.github.io/rdf-star/tests/sparql/syntax#sparql-star-expr-2",
"https://w3c.github.io/rdf-star/tests/sparql/syntax#sparql-star-expr-6",
],
)
}

Loading…
Cancel
Save