As discussed in #1175580: local ARC2 stores for collections of remote RDF files, the API should be changed to take an endpoint object from SPARQL Registry.

Comments

Anonymous’s picture

Status: Active » Needs review
StatusFileSize
new4.59 KB

This patch:

  • Changes the parameters passed to sparql_request from (query, endpoint, options, datasets) to (query, endpoint)
  • Removes the logic for creating a local store... this should be handled through SPARQL registry rather than on the fly
  • Removes logic for LOADing into sparql.org, etc, because those often fail
  • Adds a sparql_registry_load_by_uri function so that consumer modules can more easily get SPARQL Registry objects
Anonymous’s picture

StatusFileSize
new5.04 KB

This one does all of those things and also adds a CHANGELOG file to keep track of API changes and things that will affect existing user config.

scor’s picture

+++ b/sparql.module
@@ -171,12 +114,11 @@ function _sparql_init_store($name, $endpoint = FALSE) {
-    'remote_store_endpoint' => $endpoint,
-    'store_read_key' => !empty($options['store_read_key']) ? $options['store_read_key'] : '',
+    'remote_store_endpoint' => $endpoint->endpoint,

where are the options handled then? in sparql registry? in any case, shouldn't the ARC2 remote endpoint config be aware of it?

Powered by Dreditor.

Anonymous’s picture

Does store_read_key work for remote endpoints? In reviewing the ARC2 code, I thought it only applied to local stores, but I might be wrong.

I'm planning on adding a form to SPARQL Registry that will allow you to associate keys and values (like 'apikey' = 'linAbCd'). These would then be used in the remote query. They would be passed as part of the object.

EDIT: typo

scor’s picture

even if ARC2 does not support it, we should design the API such that read/write key can be used for remote endpoints for example.

Anonymous’s picture

Or no, I think store_read_key only works with other ARC2 endpoints because it uses a specific key, which other endpoints might not use.

Anonymous’s picture

even if ARC2 does not support it, we should design the API such that read/write key can be used for remote endpoints for example.

Yes, that is what I plan to do with #1210582: Add support for URL parameters. I plan to start work on that once this patch is committed.

scor’s picture

I hadn't seen that issue.

I think you should go ahead and commit that patch #2, as there currently is no easy way to test this patch without the other pending issues. We should think about the previous feature where there was a temporary store which was used for random SPARQL queries. this store could be created manually via the SR, but it would be nice if it was instead hidden from that UI (via passing a SR-like object?). This could probably be in a separate issue.

Anonymous’s picture

Ok, that makes sense to me. I did test this patch with SPARQL Views, and it worked. Issue #1211986: sync with API changes in sparql module has a patch that shows the necessary change.

I'll commit and then start work on #1210582: Add support for URL parameters

Anonymous’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.