Skip to main content

A very small module to add Linked Data API functionality to a Python Flask installation

Project description

The Python Linked Data API (pyLDAPI) is:

A very small module to add Linked Data API functionality to a Python Flask installation.

PyPI version

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:

Block diagram of pyLDAPI's main parts

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.

Definitions

Alt Profile

The model view that lists all other views. This API uses the definition of alternates profile presented at https://promsns.org/def/alt.

Linked Data Principles

The principles of making things available over the internet in both human and machine-readable forms. Codified by the World Wide Web Consortium. See https://www.w3.org/standards/semanticweb/data.

Model View

A set of properties of a Linked Data object codified according to a standard or profile of a standard.

Object

Any individual thing delivered according to Linked Data principles.

Register

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

Block diagram of the GNAF implementation

Parts of the GNAF implementation

Block diagram of the ASGS implementation

Parts of the ASGS implementation

Documentation

Detailed documentation can be found at https://pyldapi.readthedocs.io/

Licence

This is licensed under GNU General Public License (GPL) v3.0. See the LICENSE deed for more details.

Contact

Dr Nicholas Car (lead)

Ashley Sommer (senior developer)

Informatics Software Engineer

Changelog

3.0

  • 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyldapi-3.4.tar.gz (17.2 kB view details)

Uploaded Source

Built Distribution

pyldapi-3.4-py2-none-any.whl (28.6 kB view details)

Uploaded Python 2

File details

Details for the file pyldapi-3.4.tar.gz.

File metadata

  • Download URL: pyldapi-3.4.tar.gz
  • Upload date:
  • Size: 17.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.3

File hashes

Hashes for pyldapi-3.4.tar.gz
Algorithm Hash digest
SHA256 26c3d773be1533d94c1483d339a07be0a50170b07ca59b8637e3322ade3f2e96
MD5 4c04dfeab40826d7df72b919d1cb539e
BLAKE2b-256 af260b64e3f2d59dda42837e5019b056e45157bff7676cdfd5b337a2fc665522

See more details on using hashes here.

File details

Details for the file pyldapi-3.4-py2-none-any.whl.

File metadata

  • Download URL: pyldapi-3.4-py2-none-any.whl
  • Upload date:
  • Size: 28.6 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.3

File hashes

Hashes for pyldapi-3.4-py2-none-any.whl
Algorithm Hash digest
SHA256 cb5e9bad23d8418f366f2d44d89d4462ebc3c40a63cac39d1c773d2822aa757a
MD5 45555bdf0637c33cecbc39046cffb14f
BLAKE2b-256 c05d2ab669ff0dd5f299473a4a2456b31a4a8fe7b1d8751d52f6e9758005c78b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page