Currently the default namespace is kb in the Blazegraph web interface. We should make it islandora.
Related to:
https://wiki.blazegraph.com/wiki/index.php/NanoSparqlServer#web.xml
namespace parameter in the Web.xml file, which means we need to deploy blazegraph, then replace the Web.xml with a custom one, then restart tomcat.
Is it possible to not use the default namespace and instead use one that is Islandora-configured?
@ajs6f that's the goal here, and that's what the two related issues/pull requests above do; they use the islandora namespace instead of the default one.
We can by changing our endpoints to be
http://localhost:8080/bigdata/namespace/islandora/sparql
But I'm not sure how to add that secondary... namespace... graph... whatever to Blazegraph.
@whikloj it already is here https://github.com/Islandora-CLAW/claw_vagrant/pull/14/files#diff-6d96235c2d2b9964f1f47a92a98a342a
@ruebot Yeah, I was responding to @whikloj's first comment. I thought he was suggesting to change the default in Blazegraph, but I must have misunderstood.
Forget I said anything...I missed the point here.
Actually no wait, what I said about the web.xml is probably correct. This is just about making it so people don't have to switch the namespaces in the web UI. So changing the default namespace in the web.xml will _probably_ effect that change. However there may be unintended consequences to this action. But if this is just for vagrant and testing and not for the application as a deployment then I would give it a try.
@whikloj that's it exactly! Good point about surfacing unintended consequences too. Did you want to take this one on after https://github.com/Islandora-CLAW/claw_vagrant/pull/14 gets merged?
Sure
@whikloj https://github.com/Islandora-CLAW/claw_vagrant/pull/14 has been merged.
Forget this, the setting in the web.xml actually just directs which namespace to apply queries and updates if you don't specify one in the URL.
ie.
With the parameter set to islandora in the web.xml I did
curl -i -XPOST -d "prefix pcdm: <http://pcdm.org/models#> INSERT DATA {<info:testCollection> a pcdm:Collection .}" -H"Content-type: application/sparql-update" http://localhost:8080/bigdata/sparql
Then check in the kb namespace
curl -i -XPOST "http://localhost:8080/bigdata/namespace/kb/sparql" -H"Content-type: application/sparql-query" -d"select ?p ?o where { <info:testCollection> ?p ?o }"
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: application/sparql-results+xml;charset=UTF-8
Transfer-Encoding: chunked
Date: Wed, 15 Feb 2017 21:12:40 GMT
<?xml version='1.0' encoding='UTF-8'?>
<sparql xmlns='http://www.w3.org/2005/sparql-results#'>
<head>
<variable name='p'/>
<variable name='o'/>
</head>
<results>
</results>
</sparql>
But querying the islandora namespace
curl -i -XPOST "http://localhost:8080/bigdata/namespace/islandora/sparql" -H"Content-type: application/sparql-query" -d"select ?p ?o where { <info:testCollection> ?p ?o }"
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: application/sparql-results+xml;charset=UTF-8
Transfer-Encoding: chunked
Date: Wed, 15 Feb 2017 21:12:23 GMT
<?xml version='1.0' encoding='UTF-8'?>
<sparql xmlns='http://www.w3.org/2005/sparql-results#'>
<head>
<variable name='p'/>
<variable name='o'/>
</head>
<results>
<result>
<binding name='p'>
<uri>http://www.w3.org/1999/02/22-rdf-syntax-ns#type</uri>
</binding>
<binding name='o'>
<uri>http://pcdm.org/models#Collection</uri>
</binding>
</result>
</results>
</sparql>
The default namespace in the Web UI is actually set by a user on their first use, then it is stored in the browser's local storage.
If you delete all the cookies/data you can see what it was like the first time.
But short of mimicking a javascript storage call, people just have to change their namespace manually.
@whikloj shall I label this as 'won't fix' and close it?