-
Notifications
You must be signed in to change notification settings - Fork 38
#315: Added support for sh:eval to SHACL-SPARQL #328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I don't think Suggestion: We might have similar naming issues elsewhere in SHACL grows in SHACL 1.2 so adopting a naming convention (often applied, not always) I'd like to reserve for
where |
Right, I had similar concerns about "eval". But sparqlExpr is quite a mouthful too, and will lead to awkward names because the term "expression" is already used in node expressions. So we would have sh:SelectExpression but sh:SPARQLExprExpression (?) Also note that we use sh:select and sh:ask instead of sh:sparqlSelect and sh:sparqlAsk. sh:eval is quite short to write for people who edit node expressions. But there may be a better stand-alone name from the SPARQL universe that doesn't need to be prefixed with "sparql"? |
Does the SPARQL Grammar provide any helpful hints for what could work instead of |
Given the hypothetical So what if we called this a |
The "beauty" of sh:eval is the similarity to the JS eval method, which also takes a string and executes it as a sub-script. At least sh:sparqlEval should be better than sh:sparqlExpr to avoid the double use of "expression". |
JS eval is an "action". This use in SHACL is declaring the expression written in SPARQL. We already have
and we are talking about the
In SPARQL it is an expression so Other:
|
I am in general not sure yet whether those node expressions should sound like verbs or nouns or a mix. Right now it's a mix. "select" and "ask" can be either a pointer to a SELECT query or be the verb "to select". Any name is a compromise and language is always a bit ambiguous. We just need to pick something that we can reasonably live with. In any case, I can of course replace eval(expr, activeGraph, scope) with evalExpr(expr, activeGraph, scope) in the specs as part of this PR in case we elect to stay with sh:eval. |
I think evaluation is going to be
Whether this part of the NE document or in Core isn't clear to me. Separating out the environment is cleaner to implement - the name parameter map is a stack across calls (and could even have named results), the environment is unchanging and maybe made immutable. Use in SPARQL will be simple names so the use of URIs isn't going to so easy to keep things apart. |
Closing this PR because it is also part of #340 and people have made suggestions there that actually affect sh:eval. Let's continue with the other PR in a streamlined manner. |
No description provided.