codex
This Web API allows for a number of searches in the DEXonline database, using the graph database ArangoDB.
As of now, the repo contains a Java Spring Boot Maven app for the API, and a dump of the DEXonline database, migrated from SQL to ArangoDB. The filedump will be loaded through the project's Docker Compose service, and is only meant as a temporary method until import through SQL parsing of database initialization script is implemented.
To start up, you can use the corresponding Docker Compose service, which will also start an import through the filedump. For example: sudo docker compose build
, then sudo docker compose up
Connection details can be configured in codex/src/main/java/org/example/codex/CodexConfiguration.java
, and schema for partial and final imports can be modified in codex/src/main/resources/import-schema
and codex/src/main/resources/final-schema
respectively.
Current API endpoints:
codex/lexeme/levenshtein
: POST - parametersString word
,Integer dist
,Integer collation
- returns array of words with a Levenshtein distance of maximumdist
fromword
using specifiedcollation
(1 - UTF-8, 2 - with accent)codex/lexeme/regex
: POST - parameterString regex
,Integer collation
- returns array of words matching the Regex expressionregex
using specifiedcollation
(1 - UTF-8, 2 - with accent)codex/lexeme/meanings
: POST - parameterString word
,Integer type
,Integer collation
- returns array of meanings ofword
with giventype
(0 - proper meaning, 1 - etymology, 2 - usage example from literature, 3 - comment, 4 - comment or diff from parent meaning, 5 - meaning of compound expression containing wordcodex/lexeme/relation
: POST - parameterString word
,Integer relationType
,Integer collation
- returns array of words with givenrelationType
toword
(1 - synonyms, 2 - antonyms, 3 - diminutives, 4 - augmentatives)codex/system/schema/collection
: GET - returns array of collections in databasecodex/system/schema/key_types
: POST - parameterString collection
- for each key in collection, returns types of values: response represented as array of key-type pairscodex/system/collection/is_edge_collection
: POST - parameterString collection
- returns a boolean value representing whether collection is edge collectioncodex/system/collection/edge_relations
: POST - parameterString collection
- return an array of string pairs, representing each pair of collections connected in specified edge collectioncodex/system/schema/key_types_all
: GET - returns key types of all collections, as a JSON object in a format ofcollection: key_types
, for each collection, as inkey_types
endpointcodex/system/schema/edge_relations_all
: GET - returns edge relations of all collections, as a JSON object in format ofcollection: edge_relations
for each collection, as inedge_relations
endpointcodex/system/schema/schema
: GET - documents and returns schema of database, in format{keyTypeMap: key_types_all, edgeRelationsMap: edge_relations_all}
, as in previous two requestscodex/import/import
: import database through SQL parsing of remote SQL script (WIP)
For all endpoints using the parameter collation
: 1 represents UTF-8, 2 represents accented forms
TODO:
- finalize import through SQL parsing
- performance tests