Add option for explicit rdf:type declarations#8
Conversation
Sometimes it's useful to have rdf:types explicitly declared in property and relation queries. This is implemented, and can be turned on using the parameter *declare-resource-types-p*.
Although it's accepted by Virtuoso, technically `MAX(?__name1) AS ?__name1` is invalid SPARQL, since it omits the surrounding parentheses. The select clause should be `SELECT DISTINCT ?uuid (MAX(?__name1) AS ?__name1)`.
madnificent
left a comment
There was a problem hiding this comment.
In general, I'm not absolutely pro adding this sort of information to the SPARQL endpoint. I understand where you're coming from, and I believe it is a good way to try out the new authorization technologies. I suggest we keep this as an experimental feature so we can drop it when we've moved forward. Thanks for suggesting this feature and for implementing it.
I read over the first few code changes which yielded some trivial questions. The rest of the code requires a view in the right context & will follow later :-)
|
|
||
| (defparameter *declare-resource-types-p* | ||
| (let ((env (uiop:getenv "MU_DECLARE_RESOURCE_TYPES"))) | ||
| (and env (or (equal env "true") (equal env "TRUE") (equal env "True") (equal env T)))) |
There was a problem hiding this comment.
Perhaps the following is more readable:
(defparameter *declare-resource-types-p* (equalp "true" (uiop:getenv "MU_DECLARE_RESOURCE_TYPES"))
"....")
| (defun resource-type-declaration (resource-url resource) | ||
| "Returns an rdf:type declaration if *declare-resource-types-p* is t, | ||
| otherwise the empty string." | ||
| (if (or 4 *declare-resource-types-p*) |
There was a problem hiding this comment.
I'm not following what the value of this or statement is. Leftover debugging?
Sometimes it's useful to have rdf:types explicitly declared in
property and relation queries. This is implemented, and can be
turned on using the parameter declare-resource-types-p.