Problem fixed (and a peak under the hood)

So, the Sesame status queries were broken as a result of the Sesame upgrade, but the problem was not due to Sesame itself.  In order for these jquery-based status buttons to work, a solution to the cross-origin resource sharing restriction is necessary.  One solution to this would be simply to return everything via wrapped JSON (a protocol called JSONP).  There are several places in the tools I work with in my day job where people have used the JSONP approach and I gave serious thought to going this way when I got back to implementing the sesame queries.  Virtuoso, another triple-store (used by Phenoscape and several other projects) has a configuration to disable the cross-origin restriction, but I was never able to get it to work (either it wasn’t available in the version I could get to run on ubuntu, or there were other problems with my configuration – I suspect the later).

However, I’m serving triples with Sesame, hosted under Tomcat, so there turns out to be another option – a filter called CORS Filter, that can be (relatively) easily installed and configured in a tomcat (or other java servlet container) installation.  If anyone knows any more about this module, please do leave a comment, otherwise I’m using it because it works.  If it phones home or something nefarious, all it’s sharing is a bunch of annotations of spider behavior, so I’m not worried about that.

In any case, the installation involves adding some elements to the target service’s web.xml file.  Since the target service is sesame-rdf, not spider-behavior (the top level web package), I had to go in and modify the web.xml file after uploading the .war file into tomcat.  Adding the two required elements and restarting tomcat resolved the problem (try it).

Advertisements

One thought on “Problem fixed (and a peak under the hood)

  1. Apparently this post was picked up on StackOverflow (http://stackoverflow.com/questions/29785633/querying-sesame-triplestore-using-javascript). Since I don’t have the reputation points to add comments and this is less than an answer, I’ll just mention here that the CORS filter is still working fine on the Ubuntu 14.04 EC2 instance that runs the site. I’m not sure there’s much I can suggest if you can’t edit the Tomcat configuration files (and I’ve never tried installing Tomcat on Windows).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s