Skip to main content

A query validator for the Common Services of the Once-Only Technical System

Project description

OOTS Common Services Query Validator

release pypi develop master gitlab github

OCQV Logo

Read about the launch of the OCQV in this article, published by the European Commission.

The OCQV is a simple WSGI-based HTTP server that allows queries, meant for the Once-Only Technical System (OOTS) Common Services, to be validated. More specifically, this concerns queries to the Evidence Broker (EB) and the Data Services Directory. In this case, validation means that we check whether the query specifies all necessary parameters with the correct values so that the Common Services are able to provide a valid response.

A detailed description of the development of this tool can be found here.

This software is published under the AGPLv3.0 license.

Features

  • Validates OOTS Common Services queries with XML-based reporting.
  • Ensures all required parameters are present and correctly formatted.
  • Runs as a standalone HTTP server or within a WSGI/Docker environment.
  • Includes a lightweight development server for quick testing.

Installation

Three methods of installation are available:

  1. PyPI
    The validator is published on PyPI and can be installed with:
    pip install OOTS-CS-Query-Validator
    
  2. Docker
    A prebuilt Docker image is available: pcfal/ocqv
    Example run:
    docker run -p 80:80 pcfal/ocqv:latest
    
  3. From source
    You can build the code yourself. Clone this repo, update the submodule, and install with pip:
    git clone git@forgejo.parcifal.dev:parcifal/ocqv.git
    cd ocqv
    git submodule update --init --recursive
    pip install .
    

Debugging

A very basic (and definitely not production-ready) web server is included using werkzeug. This is ideal for development purposes. With OCQV installed from PyPI or directly from source (as described above), the server can be started using the ocqv command. Advanced users can also achieve this by running the ocqv/app.py-script directly. ocqv allows for some configuration through its arguments, all of which are shown with ocqv --help.

Example output:

usage: ocqv [-h] [-H HOST] [-p PORT] [-r] [-d] [-t]

Run the OOTS Common Services Query Validator development server.

optional arguments:
  -h, --help            show this help message and exit
  -H HOST, --host HOST  hostname or IP address to bind to (default: localhost)
  -p PORT, --port PORT  port to listen on (default: 5000)
  -r, --no-reload       disable auto-reloader
  -d, --no-debug        disable interactive debugger
  -t, --threaded        enable multithreading

Usage

For a more permanent setup, Docker is recommended. Internally, the validator exposes:

  • HTTP socket at port 80
  • WSGI socket at port 5000

Example production-like run:

docker run -d --name ocqv -p localhost:80:80 pcfal/ocqv:latest

API

The validator exposes an HTTP endpoint for validating queries. In debug-mode, this defaults to http://localhost:5000/1.2.0/rest/search. Using curl or a web browser, reports can be generated for queries. For example, consider the following (rather lengthy) URL.

http://localhost:5000/1.2.0/rest/search?queryId=urn:fdc:oots:dsd:ebxml-regrep:queries:dataservices-by-evidencetype-and-jurisdiction&evidence-type-classification=http://example.com&jurisdiction-admin-l2=spam&spam=bacon

The resulting report is as follows (notice that all possible variations of verdicts appear in the evaluation of the parameters):

<?xml version="1.0" encoding="UTF-8"?>
<ocqv:QueryReport xmlns:ocqv="https://www.parcifal.dev/ns/oots-cs-query-validator/2025-08"
                  version="0.1.0" 
                  apiVersion="1.2.0" 
                  createdAt="2025-08-12T20:47:00.581476+00:00">
    <ocqv:ParameterEvaluation name="queryId"
                              value="urn:fdc:oots:dsd:ebxml-regrep:queries:dataservices-by-evidencetype-and-jurisdiction"
                              verdict="valid"/>
    <ocqv:ParameterEvaluation name="evidence-type-classification"
                              value="http://example.com"
                              verdict="valid"/>
    <ocqv:ParameterEvaluation name="jurisdiction-admin-l2" 
                              value="spam" 
                              verdict="invalid"/>
    <ocqv:ParameterEvaluation name="spam" 
                              value="bacon" 
                              verdict="unknown"/>
    <ocqv:ParameterEvaluation name="country-code" 
                              verdict="missing"/>
</ocqv:QueryReport>

Queries for both the EB and the DSD are to be submitted to the same endpoint. At this moment, only the 1.2.0-version of the query specification is available. A full overview of the available queries and parameters for both the EB and the DSD are available on the OOTS HUB.

Development

To work on the codebase locally, clone the repository and install the dependencies, including those needed for running the unit tests and the linter.

git clone git@forgejo.parcifal.dev:parcifal/ocqv.git
cd ocqv
git submodule --init --recursive
pip install .[dev]

To run the development server, run python -m ocqv.app.

Use the following command to run the unit tests.

python -m unittest discover -s test

Configuration for pylint is also supported, run it as follows.

pylint ocqv test

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

oots_cs_query_validator-0.2.6.tar.gz (21.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

oots_cs_query_validator-0.2.6-py3-none-any.whl (18.5 kB view details)

Uploaded Python 3

File details

Details for the file oots_cs_query_validator-0.2.6.tar.gz.

File metadata

  • Download URL: oots_cs_query_validator-0.2.6.tar.gz
  • Upload date:
  • Size: 21.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.2

File hashes

Hashes for oots_cs_query_validator-0.2.6.tar.gz
Algorithm Hash digest
SHA256 fcd0ae94dd683d09811a06a62daaddc55fb4191116936e901acf074be0e2bace
MD5 7cdefd4202b8d30861966e2e0dd8d41f
BLAKE2b-256 a72107a5191e637101eed66357ba1680ff9c3774d625f16a410d4a4dff804cdb

See more details on using hashes here.

File details

Details for the file oots_cs_query_validator-0.2.6-py3-none-any.whl.

File metadata

File hashes

Hashes for oots_cs_query_validator-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 f27a59f8ee97d2d19d49e8fd5e2bcbb77e9ae8925f52fa2fdd0694cea6c9d40a
MD5 1f9994869cb5a080e03c6f7f7675c875
BLAKE2b-256 13a2a0359c35795404d7aa248a87f43eaee8eb9f01dd5df732a87bbb542847b5

See more details on using hashes here.

Supported by

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