-
Notifications
You must be signed in to change notification settings - Fork 29
Lexonomy API
Description of public APIs that can be used by external applications.
For some API calls, API key is needed. You can get your API key in User profile (One-Click Dictionary API key).
For local installations, change server name in URL.
Use this API to create dictionary and import entries. Examples and test at https://www.lexonomy.eu/push.api
- method: POST
- request URI: https://www.lexonomy.eu/push.api
- request data: JSON encoded
{
"email": "your Lexonomy user email",
"apikey": "your Lexonomy API key",
"command": "makeDict",
"dictTitle": "dictionary title",
"dictBlurb": "dictionary information",
"poses": "array of PoS values",
"labels": "array of entry labels"
}
example
{
"email": "user@email.com",
"apikey": "4HNA6VI6C9MROAENNYJQJPLL53HCAJMA",
"command": "makeDict",
"dictTitle": "My New Dictionary",
"dictBlurb": "Yet another dictionary draft.",
"poses": ["n", "v", "adj", "adv"],
"labels": ["colloquial", "formal", "mostly plural", "Irish English", "vulgar"]
}
- response: JSON encoded, in case of failure
{"success": false}
, in case of successful dictionary creation{"success": true, "dictID": "ID of new dictionary"}
. You will need dictID for entry import.
- method: POST
- request URI: https://www.lexonomy.eu/push.api
- request data: JSON encoded
{
"email": "your Lexonomy user email",
"apikey": "your Lexonomy API key",
"command": "makeDict",
"format": "teilex0",
"dictTitle": "dictionary title",
"dictBlurb": "dictionary information",
"poses": "array of PoS values",
"labels": "array of entry labels"
}
- response: JSON encoded, in case of failure
{"success": false}
, in case of successful dictionary creation{"success": true, "dictID": "ID of new dictionary"}
. You will need dictID for entry import.
- method: POST
- request URI: https://www.lexonomy.eu/push.api
- request data: JSON encoded
{
"email": "your Lexonomy user email",
"apikey": "your Lexonomy API key",
"command": "listDicts",
}
- response: JSON encoded, list of dictionaries accessible for given user
{
"success": true,
"entries": [
{"id": "dictionary ID", "title": "dictionary title"}
]
}
- method: POST
- request URI: https://www.lexonomy.eu/push.api
- request data: JSON encoded
{
"email": "your Lexonomy user email",
"apikey": "your Lexonomy API key",
"command": "createEntries",
"dictID": "dictionary ID",
"entryXmls": "array of XML strings"
}
example
{
"email": "user@email.com",
"apikey": "4HNA6VI6C9MROAENNYJQJPLL53HCAJMA",
"command": "createEntries",
"dictID": "4eve25a",
"entryXmls": ["<entry><headword>Brno</headword></entry>", "<entry><headword>Prague</headword></entry>"]
}
- response: JSON encoded, in case of failure
{"success": false}
, in case of successful entry import{"success": true}
.
- method: POST
- request URI: https://www.lexonomy.eu/push.api
- request data: JSON encoded
{
"email": "your Lexonomy user email",
"apikey": "your Lexonomy API key",
"command": "createEntries",
"format": "teilex0",
"dictID": "dictionary ID",
"entryXmls": "array of XML strings"
}
example
{
"email": "user@email.com",
"apikey": "4HNA6VI6C9MROAENNYJQJPLL53HCAJMA",
"command": "createEntries",
"format": "teilex0",
"dictID": "4eve25a",
"entryXmls": ["<entry><form type='lemma'><orth>Earth</orth></form></entry>", "<entry><form type='lemma'><orth>Mars</orth></form></entry>"]
}
- response: JSON encoded, in case of failure
{"success": false}
, in case of successful entry import{"success": true}
.
API used to create links between dictionary elements. In user interface, linkable elements in dictionary have to be configured first. In each dictionary you want to link, go to Configure-Expert settings-Manual linking and set up elements to link and their unique identifiers. After that, you are able to create and view links in entry editor and browser. However, you can use API directly without dictionary config.
- method: GET
- request URI: https://www.lexonomy.eu/dictID/links/add?source_id=source_element_id&target_dict=target_dictionary&target_id=target_element_id
- parameters:
- dictID: source dictionary ID, user needs edit permission on source dictionary
- source_id: unique ID of source element to link
- target_dict: target dictionary ID
- target_id: unique ID of target element to link
- response: in case of error
{"success": false, "error": "error message"}
. For successful link creation{"success": true, "links": {"link_id": "new unique link ID", "source_dict": "source dictionary ID", "source_el": "source element", "source_id": "source element ID", "target_dict": "target dictionary ID", "target_el": "target element", "target_id": "target element ID"}}
- method: GET
- request URI: https://www.lexonomy.eu/dictID/links/delete/linkID
- parameters:
- dictID: source dictionary ID, user needs edit permission on source dictionary
- linkID: unique link ID
-
method: GET
-
request URI: https://www.lexonomy.eu/dictID/links/from
-
parameters:
- dictID: source dictionary ID, user needs any permission on source dictionary
- source_id: (optional) source element ID to filter results
- target_dict: (optional) target dictionary ID to filter results
- target_id: (optional) target element ID to filter results
-
response: JSON encoded array of links with dictID as source dictionary:
{"links": [{"link_id": "new unique link ID", "source_dict": "source dictionary ID", "source_el": "source element", "source_id": "source element ID", "target_dict": "target dictionary ID", "target_el": "target element", "target_id": "target element ID"}]}
- method: GET
- request URI: https://www.lexonomy.eu/dictID/links/from
- parameters:
- dictID: target dictionary ID, user needs any permission on target dictionary
- source_id: (optional) source element ID to filter results
- source_dict: (optional) source dictionary ID to filter results
- target_id: (optional) target element ID to filter results
- response: JSON encoded array of links with dictID as target dictionary
{"links": [{"link_id": "new unique link ID", "source_dict": "source dictionary ID", "source_el": "source element", "source_id": "source element ID", "target_dict": "target dictionary ID", "target_el": "target element", "target_id": "target element ID"}]}
Download dictionary data in OntoLex N-Triple format. For the moment, headword is used as set in the dictionary config, sense definitions are detected using most common entry elements.
- method: POST
- request URI: https://www.lexonomy.eu/dictID/doctype/ontolex.api (for
dictID
specify your dictionary ID, fordoctype
specify entry root element, most usuallyentry
) - request data: JSON encoded
{
"email": "your Lexonomy user email",
"apikey": "your Lexonomy API key"
}
-
response: text/plain, Ontolex N-Triple format
-
example response:
<https://www.lexonomy.eu/elexis-idiotikon#galsterig_26313> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/ns/lemon/ontolex#LexicalEntry> .
<https://www.lexonomy.eu/elexis-idiotikon#galsterig_26313> <http://www.w3.org/2000/01/rdf-schema#label> "galsterig"@de .
<https://www.lexonomy.eu/elexis-idiotikon#galsterig_26313> <http://www.w3.org/ns/lemon/ontolex#sense> <https://www.lexonomy.eu/elexis-idiotikon#26313_1> .
<https://www.lexonomy.eu/elexis-idiotikon#26313_1> <http://www.w3.org/2004/02/skos/core#definition> "'ausser sich gebracht, seiner selbst nicht mehr mächtig'"@de .
<https://www.lexonomy.eu/elexis-idiotikon#galsterig_26313> <http://www.w3.org/ns/lemon/ontolex#sense> <https://www.lexonomy.eu/elexis-idiotikon#26313_2> .
<https://www.lexonomy.eu/elexis-idiotikon#26313_2> <http://www.w3.org/2004/02/skos/core#definition> "ausgelassen, mutwillig, übermütig lustig, von Mädchen"@de .