SPARQL endpoint for the DTDesign project.

Arkadiusz Ryś 4c7a6c4f62 Fix typo 4 місяців тому
data 4913a3889c Add cell example 1 рік тому
docs 3c3d741781 Create releng boilerplate 2 роки тому
spendpoint b0b87b2940 Update changelog version 0.5.1 1 рік тому
tests 2383075958 Create conversion service 2 роки тому
.dockerignore 3c3d741781 Create releng boilerplate 2 роки тому
.editorconfig 3c5a8f43bf Update requirements 2 роки тому
.gitignore 4ba50a3a8d Add example to get all cells 1 рік тому
.gitlab-ci.yml c22b8473e4 Make CI more flexible 2 роки тому
AUTHORS.rst 3c3d741781 Create releng boilerplate 2 роки тому
Dockerfile 07246dc30c Call module instead of uvicorn in docker container 2 роки тому
HISTORY.rst b0b87b2940 Update changelog version 0.5.1 1 рік тому
LICENSE 3c3d741781 Create releng boilerplate 2 роки тому
README.rst 4c7a6c4f62 Fix typo 4 місяців тому
pyproject.toml 03c7f0ab8d Propagate fix to pyproject 1 рік тому
requirements.txt 02145b56ce Fix requirement conflict 1 рік тому
tasks.py 4ba50a3a8d Add example to get all cells 1 рік тому

README.rst

##########
SpEndPoint
##########

Creates a SPARQL endpoint supporting custom services.
The default access point is at `http://127.0.0.1:8000`.
This endpoint can be configured in the `configuration.toml `_ file.
The docker image created uses uvicorn to host the application at `0.0.0.0:80`. Feel free to map this to any port of your liking.

Bound services
--------------

We currently support 4 bind services out of the box:

.. code-block::

dtf:outlier
dtf:example
dtf:conversion
dtf:cell

The outlier service relies on `another endpoint `_ which needs to be set up and accessible.

.. code-block:: sparql

PREFIX dtf:
SELECT ?cell ?cell_value WHERE {
SERVICE {BIND(dtf:cell("data/example.csv", 0, 0) AS ?cell)}
}

SPARQL query showing bind based cell service call.

URI based services
------------------

A second, more versatile, way to access a service is provided in the form of an URI.
It is possible to query cells by specifying an individual cell in the URI of the service call.

.. code-block:: sparql

SELECT ?s ?p ?o WHERE {
BIND(ENCODE_FOR_URI("http://ua.be/sdo2l/description/artifacts/artifacts#random-artefact") as ?e)
BIND(uri(concat("http://localhost:8000/cell/?iri=", ?e ,"&row=2&column=2&file_name=example.csv")) as ?c)
SERVICE ?c {?s ?p ?o}
}

SPARQL query showing URI based cell service call.

Installation
------------

..
.. code-block:: shell

pip install spendpoint

or

.. code-block:: shell

pip install --index-url https://pip:glpat-m8mNfhxZAUnWvy7rLS1x@git.rys.one/api/v4/projects/262/packages/pypi/simple --no-deps spendpoint

Configuration
-------------

A configuration file at `configuration.toml `_ holds all user configurable data.
You can set the `host` and `port` the server will listen on.
A more advanced use is to import extra services.
These services need to be defined in the `service.py` file as well.