From 5aeea5588406d2a91640b3e38d31d587784e81a8 Mon Sep 17 00:00:00 2001 From: Tpt Date: Mon, 13 Sep 2021 22:24:35 +0200 Subject: [PATCH] SPARQL: PropertyListPathNotEmpty children should be ObjectListPath for consistency --- spargebra/src/parser.rs | 8 ++++---- testsuite/oxigraph-tests/sparql/manifest.ttl | 5 +++++ testsuite/oxigraph-tests/sparql/property_list_path.rq | 5 +++++ 3 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 testsuite/oxigraph-tests/sparql/property_list_path.rq diff --git a/spargebra/src/parser.rs b/spargebra/src/parser.rs index 2a044a51..64a5f6c1 100644 --- a/spargebra/src/parser.rs +++ b/spargebra/src/parser.rs @@ -1665,15 +1665,15 @@ parser! { patterns: ho.patterns }, |mut a, b| { a.focus.push(b.focus); - a.patterns.extend(b.patterns.into_iter().map(|v| v.into())); + a.patterns.extend(b.patterns); a }) } - rule PropertyListPathNotEmpty_item() -> Option)>> = ";" _ c:PropertyListPathNotEmpty_item_content()? { + rule PropertyListPathNotEmpty_item() -> Option)>> = ";" _ c:PropertyListPathNotEmpty_item_content()? { c } - rule PropertyListPathNotEmpty_item_content() -> FocusedTriplePattern<(VariableOrPropertyPath,Vec)> = p:(VerbPath() / VerbSimple()) _ o:ObjectList() _ { - FocusedTriplePattern { + rule PropertyListPathNotEmpty_item_content() -> FocusedTripleOrPathPattern<(VariableOrPropertyPath,Vec)> = p:(VerbPath() / VerbSimple()) _ o:ObjectListPath() _ { + FocusedTripleOrPathPattern { focus: (p, o.focus.into_iter().map(AnnotatedTermPath::from).collect()), patterns: o.patterns } diff --git a/testsuite/oxigraph-tests/sparql/manifest.ttl b/testsuite/oxigraph-tests/sparql/manifest.ttl index b2565abe..df586541 100644 --- a/testsuite/oxigraph-tests/sparql/manifest.ttl +++ b/testsuite/oxigraph-tests/sparql/manifest.ttl @@ -12,6 +12,7 @@ :describe_where :group_concat_with_null :single_not_exists + :property_list_path ) . :describe rdf:type mf:QueryEvaluationTest ; @@ -42,3 +43,7 @@ [ qt:query ; qt:data ] ; mf:result . + +:property_list_path rdf:type mf:PositiveSyntaxTest ; + mf:name "PropertyListPathNotEmpty children should be ObjectListPath for consistency" ; + mf:action . diff --git a/testsuite/oxigraph-tests/sparql/property_list_path.rq b/testsuite/oxigraph-tests/sparql/property_list_path.rq new file mode 100644 index 00000000..25306581 --- /dev/null +++ b/testsuite/oxigraph-tests/sparql/property_list_path.rq @@ -0,0 +1,5 @@ +PREFIX ex: + +SELECT ?o WHERE { + ?s a ex:A ; ex:p [ ex:p1/ex:p2 ?o ] +}