/pdl-cts-server

A CTS server for the Persian Digital Library (PDL) project

Primary LanguagePythonMIT LicenseMIT

pdl-cts-server

A CTS server for the Persian Digital Library (PDL) project.

This project was inspired by CDLI Text Services for the Cuneiform Digital Library Collective.

Setup

# create virtual environment
python3 -m venv venv
source venv/bin/activate # in fish: source venv/bin/activate.fish

# install `capitains-nautilus` from submodule in `./Nautilus`
python -m pip install -e Nautilus/ # this also installs all needed dependencies from `requirements.txt`

Currently, we are using a submodule in ./Nautilus for a local version of capitains-nautilus, see Capitains/Nautilus#95.

I created the file working_requirements.txt using python -m pip freeze > working_requirements.txt to show which exact version combination is working.

Run server

source venv/bin/activate # in fish: source venv/bin/activate.fish
python app.py

Now we can run queries against the CTS server to explore the corpus.

Examples queries

Query all capabilities: GetCapabilities

curl "http://localhost:8000/cts?request=GetCapabilities"

Query a passage from a certain URN: GetPassage

curl "http://localhost:8000/cts?request=GetPassage&urn=urn:cts:perslit:forooghi.divan"
curl "http://localhost:8000/cts?request=GetPassage&urn=urn:cts:perslit:attar.mokhtarname"

Query Valid Reff

curl "http://localhost:8000/cts?request=GetValidReff&urn=urn:cts:perslit:forooghi.divan"
curl "http://localhost:8000/cts?request=GetValidReff&urn=urn:cts:perslit:attar.mokhtarname"

Other Queries

  • GetFirstUrn: curl "http://localhost:8000/cts?request=GetFirstUrn&urn=urn:cts:perslit:attar.mokhtarname"
  • GetLabel: curl "http://localhost:8000/cts?request=GetLabel&urn=urn:cts:perslit:attar.mokhtarname"
  • GetPrevNextUrn and GetPassagePlus are currently not supported, see #1.

Further Reading

Development / Next steps