> For the complete documentation index, see [llms.txt](https://docs.scicrunch.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.scicrunch.io/terminology-services/interlex/bulk-update.md).

# Bulk Update

## Prerequisite code

Please see [Bulk Add](/terminology-services/interlex/bulk-add.md)for all prequisite code

## Bulk Update

```python
from ontquery.interlex import interlex_client 
from ilxutils.sql import production_sql

# from_backup=True only avaliable if used cmd `backup_ilx` once ilxutils was installed
sql = production_sql(from_backup=True)


terms = sql.get_terms()
syn = sql.get_synonyms()
annotations = sql.get_annotations()
ex = sql.get_existing_ids()
superclass = sql.get_superclasses()
relationship = sql.get_relationships()

# Client
ilx_cli = interlex_client('scicrunch.org').ilx_cli
```

The docstring for the update\_entity!

```python
ilx_cli = interlex_client('scicrunch.org').ilx_cli

[ out ] ilx_cli.update_entity(
    ilx_id: str,
    label: str = None,
    type: str = None,
    definition: str = None,
    comment: str = None,
    superclass: str = None,
    cid: str = None,
    orig_cid: str = None,
    status: str = None,
    add_synonyms: Union[List[dict], List[str]] = None,
    delete_synonyms: Union[List[dict], List[str]] = None,
    add_existing_ids: List[dict] = None,
    delete_existing_ids: List[dict] = None,
) -> dict
Docstring:
Updates pre-existing entity as long as the api_key is from the account that created it.

:param ilx_id: Interlex IRI, curie, or fragment of entity to update.
:param label: Name of entity.
:param type: InterLex entities type: term, cde, fde, pde, annotation, or relationship
:param definition: Entities official definition.
:param comment: A foot note regarding either the interpretation of the data or the data itself
:param superclass: The ilx_id of the parent of this entity. Example: Organ is a superclass to Brain
:param cid: Community ID.
:param status: Entity status.
    -2 : Withdrawn; entity is no longer searchable and is not visible
    -1 : Under review; entity is visible
    0 : No action needed; entity is visible
:param add_synonyms: Synonyms to add if they don't already exist.
:param delete_synonyms: Synonyms to delete.
:param add_existing_ids: Add alternative IRIs if they don't already exist.
:param delete_existing_ids: Delete alternative IRIs.
:return: Server response that is a nested dictionary format
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.scicrunch.io/terminology-services/interlex/bulk-update.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
