Closed hartig closed 3 years ago
ARQ supports 5 functions related to embedded triples. Currently they have URIs and are implemented as custom functions but, like the constructors and accessors for other RDF terms in SPARQL, they ought to have keywords:
Function | Description |
---|---|
triple(?s, ?p, ?o) | Create an embedded triple from s/p/o |
isTriple(?t) | Return true if the argument value is an embedded triple else false |
subject(?t) | Return the subject of the embedded triple (else error) |
predicate(?t) | Return the predicate (property) of the embedded triple (else error) |
object(?t) | Return the object of the embedded triple (else error) |
@jeenbroekstra do you have such functions in the SPARQL-star support in RDF4J? What do they look like?
@klinovp what about Stardog?
@gkellogg ?
Issue #27 has responses from implementers about constructors and accessors.
Good find. I thought I had seen such a discussion before ;-)
@hartig RDF4J has the same functions as mentioned for GraphDB by @VladimirAlexiev in #27. And I agree that a standardization (including a better namespace) would be useful.
(ses also #6)
Related to this issues, should <<?s ?p ?o>>
be allowed in expressions (FILTER, BIND SELECT-AS).
I've checked and it can be done. Add it to PrimaryExpression
. There are some details of defining evaluation because it may have variables inside an element of PrimaryExpression
.
However, it does not add any new functionality as far as I can see over TRIPLE, and TRIPLE is more general (it can take expressions for arguments, pattern syntax <<?s ?p ?o>>
doesn't.
If <<>>
is syntactic sugar - is it worth the effort, including support and education implications.
Nearby: SPARQL does not allow variables in parts of literals: e.g. ?lex^^xsd:date
, ?str@?lang
. It has been suggested to add it to patterns. It is not new functionality: using lang
or datatype
or str
(+isLiteral
) has the same effect.
If <<>> is syntactic sugar - is it worth the effort, including support and education implications.
Probably not.
During today's telco we have agreed to implement this proposal. I will create a PR for it.
PR #118 implements the proposal to add the five new built-in functions to the spec.
Closing this issue as PR #118 has been merged now.
We may think about defining a built-in function that enables users to construct triples in expressions. Such a function may be used in BIND, but also in FILTER and in SELECT.