2

I have a website power by a tomcat server. My application tap on a tripleStore that i would like to make public trough a sparql endpoint at www.mywebsiteaddress/sparql.

What configuration do i need on my webserver to do that ?

I use Jena Fuseki on the background which is running on the Port 3030 and my webserver is on the port 80.

My idea is that, when the webserver get a request on the port 80 about ..../sparql it redirect to fuseki sprql endPoint

MaatDeamon
  • 9,532
  • 9
  • 60
  • 127
  • This is too broad. At the moment, it appears something that would probably be covered in the documentation of the endpoint that you're using (which you didn't even mention), and if you're having some particular issue in configuring it, you haven't mentioned it. – Joshua Taylor May 30 '14 at 16:12

1 Answers1

3

This is more of a webservice / access control problem than anything SPARQL related. However, since SPARQL endpoints are supposed to be created as per the SPARQL spec, i think this a valid question, as I'm sure people will encounter it again in the future.

So, to answer your question, "public" usually means that certain headers are set in order to allow a request to hit the endpoint when it is not coming from the same domain. From there, you can specifically allow certain types of interactions with the endpoint. If you wanted to kinda just allow everything, you could set the following headers:

'Access-Control-Allow-Origin: *'
"Access-Control-Allow-Credentials: true"
'Access-Control-Allow-Headers: X-Requested-With'
'Access-Control-Allow-Headers: Content-Type'
'Access-Control-Allow-Methods: POST, GET, OPTIONS, DELETE //http://stackoverflow.com/a/7605119/578667
'Access-Control-Max-Age: 86400'

Depending on how you built the endpoint, it'll either have some settings somewhere where you can adjust the headers, or, you'll have find the headers settings for the application framework itself if you're using one. But, in general, the above headers would make it "public"

Kristian
  • 21,204
  • 19
  • 101
  • 176
  • I'm not sure if that does actually really solve my problem. I have updated the question. I'm not trying to configure the endpoint. I use jena, and is can make a sparql endpoint for you. The point is, my webserver is on port 80 and my sparql endpoint is on port 3030. How can i allow people to access my sparql endpoint from the port 80? such as www.mydomainadress/sparql. Indeed normaly everything that come at www.mydomainadress/ is on the port 80 and handled by my webserver. it's like having 2 servers on the same port, how do you deal with that ? – MaatDeamon May 31 '14 at 15:13
  • It seams that OpenRDf solve the issue as it is deployable as a WAR in tomcat. Also a more server oriented solution seem to be reverseproxy when one has 2 server behind one ips. But before changing my store and sparql endpoint? i would like to know if on a more server oriented appraoch as you outline above, there another solution for tha – MaatDeamon May 31 '14 at 17:23
  • Sure, a reverse proxy is often my solution of choice for scenarios in which multiple nodes are in use, but either way, the question is quickly veering off into another topic. Typically you want a middle layer of some kind to handle the logic of access and that is separate from the reverse proxy – Kristian May 31 '14 at 23:35