Skip to content

OBA Output

OBA generates two directories:

  1. servers: Contains the OpenAPI specification and server implementation
  2. queries: Contains all the generated queries.

Servers directory

The servers directory contains:

  • [File] OpenAPI specification openapi.yaml
  • [Directory] Server implementation (default: python)

Queries directory

The queries directory contains the query files that are automatically generated by OBA. There are three types of directories inside the queries directory:

  1. Default queries (default): contains the default queries generated by OBA.
  2. Custom queries (custom): In some cases, users need to implement custom queries that are not the default instances of a class of the ontology (e.g., get all instances of a class that comply with certain conditions). In these cases it is more effective to allow users implementing their own SPARQL queries. The custom directory contains these special queries. See more details in the custom queries documentation.
  3. Classes: OBA creates a query directory per class. It allows users to modify the default queries for each class in case it's necessary.

Info

The server will use the query from the default directory unless the query exists in the class directory.

Default queries

OBA generates the following queries for each class. For example, if we had the class Person:

  • get_all: Get all the resources of a type. GET /persons.
  • get_all_user: Get all the resources of a type. GET /persons?username=USER in the graph USER.
  • get_one: Get the resource of a given type with a given ID GET /persons/ID.
  • get_one_user: Get the resource of a given type with the GET /persons/ID?username=USER in the graph USER.

The queries for POST, PUT and DELETE cannot be modified.