Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

nathanielrb
Copy link
Contributor

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.

nathaniel added 3 commits December 20, 2017 15:19
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)`.
Copy link
Member

@madnificent madnificent left a 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))))
Copy link
Member

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*)
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants