Giter Club home page Giter Club logo

sparqlproxyphp's Introduction

#SparqlProxyPHP

A PHP forward proxy for remote access to SPARQL endpoints; forwards request/response headers and filters out non-SPARQL URL arguments.

Introduction

The proxy introduces an additional "service-uri" query string parameter which supports specifying a remote endpoint. The main motivation is to enable remote access to SPARQL endpoints from within JavaScript. Note that this proxy consists of a single file that only does the forwarding of requests and response (headers). If you are looking for a proxy that features more than that, you may want to check out this project.

Warning

Right now it is still possible to access arbitrary sites with it. There has to be added some checks whether the target is actually a SPARQL endpoint (otherwise illegal content could be obtained via the proxy). The probably simplest filtering would be the requirement, that the service-uri has to end in /sparql.

Filtering

The service-uri parameter is processed as follows:

  • Only host name, port and path are retained, all other URI components are discarded.

From the request url, the following processing is performed:

  • Only the query string arguments query, format, timeout are retained. **TODO Support at least all arguments by SPARQL spec **

Deployment (Ubuntu):

You need apache, php and php-curl installed:

sudo apt-get install libapache2-mod-php5 php5-curl

Make the script accessible via apache, e.g.

cp sparql-proxy.php /var/www

Example Usage:

The following example requests the first 3 results from LinkedGeoData.

curl http://localhost/sparql-proxy.php?service-uri=http%3A%2F%2Flinkedgeodata.org%2Fsparql&query=Select+%2A+%7B+%3Fs+%3Fp+%3Fo+%7D+Limit+3

sparqlproxyphp's People

Contributors

aklakan avatar seebi avatar

Stargazers

Mark Hughes (happybeing) avatar Mohamed Osman avatar Sayem Chowdhury avatar Jonas Jetschni avatar  avatar Michael Haschke avatar

Watchers

James Cloos avatar Mark Hughes (happybeing) avatar  avatar

Forkers

geoknow

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.