README.rst 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. ##########
  2. SpEndPoint
  3. ##########
  4. Creates a SPARQL endpoint supporting custom services.
  5. The default access point is at `http://127.0.0.1:8000`.
  6. This endpoint can be configured in the `configuration.toml <data/configuration.toml>`_ file.
  7. 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.
  8. Bound services
  9. --------------
  10. We currently support 4 bind services out of the box:
  11. .. code-block::
  12. dtf:outlier
  13. dtf:example
  14. dtf:conversion
  15. dtf:cell
  16. The outlier service relies on `another endpoint <https://msdl.uantwerpen.be/git/lucasalbertins/DTDesign/src/main/tools/typeOperations>`_ which needs to be set up and accessible.
  17. .. code-block:: sparql
  18. PREFIX dtf: <https://ontology.rys.app/dt/function/>
  19. SELECT ?cell ?cell_value WHERE {
  20. SERVICE <http://localhost:8000/> {BIND(dtf:cell("data/example.csv", 0, 0) AS ?cell)}
  21. }
  22. SPARQL query showing bind based cell service call.
  23. URI based services
  24. ------------------
  25. A second, more versatile, way to access a service is provided in the form of an URI.
  26. It is possible to query cells by specifying an individual cell in the URI of the service call.
  27. .. code-block:: sparql
  28. SELECT ?s ?p ?o WHERE {
  29. BIND(ENCODE_FOR_URI("http://ua.be/sdo2l/description/artifacts/artifacts#random-artefact") as ?e)
  30. BIND(uri(concat("http://localhost:8000/cell/?iri=", ?e ,"&row=2&column=2&file_name=example.csv")) as ?c)
  31. SERVICE ?c {?s ?p ?o}
  32. }
  33. SPARQL query showing URI based cell service call.
  34. Installation
  35. ------------
  36. ..
  37. .. code-block:: shell
  38. pip install spendpoint
  39. or
  40. .. code-block:: shell
  41. pip install --index-url https://pip:glpat-m8mNfhxZAUnWvy7rLS1x@git.rys.one/api/v4/projects/262/packages/pypi/simple --no-deps spendpoint
  42. Configuration
  43. -------------
  44. A configuration file at `configuration.toml <data/configuration.toml>`_ holds all user configurable data.
  45. You can set the `host` and `port` the server will listen on.
  46. A more advanced use is to import extra services.
  47. These services need to be defined in the `service.py` file as well.