From 17167437f9b0deac2ce0cd5c2068780addc67807 Mon Sep 17 00:00:00 2001 From: Andy Seaborne Date: Sun, 14 Dec 2025 10:58:35 +0000 Subject: [PATCH 1/2] GH-282, GH-283: Restrict triple terms to have only IRI as a constant subject in VALUES and expressions --- spec/index.html | 4 ++-- spec/sparql.bnf | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/index.html b/spec/index.html index 272e758c..3f052d5d 100644 --- a/spec/index.html +++ b/spec/index.html @@ -12109,7 +12109,7 @@

Grammar

[123]   TripleTermDataSubject   ::=   - iri | RDFLiteral | NumericLiteral | BooleanLiteral | TripleTermData + iri @@ -12214,7 +12214,7 @@

Grammar

[138]   ExprTripleTermSubject   ::=   - iri | RDFLiteral | NumericLiteral | BooleanLiteral | Var | ExprTripleTerm + iri | Var diff --git a/spec/sparql.bnf b/spec/sparql.bnf index d24d335e..8b085e9a 100644 --- a/spec/sparql.bnf +++ b/spec/sparql.bnf @@ -120,7 +120,7 @@ TripleTerm ::= '<<(' TripleTermSubject Verb TripleTermObject ')>> TripleTermSubject ::= Var | iri | RDFLiteral | NumericLiteral | BooleanLiteral | BlankNode | TripleTerm TripleTermObject ::= Var | iri | RDFLiteral | NumericLiteral | BooleanLiteral | BlankNode | TripleTerm TripleTermData ::= '<<(' TripleTermDataSubject ( iri | 'a' ) TripleTermDataObject ')>>' -TripleTermDataSubject ::= iri | RDFLiteral | NumericLiteral | BooleanLiteral | TripleTermData +TripleTermDataSubject ::= iri TripleTermDataObject ::= iri | RDFLiteral | NumericLiteral | BooleanLiteral | TripleTermData VarOrIri ::= Var | iri Var ::= VAR1 | VAR2 @@ -138,7 +138,7 @@ UnaryExpression ::= '!' UnaryExpression | PrimaryExpression PrimaryExpression ::= BrackettedExpression | BuiltInCall | iriOrFunction | RDFLiteral | NumericLiteral | BooleanLiteral | Var | ExprTripleTerm ExprTripleTerm ::= '<<(' ExprTripleTermSubject Verb ExprTripleTermObject ')>>' -ExprTripleTermSubject ::= iri | RDFLiteral | NumericLiteral | BooleanLiteral | Var | ExprTripleTerm +ExprTripleTermSubject ::= iri | Var ExprTripleTermObject ::= iri | RDFLiteral | NumericLiteral | BooleanLiteral | Var | ExprTripleTerm BrackettedExpression ::= '(' Expression ')' BuiltInCall ::= Aggregate From 1d474ad8d67c78e46caedcc3a9200484d9070f94 Mon Sep 17 00:00:00 2001 From: Andy Seaborne Date: Tue, 16 Dec 2025 13:01:41 +0000 Subject: [PATCH 2/2] GH-283: Update TRIPLE text --- spec/index.html | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/spec/index.html b/spec/index.html index 3f052d5d..faf58442 100644 --- a/spec/index.html +++ b/spec/index.html @@ -7926,7 +7926,6 @@
TZ
-

Functions on Triple Terms

@@ -7956,17 +7955,26 @@
TRIPLE
the function returns a triple term with these three elements. Otherwise, the function raises an error.

-

As a shorthand notation, the TRIPLE function can also be written in the form of a triple term expression - using <<( and )>>. There is a - syntax limitation to this shorthand form: the three elements of - the triple term expression can only be variables and directly - written RDF terms, not arbitrary expressions. - In contrast, the function form, TRIPLE, - can be used with arbitrary expressions. + using <<( and )>>. There are + syntax limitations to this shorthand form: +

+
    +
  • each of the three elements of the triple term expression can only be + a variable + or a directly written [=RDF term=], not an arbitrary expression. +
  • +
  • + the syntax of the subject and predicate positions is limited to an + IRI or a + variable. +
  • +
+

+ The function form, TRIPLE, can be used with arbitrary expressions.

               VERSION "1.2"
@@ -8051,7 +8059,6 @@ 
isTRIPLE

-

Hash Functions