This is an example of a simple web API implemented using Flask and Flask-RESTful.
To run it:
-
Install required dependencies:
$ pip install -r requirements.txt
Flask and Flask-RESTful to run
server.py
and RDFLib and JSONLD for RDFLib to run theextractdata.py
script or theanother-server.py
service. -
Run the helpdesk server:
$ python server.py
Alternatively, you can access the service running here: http://aeshin.org:5555/requests
-
Use the
extractdata.py
script to examine the triples found in various representations of the helpdesk resources.RDFa/microdata for the list of help requests:
$ python extractdata.py http://aeshin.org:5555/requests
JSON-LD for the list of help requests:
$ python extractdata.py http://aeshin.org:5555/requests.json
RDFa/microdata for an individual help request:
$ python extractdata.py http://aeshin.org:5555/request/fhs6jo
JSON-LD for an individual help request:
$ python extractdata.py http://aeshin.org:5555/request/fhs6jo.json
-
Run the contacts server for an example of a service calling another service:
$ python another-server.py
Alternatively, you can access the service running here: http://aeshin.org:5556/contacts.json