You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This will not output anything, since - is no longer allowed as part of names (cf. #545). It will also not output any diagnostics. We have thus traded an unwarranted (yet, arguably, helpful) diagnostic
result(?arithmetic-1) :- fact(?arithmetic) .
──────┬──────
╰──────── unsafe variable used in rule head: `?arithmetic-1`
Help: a variable with a similar name exists: `arithmetic`
Note: every universal variable in the head must occur at a safe position in the body
that makes it quite obvious what the issue is (and how to fix it) for silently ignoring parts of the program. From a user experience standpoint, this is much worse. Also note that the same issue as #543 still persists with %, which we still allow in names (it's used for escape sequences in prefixed names). This is also even worse than the potential problem outlined in #545 and #546, in that I can easily change the prefix names I define in the program, but I have to work with the local names I get from upstream RDF graphs, and always using fully expanded IRIs is a terrible experience.
First of all, we should probably not treat variable names, plain constants, and prefixed names the same – there's no good reason a variable name should be able to contain a - or an % (there might be other characters that cause confusion with builtin operators as well). Second, we should have diagnostics for clearly ill-formed rules: subtracting a constant from a constant should be a syntax error (or, at the very least, a warning) – how could this ever be interpreted as a valid rule (note that, e.g., this problem doesn't arise in SPARQL, as constant names are not allowed in arithmetic expressions there)? This would then allow us to accept - and % in both the prefix name and the local name of a prefixed name.
The text was updated successfully, but these errors were encountered:
Consider
foo.ttl
withand a program
This will not output anything, since
-
is no longer allowed as part of names (cf. #545). It will also not output any diagnostics. We have thus traded an unwarranted (yet, arguably, helpful) diagnosticthat makes it quite obvious what the issue is (and how to fix it) for silently ignoring parts of the program. From a user experience standpoint, this is much worse. Also note that the same issue as #543 still persists with
%
, which we still allow in names (it's used for escape sequences in prefixed names). This is also even worse than the potential problem outlined in #545 and #546, in that I can easily change the prefix names I define in the program, but I have to work with the local names I get from upstream RDF graphs, and always using fully expanded IRIs is a terrible experience.First of all, we should probably not treat variable names, plain constants, and prefixed names the same – there's no good reason a variable name should be able to contain a
-
or an%
(there might be other characters that cause confusion with builtin operators as well). Second, we should have diagnostics for clearly ill-formed rules: subtracting a constant from a constant should be a syntax error (or, at the very least, a warning) – how could this ever be interpreted as a valid rule (note that, e.g., this problem doesn't arise in SPARQL, as constant names are not allowed in arithmetic expressions there)? This would then allow us to accept-
and%
in both the prefix name and the local name of a prefixed name.The text was updated successfully, but these errors were encountered: