A very small module to add Linked Data API functionality to a Python Flask installation
Welcome to pyLDAPI
The Python Linked Data API (pyLDAPI) is:
A very small module to add Linked Data API functionality to a Python Flask installation.
What is it?
This module contains a small Python module which is intended to be added (imported) into a Python Flask installation to add a small library of Renderer classes which can be used to handle requests and return responses in a manner consistent with Linked Data principles of operation.
The intention is to make it easy to “Linked Data-enable” web APIs.
An API using this module will get:
- an alt profile for each endpoint that uses a Renderer class to return responses that the API delivers
- this is a profile, or view of the resource that lists all other available profiles
- a Register of Registers
- a start-up function that auto-generates a Register of Registers is run when the API is launched.
- a basic, over-writeable template for Registers’ HTML & RDF
- all of the functionality defined by the W3C’s Content Negotiation by Profile specification
- to allow for requests of content that conform to data specifications and profiles
The main parts of pyLDAPI are as follows:
Web requests arrive at a Web Server, such as Apache or nginx, which then forwards (some of) them on to Flask, a Python web framework. Flask calls Python functions for web requests defined in a request/function mapping and may call pyLDAPI elements. Flask need not call pyLDAPI for all requests, just as Apache/nginx need not forward all web request to flask. pyLDAPI may then draw on any Python data source, such as database APIs, and uses the rdflib Python module to formulate RDF responses.
The model view that lists all other views. This API uses the definition of Alternate Profiles Data Model as an OWL ontology presented at https://www.w3.org/TR/dx-prof-conneg/#altr-owl.
A set of properties of a Linked Data object codified according to a standard or profile of a standard.
Any individual thing delivered according to Linked Data principles.
A simple listing of URIs of objects, delivered according to Linked Data principles.
Register of Registers
A register that lists all other registers which this API provides.
pyLDAPI in action
- Register of Media Types
- Linked Data version of the Geocoded National Address File
Parts of the GNAF implementation
- Geoscience Australia’s Sites, Samples Surveys Linked Data API
- Linked Data version of the Australian Statistical Geography Standard product
Parts of the ASGS implementation
Detailed documentation can be found at https://pyldapi.readthedocs.io/
This is licensed under GNU General Public License (GPL) v3.0. See the LICENSE deed for more details.
Dr Nicholas Car (lead)
- tokens applied to Representations in Alternate View profile, not Profiles
- Content Negotiation specification by Profile supported
- replaced all references to “format” with “Media Type” and “view” with “profile”
- renamed class View to Profile
- added unit tests for all profile functions
- added unit tests for main ConnegP functions
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size pyldapi-3.12-py3-none-any.whl (29.0 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size pyldapi-3.12.tar.gz (17.7 kB)||File type Source||Python version None||Upload date||Hashes View|