InterLex implementation
Table of Contents
Overview
This document describes current implementation of InterLex. InterLex is written in Python and uses PostgreSQL as a datastore. A full RDBMS is not strictly necessary as the basic model for the InterLex data structure can be managed by convention using a quad store. However, managing contributor identity as a reference host means that there are additional features that require a persistent and secure data store, so the choice to unify the graph + provenance data structure along with the groups (i.e. users and organizations) data structure reduces the overall complexity of the system.
Architecture
Lang | Component | The people we want to share information with |
---|---|---|
nginx config | nginx | reverse proxy and routing |
cli | gunicorn | production grade wsgi server |
Python | flask | |
Python | InterLex | Loading and Rendering |
Python | sqlalchemy | |
plpgsql | PostgreSQL | data integrity and indexing |
Database schema
The database schema written in the postgres sql dialect and the source files live at https://github.com/tgbugs/interlex/tree/master/sql. There are excessive details and notes in the comments of those files, though they are not always helpful.
Inspecting the schema with SchemaSpy
SchemaSpy can be used to generate a visual overview and report on the database schema. There in the https://github.com/tgbugs/interlex/tree/master/resources folder there is an example ini file for generating output.
- Installation
- Gentoo
layman -a tgbugs-overlay
- update file:///etc/portage/repos.conf/layman.conf
emerge schemaspy-bin
- Other
See https://schemaspy.readthedocs.io/en/latest/installation.html for details.
- Gentoo
- Generate report
if [ ! -f "../resources/schemaspy.ini" ]; then cp ../resources/schemaspy.ini.example ../resources/schemaspy.ini vim ../resources/schemaspy.ini # edit to match your config fi schemaspy -configFile ../resources/schemaspy.ini
After running the above the output should exist.