-
Notifications
You must be signed in to change notification settings - Fork 4
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 to return query results w/ order matching SELECT bindings #23
base: master
Are you sure you want to change the base?
Conversation
@@ -122,7 +123,7 @@ | |||
(let [namespaces (into {} | |||
(map (fn [^Namespace ns] [(.prefix ns) (.iri ns)])) | |||
(iterator-seq (.. results namespaces iterator)))] | |||
(with-meta (vector-map-results valfn results) {:namespaces namespaces}))) | |||
(vary-meta (vector-map-results valfn results) assoc :namespaces namespaces))) |
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.
with-meta
sets the metadata, overriding any previous metadata that may or may not have been present. vary-meta
updates existing metadata, and has the same signature as update
. We almost always want to accumulate metadata, never override it with new values.
55d14ce
to
d592176
Compare
@@ -98,11 +96,12 @@ | |||
|
|||
(defn key-map-results | |||
"Converts a Iteration of bindings into a seq of keymaps." | |||
[^IFn keyfn ^IFn valfn ^CloseableIterator results] | |||
[^IFn keyfn ^IFn valfn ^SelectQueryResult results] |
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.
Changing this to a more specific interface, which implements CLoseableIterator. See https://docs.stardog.com/javadoc/snarl/com/stardog/stark/query/SelectQueryResult.html
Necessary to avoid reflecting when calling the variables
method.
No description provided.