-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add option for explicit rdf:type declarations #8
base: master
Are you sure you want to change the base?
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)`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 :-)
@@ -29,3 +29,7 @@ | |||
(defparameter *supply-cache-headers-p* nil | |||
"when non-nil, cache headers are supplied. this works together with mu-cache.") | |||
|
|||
(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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.