An open API service indexing awesome lists of open source software.

https://github.com/umd-lib/solrizer

RDF to Solr document converter microservice
https://github.com/umd-lib/solrizer

Last synced: 3 months ago
JSON representation

RDF to Solr document converter microservice

Awesome Lists containing this project

README

          

# solrizer

RDF to Solr document converter microservice

## Configuration

See `solrizer.web`

## Development Setup

Requires Python 3.12

```zsh
git clone git@github.com:umd-lib/solrizer.git
cd solrizer
python -m venv --prompt "solrizer-py$(cat .python-version)" .venv
source .venv/bin/activate
```

Currently (2025-05-06), Solrizer requires a patched version of the
[python-edtf](https://pypi.org/project/edtf/) module to correctly
handle certain Level 2 [EDTF](https://www.loc.gov/standards/datetime/)
date ranges, and it should be installed before the other dependencies.

```zsh
pip install git+https://github.com/peichman-umd/python-edtf.git@68f0b36deee03a355e6bec9f255d718f0d9f032b
pip install -e '.[dev,test]'
```

The [Dockerfile](Dockerfile) includes this patch as well.

Create a `.env` file with the following contents:

```
FLASK_DEBUG=1
SOLRIZER_FCREPO_ENDPOINT={URL of fcrepo instance}
SOLRIZER_FCREPO_JWT_SECRET={shared secret for generating auth tokens}
SOLRIZER_IIIF_IDENTIFIER_PREFIX=fcrepo:
SOLRIZER_IIIF_MANIFESTS_URL_PATTERN={URI template for IIIF manifests}
SOLRIZER_IIIF_THUMBNAIL_URL_PATTERN={URI template for IIIF thumbnail images}
SOLRIZER_INDEXERS_FILE=indexers.yml
SOLRIZER_INDEXER_SETTINGS_FILE=indexer-settings.yml
SOLRIZER_HANDLE_PROXY_PREFIX={URL of handle proxy server}
SOLRIZER_SOLR_QUERY_ENDPOINT={URL of Solr query service}
```

In the IIIF URI templates, use `{+id}` as the placeholder for the IIIF
identifier.

### Running

```zsh
flask --app solrizer.web run
```

The application will be available at

### Tests

```zsh
pytest
```

With coverage information:

```zsh
pytest --cov src --cov-report term-missing tests
```

### API Documentation

```zsh
pdoc solrizer
```

API documentation generated by [pdoc](https://pdoc.dev/)
will be available at .

To serve the documentation on an alternate port:

```zsh
pdoc -p 8888 solrizer
```

Now the documentation will be at .

### Docker Image

Build the image:

```zsh
docker build -t docker.lib.umd.edu/solrizer .
```

Run, using the `.env` file set up earlier:

```zsh
docker run --rm -it -p 5000:5000 --env-file .env docker.lib.umd.edu/solrizer
```

## License

See the [LICENSE](LICENSE.md) file for license rights and
limitations (Apache 2.0).