API endpoint that allows CV Terms to be viewed or edited.

» click to learn about Filtering, Ordering and more...

Accepted filters:

- search: Search in the following fields: ^name, ^description. (^startswith, $regex, =exact)
- id: ID (exact)
- created: Created (exact)
- modified: Modified (exact)
- name: Name starts with (istartswith)
- description: Description contains (icontains)
- autocomplete: Autocomplete filter on the name property (exact)
- owner: Owner Username (exact)
- owned_by: Filter on list of owned by group names [OR] (exact)
- public: Public (exact)
- deleted: Deleted (exact)
- deleted_by: Deleted by (exact)
- deleted_date: Deleted date (exact)
- default: Default (exact)
- category__name: Category Name (exact)
- category__id: Category ID (exact)
- created_by: Created by Username (exact)
- modified_by: Modified by Username (exact)
- dbxref_id: DBXRef ID (exact)
- category_name: Filter on category name (exact)
- category: Filter by category id (exact)
- category_id: Filter by category id (exact)
- category_id_list: Filter on list of category ids [OR] (exact)
- category_name_list: Filter on list of category names [OR] (exact)

» more..
- property: A property for which we need to retrieve the available terms, can be a name or uuid
- dependencies: a json dict that has the values for the properties the given property depends on:
    {"chemical_risk_code": "R1", "<uuid>": "H1"}

- intersect: default False, Intersect on the given filter values instead of doing a "ANY" lookup
- scope(_id): (multiple) name or uuid of one or more Scopes.
- scope_tag(_id): (multiple) name or uuid of one or more Scope Tags.
  Multiple scopes or scope tags are given like so: scope=Scope1&scope=Scope2

Advanced Filtering

You can also filter using a json object to process all search parameters. Currently this filter supports the syntax as produced/used by the http://summitroute.github.io/react-structured-filter/ search UI.

Example

?query={"category":"name","operator":"contains","value":"Y00"},
       {"category":"amount","operator":">","value":"10"},
       {"category":"type__name","operator":"exact","value":"ANTIBODY"}
» more info about the query param..

Preset mappings

- category: category__name
- deleted: <function filter_deleted at 0x7f8cbd712440>
- deleted_by: deleted_by__username
- owner: owner__username
- owned_by: owned_by__name
- created_by: created_by__username
- modified_by: modified_by__username

Operators

- ==
- =
- >=
- >
- <=
- <
- contains
- icontains
- exact
- iexact
- startswith
- istartswith
- endswith
- iendswith

Permission filtering

Based on the current logged in user you can filter for objects that have a particular permission set:

- can_change: True/False, show objects that you can change
- can_delete: True/False, show objects that you can delete

# not applicable - will raise NotAcceptable:
- can_view: as this is always True, you can only view items you are allowed to see

Ordering

You can order on practically any field even spanning relations.

# reverse order on owner username
?ordering=-owner

# order on related field
?ordering=category__version
API endpoint that allows CV Terms to be viewed or edited.

<details>
    <summary>
        <i> &raquo; click to learn about Filtering, Ordering and more...</i>
    </summary>


<details>
    <summary> &raquo; more..</summary>

```
- property: A property for which we need to retrieve the available terms, can be a name or uuid
- dependencies: a json dict that has the values for the properties the given property depends on:
    {"chemical_risk_code": "R1", "<uuid>": "H1"}

- intersect: default False, Intersect on the given filter values instead of doing a "ANY" lookup
- scope(_id): (multiple) name or uuid of one or more Scopes.
- scope_tag(_id): (multiple) name or uuid of one or more Scope Tags.
  Multiple scopes or scope tags are given like so: scope=Scope1&scope=Scope2
```

</details>



</details>

None

The default modelviewset used in this project


Add JSONPatch like functionality to bulk update items.


### Bulk Delete

This view also allows for one to bulk delete items. The url needs to be appended by ``/bulk_delete/`` and the ids
need to be given by multiple query_params:

```
{current_url}/bulk_delete/?id=<id_1>,id=<id_2>
```
GET /api/v2/vocabularies/terms/2392725f-0d90-463e-8940-65238e4bfd39/?format=api&ordering=-default
HTTP 200 OK
Allow: GET, PUT, PATCH, DELETE, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "results": {
        "url": {
            "name": "url",
            "value": "https://labid-demo.embl.de/api/v2/vocabularies/terms/2392725f-0d90-463e-8940-65238e4bfd39/?format=api",
            "category": "property"
        },
        "id": {
            "name": "id",
            "category": "property",
            "value": "2392725f-0d90-463e-8940-65238e4bfd39"
        },
        "created_by": {
            "name": "created_by",
            "value": {
                "id": 2,
                "username": "admin",
                "full_name": "admin"
            },
            "category": "property"
        },
        "modified_by": {
            "name": "modified_by",
            "value": {
                "id": 2,
                "username": "admin",
                "full_name": "admin"
            },
            "category": "property"
        },
        "created": {
            "name": "created",
            "value": "2025-02-18T21:41:48.238718+01:00",
            "category": "property"
        },
        "modified": {
            "name": "modified",
            "value": "2025-02-18T21:41:48.238720+01:00",
            "category": "property"
        },
        "model_name": {
            "name": "model_name",
            "category": "property",
            "value": "term"
        },
        "app_name": {
            "name": "app_name",
            "category": "property",
            "value": "vocabularies"
        },
        "model_type": {
            "name": "model_type",
            "category": "property",
            "value": "DEFAULT"
        },
        "name": {
            "name": "name",
            "value": {
                "id": "2392725f-0d90-463e-8940-65238e4bfd39",
                "name": "binding site identification design",
                "model_name": "term",
                "app_name": "vocabularies",
                "model_type": null
            },
            "category": "property"
        },
        "choice_label": {
            "name": "choice_label",
            "category": "property",
            "value": "binding site identification design"
        },
        "description": {
            "name": "description",
            "category": "property",
            "value": ""
        },
        "label": {
            "name": "label",
            "category": "property",
            "value": "binding site identification design"
        },
        "short_name": {
            "name": "short_name",
            "category": "property",
            "value": "binding site identification design"
        },
        "image_url": {
            "name": "image_url",
            "category": "property",
            "value": ""
        },
        "category": {
            "name": "category",
            "value": {
                "id": "0cb3ebfc-0423-4188-b0a7-f3611ab39498",
                "name": "efo_study_design",
                "label": "Study Design",
                "deleted": false,
                "model_name": "category",
                "app_name": "vocabularies",
                "model_type": "DEFAULT"
            },
            "category": "property"
        },
        "dbxref_id": {
            "name": "dbxref_id",
            "category": "property",
            "value": "http://www.ebi.ac.uk/efo/EFO_0004664"
        },
        "default": {
            "name": "default",
            "category": "property",
            "value": false
        },
        "permissions": {
            "name": "permissions",
            "value": {
                "public": true,
                "actions": {
                    "view": {
                        "users": [
                            {
                                "id": 2,
                                "username": "admin",
                                "email": "example-admin@embl.de",
                                "is_active": true,
                                "full_name": "admin"
                            }
                        ],
                        "groups": []
                    },
                    "change": {
                        "users": [
                            {
                                "id": 2,
                                "username": "admin",
                                "email": "example-admin@embl.de",
                                "is_active": true,
                                "full_name": "admin"
                            }
                        ],
                        "groups": []
                    },
                    "delete": {
                        "users": [
                            {
                                "id": 2,
                                "username": "admin",
                                "email": "example-admin@embl.de",
                                "is_active": true,
                                "full_name": "admin"
                            }
                        ],
                        "groups": []
                    }
                },
                "allowed": [
                    "view"
                ]
            },
            "category": "property"
        },
        "public": {
            "name": "public",
            "value": true,
            "category": "property"
        },
        "owner": {
            "name": "owner",
            "value": {
                "id": 2,
                "username": "admin",
                "full_name": "admin"
            },
            "category": "property"
        },
        "owned_by": {
            "name": "owned_by",
            "value": {
                "id": 1,
                "name": "SYSTEM_GROUP"
            },
            "category": "property"
        }
    }
}