Query & search registries
¶
This guide walks through different ways of querying & searching LaminDB registries.
# pip install lamindb
!lamin init --storage ./test-registries --modules bionty
Show code cell output
→ initialized lamindb: testuser1/test-registries
Let’s start by creating a few exemplary datasets and saving them into a LaminDB instance.
import lamindb as ln
ln.track()
ln.Artifact(ln.examples.datasets.file_fastq(), key="raw/my_fastq.fastq.gz").save()
ln.Artifact(ln.examples.datasets.file_jpg_paradisi05(), key="my_image.jpg").save()
ln.Artifact.from_dataframe(ln.examples.datasets.df_iris(), key="iris.parquet").save()
ln.examples.datasets.mini_immuno.save_mini_immuno_datasets()
Show code cell output
→ connected lamindb: testuser1/test-registries
→ created Transform('yEfnBDXNI2FF0000', key='registries.ipynb'), started new Run('iOUu6qx1S6XupjKE') at 2026-02-16 07:30:03 UTC
→ notebook imports: bionty==2.2.0 lamindb==2.2a1
• recommendation: to identify the notebook across renames, pass the uid: ln.track("yEfnBDXNI2FF")
→ writing the in-memory object into cache
→ writing the in-memory object into cache
→ loading artifact into memory for validation
! 4 terms not validated in feature 'columns' in slot 'obs': 'assay_oid', 'concentration', 'treatment_time_h', 'donor'
→ fix typos, remove non-existent values, or save terms via: curator.slots['obs'].cat.add_new_from('columns')
→ writing the in-memory object into cache
→ loading artifact into memory for validation
! 3 terms not validated in feature 'columns' in slot 'obs': 'concentration', 'treatment_time_h', 'donor'
→ fix typos, remove non-existent values, or save terms via: curator.slots['obs'].cat.add_new_from('columns')
Get an overview¶
The easiest way to get an overview over all artifacts is by typing to_dataframe(), which returns the 100 latest artifacts in the Artifact registry.
ln.Artifact.to_dataframe()
Show code cell output
| uid | key | description | suffix | kind | otype | size | hash | n_files | n_observations | ... | is_latest | is_locked | created_at | branch_id | created_on_id | space_id | storage_id | run_id | schema_id | created_by_id | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | |||||||||||||||||||||
| 5 | 3taqR7IFSpWlfFMi0000 | examples/dataset2.h5ad | None | .h5ad | dataset | AnnData | 26896 | RKJjWbINYNIwYU8BxCejMw | None | 3.0 | ... | True | False | 2026-02-16 07:30:14.290000+00:00 | 1 | 1 | 1 | 1 | 1 | 3.0 | 1 |
| 4 | NctrRDzpuRv8Rj0y0000 | examples/dataset1.h5ad | None | .h5ad | dataset | AnnData | 31672 | FB3CeMjmg1ivN6HDy6wsSg | None | 3.0 | ... | True | False | 2026-02-16 07:30:11.368000+00:00 | 1 | 1 | 1 | 1 | 1 | 3.0 | 1 |
| 3 | GqRjzz4l253RsnqK0000 | iris.parquet | None | .parquet | dataset | DataFrame | 5202 | uoZObYqD8ln4P7nQ9de1YA | None | 150.0 | ... | True | False | 2026-02-16 07:30:05.852000+00:00 | 1 | 1 | 1 | 1 | 1 | NaN | 1 |
| 2 | iKtT51jvCMWr6qQW0000 | my_image.jpg | None | .jpg | None | None | 29358 | r4tnqmKI_SjrkdLzpuWp4g | None | NaN | ... | True | False | 2026-02-16 07:30:05.669000+00:00 | 1 | 1 | 1 | 1 | 1 | NaN | 1 |
| 1 | UIGXR76DtRd0svdx0000 | raw/my_fastq.fastq.gz | None | .fastq.gz | None | None | 20 | hi7ZmAzz8sfMd3vIQr-57Q | None | NaN | ... | True | False | 2026-02-16 07:30:05.476000+00:00 | 1 | 1 | 1 | 1 | 1 | NaN | 1 |
5 rows × 21 columns
You can include features.
ln.Artifact.to_dataframe(include="features")
Show code cell output
→ queried for all categorical features of dtypes Record or ULabel and non-categorical features: (7) ['perturbation', 'sample_note', 'temperature', 'experiment', 'date_of_study', 'study_note', 'study_metadata']
| uid | key | perturbation | temperature | experiment | date_of_study | study_note | study_metadata | |
|---|---|---|---|---|---|---|---|---|
| id | ||||||||
| 5 | 3taqR7IFSpWlfFMi0000 | examples/dataset2.h5ad | {DMSO, IFNG} | 22.6 | Experiment 2 | 2025-02-13 | NaN | {'detail1': '456', 'detail2': 2} |
| 4 | NctrRDzpuRv8Rj0y0000 | examples/dataset1.h5ad | {DMSO, IFNG} | 21.6 | Experiment 1 | 2024-12-01 | We had a great time performing this study and ... | {'detail1': '123', 'detail2': 1} |
| 3 | GqRjzz4l253RsnqK0000 | iris.parquet | NaN | NaN | NaN | NaT | NaN | NaN |
| 2 | iKtT51jvCMWr6qQW0000 | my_image.jpg | NaN | NaN | NaN | NaT | NaN | NaN |
| 1 | UIGXR76DtRd0svdx0000 | raw/my_fastq.fastq.gz | NaN | NaN | NaN | NaT | NaN | NaN |
You can include fields from other registries.
ln.Artifact.to_dataframe(
include=[
"created_by__name",
"records__name",
"cell_types__name",
"schemas__itype",
]
)
Show code cell output
| uid | key | created_by__name | records__name | cell_types__name | schemas__itype | |
|---|---|---|---|---|---|---|
| id | ||||||
| 5 | 3taqR7IFSpWlfFMi0000 | examples/dataset2.h5ad | Test User1 | {DMSO, Experiment 2, IFNG} | {T cell, B cell} | {Feature, bionty.Gene.ensembl_gene_id} |
| 4 | NctrRDzpuRv8Rj0y0000 | examples/dataset1.h5ad | Test User1 | {DMSO, IFNG, Experiment 1} | {T cell, CD8-positive, alpha-beta T cell, B cell} | {Feature, bionty.Gene.ensembl_gene_id} |
| 3 | GqRjzz4l253RsnqK0000 | iris.parquet | Test User1 | {None} | {None} | {None} |
| 2 | iKtT51jvCMWr6qQW0000 | my_image.jpg | Test User1 | {None} | {None} | {None} |
| 1 | UIGXR76DtRd0svdx0000 | raw/my_fastq.fastq.gz | Test User1 | {None} | {None} | {None} |
You can also get an overview of the entire database.
ln.view()
Show code cell output
****************
* module: core *
****************
Artifact
| uid | key | description | suffix | kind | otype | size | hash | n_files | n_observations | ... | is_latest | is_locked | created_at | branch_id | created_on_id | space_id | storage_id | run_id | schema_id | created_by_id | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | |||||||||||||||||||||
| 5 | 3taqR7IFSpWlfFMi0000 | examples/dataset2.h5ad | None | .h5ad | dataset | AnnData | 26896 | RKJjWbINYNIwYU8BxCejMw | None | 3.0 | ... | True | False | 2026-02-16 07:30:14.290000+00:00 | 1 | 1 | 1 | 1 | 1 | 3.0 | 1 |
| 4 | NctrRDzpuRv8Rj0y0000 | examples/dataset1.h5ad | None | .h5ad | dataset | AnnData | 31672 | FB3CeMjmg1ivN6HDy6wsSg | None | 3.0 | ... | True | False | 2026-02-16 07:30:11.368000+00:00 | 1 | 1 | 1 | 1 | 1 | 3.0 | 1 |
| 3 | GqRjzz4l253RsnqK0000 | iris.parquet | None | .parquet | dataset | DataFrame | 5202 | uoZObYqD8ln4P7nQ9de1YA | None | 150.0 | ... | True | False | 2026-02-16 07:30:05.852000+00:00 | 1 | 1 | 1 | 1 | 1 | NaN | 1 |
| 2 | iKtT51jvCMWr6qQW0000 | my_image.jpg | None | .jpg | None | None | 29358 | r4tnqmKI_SjrkdLzpuWp4g | None | NaN | ... | True | False | 2026-02-16 07:30:05.669000+00:00 | 1 | 1 | 1 | 1 | 1 | NaN | 1 |
| 1 | UIGXR76DtRd0svdx0000 | raw/my_fastq.fastq.gz | None | .fastq.gz | None | None | 20 | hi7ZmAzz8sfMd3vIQr-57Q | None | NaN | ... | True | False | 2026-02-16 07:30:05.476000+00:00 | 1 | 1 | 1 | 1 | 1 | NaN | 1 |
5 rows × 21 columns
Feature
| uid | name | _dtype_str | unit | description | array_rank | array_size | array_shape | synonyms | default_value | ... | coerce | is_locked | is_type | created_at | branch_id | created_on_id | space_id | created_by_id | run_id | type_id | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | |||||||||||||||||||||
| 9 | QMOQhPOFg9Hq | study_metadata | dict | None | None | 0 | 0 | None | None | None | ... | None | False | False | 2026-02-16 07:30:07.112000+00:00 | 1 | 1 | 1 | 1 | 1 | None |
| 8 | 6hdMbO4CLRLb | study_note | str | None | None | 0 | 0 | None | None | None | ... | None | False | False | 2026-02-16 07:30:07.104000+00:00 | 1 | 1 | 1 | 1 | 1 | None |
| 7 | PPPOLlv3MoOs | date_of_study | date | None | None | 0 | 0 | None | None | None | ... | True | False | False | 2026-02-16 07:30:07.098000+00:00 | 1 | 1 | 1 | 1 | 1 | None |
| 6 | gsuSVE1bOlQg | experiment | cat[Record] | None | None | 0 | 0 | None | None | None | ... | None | False | False | 2026-02-16 07:30:07.092000+00:00 | 1 | 1 | 1 | 1 | 1 | None |
| 5 | ROdebmMx49Aq | temperature | float | None | None | 0 | 0 | None | None | None | ... | None | False | False | 2026-02-16 07:30:07.086000+00:00 | 1 | 1 | 1 | 1 | 1 | None |
| 4 | 8GP7lFXRfhBN | cell_type_by_model | cat[bionty.CellType] | None | None | 0 | 0 | None | None | None | ... | None | False | False | 2026-02-16 07:30:07.079000+00:00 | 1 | 1 | 1 | 1 | 1 | None |
| 3 | Nnas7ZcVxkpd | cell_type_by_expert | cat[bionty.CellType] | None | None | 0 | 0 | None | None | None | ... | None | False | False | 2026-02-16 07:30:07.073000+00:00 | 1 | 1 | 1 | 1 | 1 | None |
7 rows × 21 columns
JsonValue
| value | hash | is_locked | created_at | branch_id | created_on_id | space_id | created_by_id | run_id | feature_id | |
|---|---|---|---|---|---|---|---|---|---|---|
| id | ||||||||||
| 7 | {'detail1': '456', 'detail2': 2} | QAU2Is6uXBBgz8zC_p-rAQ | False | 2026-02-16 07:30:14.360000+00:00 | 1 | 1 | 1 | 1 | 1 | 9 |
| 6 | 2025-02-13 | SGTsR3XvXFi5jZ8UjC6YaQ | False | 2026-02-16 07:30:14.358000+00:00 | 1 | 1 | 1 | 1 | 1 | 7 |
| 5 | 22.6 | 54rmFUZH0WdllA5alp-64g | False | 2026-02-16 07:30:14.350000+00:00 | 1 | 1 | 1 | 1 | 1 | 5 |
| 4 | {'detail1': '123', 'detail2': 1} | nJ33A6k51yp-1ZlqFabWdw | False | 2026-02-16 07:30:11.449000+00:00 | 1 | 1 | 1 | 1 | 1 | 9 |
| 3 | We had a great time performing this study and ... | ixx1CqAyBO8WO7lLdLpqTg | False | 2026-02-16 07:30:11.447000+00:00 | 1 | 1 | 1 | 1 | 1 | 8 |
| 2 | 2024-12-01 | gNXeOkGaab5bqWC7D--aHQ | False | 2026-02-16 07:30:11.445000+00:00 | 1 | 1 | 1 | 1 | 1 | 7 |
| 1 | 21.6 | XftFE5byhwPHY-11WjfNAw | False | 2026-02-16 07:30:11.438000+00:00 | 1 | 1 | 1 | 1 | 1 | 5 |
Record
| uid | name | description | reference | reference_type | extra_data | is_locked | is_type | created_at | branch_id | created_on_id | space_id | created_by_id | type_id | schema_id | run_id | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | ||||||||||||||||
| 4 | 9YS83JC3Trh6qmvg | Experiment 2 | None | None | None | None | False | False | 2026-02-16 07:30:06.204000+00:00 | 1 | 1 | 1 | 1 | None | None | 1 |
| 3 | XPMiJdlsmGX7YpJm | Experiment 1 | None | None | None | None | False | False | 2026-02-16 07:30:06.204000+00:00 | 1 | 1 | 1 | 1 | None | None | 1 |
| 2 | gIpYVjKsNqfmTUhs | IFNG | None | None | None | None | False | False | 2026-02-16 07:30:06.192000+00:00 | 1 | 1 | 1 | 1 | None | None | 1 |
| 1 | ZDZa5xJvfRWIykLW | DMSO | None | None | None | None | False | False | 2026-02-16 07:30:06.192000+00:00 | 1 | 1 | 1 | 1 | None | None | 1 |
Run
| uid | name | description | entrypoint | started_at | finished_at | params | reference | reference_type | cli_args | ... | created_at | branch_id | created_on_id | space_id | transform_id | report_id | environment_id | plan_id | created_by_id | initiated_by_run_id | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | |||||||||||||||||||||
| 1 | iOUu6qx1S6XupjKE | None | None | None | 2026-02-16 07:30:03.658580+00:00 | None | None | None | None | None | ... | 2026-02-16 07:30:03.659000+00:00 | 1 | 1 | 1 | 1 | None | None | None | 1 | None |
1 rows × 21 columns
Schema
| uid | name | description | n_members | coerce | flexible | itype | otype | hash | minimal_set | ... | maximal_set | is_locked | is_type | created_at | branch_id | created_on_id | space_id | created_by_id | run_id | type_id | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | |||||||||||||||||||||
| 7 | YCyS3Za86gCF14fa | None | None | 3.0 | None | False | bionty.Gene.ensembl_gene_id | None | fSbuKqXueizoVnttx06vsw | True | ... | False | False | False | 2026-02-16 07:30:14.318000+00:00 | 1 | 1 | 1 | 1 | 1 | None |
| 6 | 51wI38Fazwkrg0jN | None | None | 2.0 | None | False | Feature | None | XVMeB96SkS43Cj2jwr9ZrA | True | ... | False | False | False | 2026-02-16 07:30:14.309000+00:00 | 1 | 1 | 1 | 1 | 1 | None |
| 5 | nwTM0HMIhHMSowxG | None | None | 3.0 | None | False | bionty.Gene.ensembl_gene_id | None | P5KzXILi0TzYDHB82Pvt-w | True | ... | False | False | False | 2026-02-16 07:30:11.397000+00:00 | 1 | 1 | 1 | 1 | 1 | None |
| 4 | qFZgDTHsMn9PFO7h | None | None | 4.0 | None | False | Feature | None | ZCCNziUkCNwqWLiBwpIESw | True | ... | False | False | False | 2026-02-16 07:30:11.388000+00:00 | 1 | 1 | 1 | 1 | 1 | None |
| 3 | 0000000000000002 | anndata_ensembl_gene_ids_and_valid_features_in... | None | NaN | None | True | None | AnnData | aqGWHvyY49W_PHELUMiBMw | True | ... | False | False | False | 2026-02-16 07:30:07.138000+00:00 | 1 | 1 | 1 | 1 | 1 | None |
| 2 | 0000000000000001 | valid_ensembl_gene_ids | None | NaN | None | True | bionty.Gene.ensembl_gene_id | None | 1gocc_TJ1RU2bMwDRK-WUA | True | ... | False | False | False | 2026-02-16 07:30:07.131000+00:00 | 1 | 1 | 1 | 1 | 1 | None |
| 1 | 0000000000000000 | valid_features | None | NaN | None | True | Feature | None | kMi7B_N88uu-YnbTLDU-DA | True | ... | False | False | False | 2026-02-16 07:30:07.123000+00:00 | 1 | 1 | 1 | 1 | 1 | None |
7 rows × 21 columns
Storage
| uid | root | description | type | region | instance_uid | is_locked | created_at | branch_id | created_on_id | space_id | created_by_id | run_id | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | |||||||||||||
| 1 | HhhxTqzQqeet | /home/runner/work/lamindb/lamindb/docs/test-re... | None | local | None | hlGq1WkbeSSf | False | 2026-02-16 07:30:00.566000+00:00 | 1 | 1 | 1 | 1 | None |
Transform
| uid | key | description | kind | source_code | hash | reference | reference_type | version_tag | is_latest | is_locked | created_at | branch_id | created_on_id | space_id | environment_id | plan_id | created_by_id | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | ||||||||||||||||||
| 1 | yEfnBDXNI2FF0000 | registries.ipynb | Query & search registries [
With auto-complete, we find a record:
experiment_1 = records.experiment_1
experiment_1
Show code cell output
Record(uid='XPMiJdlsmGX7YpJm', is_type=False, name='Experiment 1', description=None, reference=None, reference_type=None, extra_data=None, branch_id=1, created_on_id=1, space_id=1, created_by_id=1, type_id=None, schema_id=None, run_id=1, created_at=2026-02-16 07:30:06 UTC, is_locked=False)
This works for any SQLRecord registry, e.g., also for plugin bionty.
import bionty as bt
cell_types = bt.CellType.lookup()
Show me a screenshot
Get one record¶
get() errors if none or more than one matching records are found.
ln.Record.get(experiment_1.uid) # by uid
ln.Record.get(name="Experiment 1") # by field
Show code cell output
Record(uid='XPMiJdlsmGX7YpJm', is_type=False, name='Experiment 1', description=None, reference=None, reference_type=None, extra_data=None, branch_id=1, created_on_id=1, space_id=1, created_by_id=1, type_id=None, schema_id=None, run_id=1, created_at=2026-02-16 07:30:06 UTC, is_locked=False)
Query records by fields¶
Filter for all artifacts annotated by a record and get the result as a dataframe:
qs = ln.Artifact.filter(suffix=".fastq.qz")
filter() returns a QuerySet.
To access the results encoded in a filter statement, execute its return value with one of:
to_dataframe(): A pandasDataFramewith each record in a row.one(): Exactly one record. Will raise an error if there is none. Is equivalent to the.get()method shown above.one_or_none(): Either one record orNoneif there is no query result.
Alternatively,
use the
QuerySetas an iteratorget individual records via
qs[0],qs[1]
For example:
qs.to_dataframe()
Show code cell output
| uid | id | key | description | suffix | kind | otype | size | hash | n_files | ... | is_latest | is_locked | created_at | branch_id | created_on_id | space_id | storage_id | run_id | schema_id | created_by_id |
|---|
0 rows × 22 columns
Note that the SQLRecord registries in LaminDB are Django Models and any Django query works.
Query records by features¶
The Artifact, Record, and Run registries can be queried by features.
ln.Artifact.filter(perturbation="DMSO").to_dataframe(include="features")
Show code cell output
→ queried for all categorical features of dtypes Record or ULabel and non-categorical features: (7) ['perturbation', 'sample_note', 'temperature', 'experiment', 'date_of_study', 'study_note', 'study_metadata']
| uid | key | perturbation | temperature | experiment | date_of_study | study_note | study_metadata | |
|---|---|---|---|---|---|---|---|---|
| id | ||||||||
| 5 | 3taqR7IFSpWlfFMi0000 | examples/dataset2.h5ad | {DMSO, IFNG} | 22.6 | Experiment 2 | 2025-02-13 | NaN | {'detail1': '456', 'detail2': 2} |
| 4 | NctrRDzpuRv8Rj0y0000 | examples/dataset1.h5ad | {DMSO, IFNG} | 21.6 | Experiment 1 | 2024-12-01 | We had a great time performing this study and ... | {'detail1': '123', 'detail2': 1} |
You can also query for nested dictionary-like features.
ln.Artifact.filter(study_metadata__detail1="123").to_dataframe(include="features")
Show code cell output
→ queried for all categorical features of dtypes Record or ULabel and non-categorical features: (7) ['perturbation', 'sample_note', 'temperature', 'experiment', 'date_of_study', 'study_note', 'study_metadata']
| uid | key | perturbation | temperature | experiment | date_of_study | study_note | study_metadata | |
|---|---|---|---|---|---|---|---|---|
| id | ||||||||
| 4 | NctrRDzpuRv8Rj0y0000 | examples/dataset1.h5ad | {DMSO, IFNG} | 21.6 | Experiment 1 | 2024-12-01 | We had a great time performing this study and ... | {'detail1': '123', 'detail2': 1} |
ln.Artifact.filter(study_metadata__detail2=2).to_dataframe(include="features")
Show code cell output
→ queried for all categorical features of dtypes Record or ULabel and non-categorical features: (7) ['perturbation', 'sample_note', 'temperature', 'experiment', 'date_of_study', 'study_note', 'study_metadata']
| uid | key | perturbation | temperature | experiment | date_of_study | study_metadata | |
|---|---|---|---|---|---|---|---|
| id | |||||||
| 5 | 3taqR7IFSpWlfFMi0000 | examples/dataset2.h5ad | {DMSO, IFNG} | 22.6 | Experiment 2 | 2025-02-13 | {'detail1': '456', 'detail2': 2} |
You can query for whether a dataset is annotated or not annotated by a feature.
ln.Artifact.filter(perturbation__isnull=True).to_dataframe(include="features")
Show code cell output
→ queried for all categorical features of dtypes Record or ULabel and non-categorical features: (7) ['perturbation', 'sample_note', 'temperature', 'experiment', 'date_of_study', 'study_note', 'study_metadata']
| uid | key | |
|---|---|---|
| id | ||
| 3 | GqRjzz4l253RsnqK0000 | iris.parquet |
| 2 | iKtT51jvCMWr6qQW0000 | my_image.jpg |
| 1 | UIGXR76DtRd0svdx0000 | raw/my_fastq.fastq.gz |
ln.Artifact.filter(perturbation__isnull=False).to_dataframe(include="features")
Show code cell output
→ queried for all categorical features of dtypes Record or ULabel and non-categorical features: (7) ['perturbation', 'sample_note', 'temperature', 'experiment', 'date_of_study', 'study_note', 'study_metadata']
| uid | key | perturbation | temperature | experiment | date_of_study | study_note | study_metadata | |
|---|---|---|---|---|---|---|---|---|
| id | ||||||||
| 5 | 3taqR7IFSpWlfFMi0000 | examples/dataset2.h5ad | {DMSO, IFNG} | 22.6 | Experiment 2 | 2025-02-13 | NaN | {'detail1': '456', 'detail2': 2} |
| 4 | NctrRDzpuRv8Rj0y0000 | examples/dataset1.h5ad | {DMSO, IFNG} | 21.6 | Experiment 1 | 2024-12-01 | We had a great time performing this study and ... | {'detail1': '123', 'detail2': 1} |
Query runs by parameters¶
Here is an example for querying by parameters: Track parameters & features.
Search for records¶
You can search every registry via search(). For example, the Artifact registry.
ln.Artifact.search("iris").to_dataframe()
Show code cell output
| uid | key | description | suffix | kind | otype | size | hash | n_files | n_observations | ... | is_latest | is_locked | created_at | branch_id | created_on_id | space_id | storage_id | run_id | schema_id | created_by_id | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | |||||||||||||||||||||
| 3 | GqRjzz4l253RsnqK0000 | iris.parquet | None | .parquet | dataset | DataFrame | 5202 | uoZObYqD8ln4P7nQ9de1YA | None | 150 | ... | True | False | 2026-02-16 07:30:05.852000+00:00 | 1 | 1 | 1 | 1 | 1 | None | 1 |
1 rows × 21 columns
Here is more background on search and examples for searching the entire cell type ontology: How does search work?
Filter operators¶
You can qualify the type of comparison in a query by using a comparator.
Below follows a list of the most import, but Django supports about two dozen field comparators field__comparator=value.
and¶
ln.Artifact.filter(suffix=".h5ad", records=experiment_1).to_dataframe()
Show code cell output
| uid | key | description | suffix | kind | otype | size | hash | n_files | n_observations | ... | is_latest | is_locked | created_at | branch_id | created_on_id | space_id | storage_id | run_id | schema_id | created_by_id | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | |||||||||||||||||||||
| 4 | NctrRDzpuRv8Rj0y0000 | examples/dataset1.h5ad | None | .h5ad | dataset | AnnData | 31672 | FB3CeMjmg1ivN6HDy6wsSg | None | 3 | ... | True | False | 2026-02-16 07:30:11.368000+00:00 | 1 | 1 | 1 | 1 | 1 | 3 | 1 |
1 rows × 21 columns
less than/ greater than¶
Or subset to artifacts greater than 10kB. Here, we can’t use keyword arguments, but need an explicit where statement.
ln.Artifact.filter(records=experiment_1, size__gt=1e4).to_dataframe()
Show code cell output
| uid | key | description | suffix | kind | otype | size | hash | n_files | n_observations | ... | is_latest | is_locked | created_at | branch_id | created_on_id | space_id | storage_id | run_id | schema_id | created_by_id | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | |||||||||||||||||||||
| 4 | NctrRDzpuRv8Rj0y0000 | examples/dataset1.h5ad | None | .h5ad | dataset | AnnData | 31672 | FB3CeMjmg1ivN6HDy6wsSg | None | 3 | ... | True | False | 2026-02-16 07:30:11.368000+00:00 | 1 | 1 | 1 | 1 | 1 | 3 | 1 |
1 rows × 21 columns
in¶
ln.Artifact.filter(suffix__in=[".jpg", ".fastq.gz"]).to_dataframe()
Show code cell output
| uid | key | description | suffix | kind | otype | size | hash | n_files | n_observations | ... | is_latest | is_locked | created_at | branch_id | created_on_id | space_id | storage_id | run_id | schema_id | created_by_id | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | |||||||||||||||||||||
| 2 | iKtT51jvCMWr6qQW0000 | my_image.jpg | None | .jpg | None | None | 29358 | r4tnqmKI_SjrkdLzpuWp4g | None | None | ... | True | False | 2026-02-16 07:30:05.669000+00:00 | 1 | 1 | 1 | 1 | 1 | None | 1 |
| 1 | UIGXR76DtRd0svdx0000 | raw/my_fastq.fastq.gz | None | .fastq.gz | None | None | 20 | hi7ZmAzz8sfMd3vIQr-57Q | None | None | ... | True | False | 2026-02-16 07:30:05.476000+00:00 | 1 | 1 | 1 | 1 | 1 | None | 1 |
2 rows × 21 columns
order by¶
ln.Artifact.filter().order_by("created_at").to_dataframe()
Show code cell output
| uid | key | description | suffix | kind | otype | size | hash | n_files | n_observations | ... | is_latest | is_locked | created_at | branch_id | created_on_id | space_id | storage_id | run_id | schema_id | created_by_id | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | |||||||||||||||||||||
| 1 | UIGXR76DtRd0svdx0000 | raw/my_fastq.fastq.gz | None | .fastq.gz | None | None | 20 | hi7ZmAzz8sfMd3vIQr-57Q | None | NaN | ... | True | False | 2026-02-16 07:30:05.476000+00:00 | 1 | 1 | 1 | 1 | 1 | NaN | 1 |
| 2 | iKtT51jvCMWr6qQW0000 | my_image.jpg | None | .jpg | None | None | 29358 | r4tnqmKI_SjrkdLzpuWp4g | None | NaN | ... | True | False | 2026-02-16 07:30:05.669000+00:00 | 1 | 1 | 1 | 1 | 1 | NaN | 1 |
| 3 | GqRjzz4l253RsnqK0000 | iris.parquet | None | .parquet | dataset | DataFrame | 5202 | uoZObYqD8ln4P7nQ9de1YA | None | 150.0 | ... | True | False | 2026-02-16 07:30:05.852000+00:00 | 1 | 1 | 1 | 1 | 1 | NaN | 1 |
| 4 | NctrRDzpuRv8Rj0y0000 | examples/dataset1.h5ad | None | .h5ad | dataset | AnnData | 31672 | FB3CeMjmg1ivN6HDy6wsSg | None | 3.0 | ... | True | False | 2026-02-16 07:30:11.368000+00:00 | 1 | 1 | 1 | 1 | 1 | 3.0 | 1 |
| 5 | 3taqR7IFSpWlfFMi0000 | examples/dataset2.h5ad | None | .h5ad | dataset | AnnData | 26896 | RKJjWbINYNIwYU8BxCejMw | None | 3.0 | ... | True | False | 2026-02-16 07:30:14.290000+00:00 | 1 | 1 | 1 | 1 | 1 | 3.0 | 1 |
5 rows × 21 columns
# reverse ordering
ln.Artifact.filter().order_by("-created_at").to_dataframe()
Show code cell output
| uid | key | description | suffix | kind | otype | size | hash | n_files | n_observations | ... | is_latest | is_locked | created_at | branch_id | created_on_id | space_id | storage_id | run_id | schema_id | created_by_id | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | |||||||||||||||||||||
| 5 | 3taqR7IFSpWlfFMi0000 | examples/dataset2.h5ad | None | .h5ad | dataset | AnnData | 26896 | RKJjWbINYNIwYU8BxCejMw | None | 3.0 | ... | True | False | 2026-02-16 07:30:14.290000+00:00 | 1 | 1 | 1 | 1 | 1 | 3.0 | 1 |
| 4 | NctrRDzpuRv8Rj0y0000 | examples/dataset1.h5ad | None | .h5ad | dataset | AnnData | 31672 | FB3CeMjmg1ivN6HDy6wsSg | None | 3.0 | ... | True | False | 2026-02-16 07:30:11.368000+00:00 | 1 | 1 | 1 | 1 | 1 | 3.0 | 1 |
| 3 | GqRjzz4l253RsnqK0000 | iris.parquet | None | .parquet | dataset | DataFrame | 5202 | uoZObYqD8ln4P7nQ9de1YA | None | 150.0 | ... | True | False | 2026-02-16 07:30:05.852000+00:00 | 1 | 1 | 1 | 1 | 1 | NaN | 1 |
| 2 | iKtT51jvCMWr6qQW0000 | my_image.jpg | None | .jpg | None | None | 29358 | r4tnqmKI_SjrkdLzpuWp4g | None | NaN | ... | True | False | 2026-02-16 07:30:05.669000+00:00 | 1 | 1 | 1 | 1 | 1 | NaN | 1 |
| 1 | UIGXR76DtRd0svdx0000 | raw/my_fastq.fastq.gz | None | .fastq.gz | None | None | 20 | hi7ZmAzz8sfMd3vIQr-57Q | None | NaN | ... | True | False | 2026-02-16 07:30:05.476000+00:00 | 1 | 1 | 1 | 1 | 1 | NaN | 1 |
5 rows × 21 columns
ln.Artifact.filter().order_by("key").to_dataframe()
Show code cell output
| uid | key | description | suffix | kind | otype | size | hash | n_files | n_observations | ... | is_latest | is_locked | created_at | branch_id | created_on_id | space_id | storage_id | run_id | schema_id | created_by_id | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | |||||||||||||||||||||
| 4 | NctrRDzpuRv8Rj0y0000 | examples/dataset1.h5ad | None | .h5ad | dataset | AnnData | 31672 | FB3CeMjmg1ivN6HDy6wsSg | None | 3.0 | ... | True | False | 2026-02-16 07:30:11.368000+00:00 | 1 | 1 | 1 | 1 | 1 | 3.0 | 1 |
| 5 | 3taqR7IFSpWlfFMi0000 | examples/dataset2.h5ad | None | .h5ad | dataset | AnnData | 26896 | RKJjWbINYNIwYU8BxCejMw | None | 3.0 | ... | True | False | 2026-02-16 07:30:14.290000+00:00 | 1 | 1 | 1 | 1 | 1 | 3.0 | 1 |
| 3 | GqRjzz4l253RsnqK0000 | iris.parquet | None | .parquet | dataset | DataFrame | 5202 | uoZObYqD8ln4P7nQ9de1YA | None | 150.0 | ... | True | False | 2026-02-16 07:30:05.852000+00:00 | 1 | 1 | 1 | 1 | 1 | NaN | 1 |
| 2 | iKtT51jvCMWr6qQW0000 | my_image.jpg | None | .jpg | None | None | 29358 | r4tnqmKI_SjrkdLzpuWp4g | None | NaN | ... | True | False | 2026-02-16 07:30:05.669000+00:00 | 1 | 1 | 1 | 1 | 1 | NaN | 1 |
| 1 | UIGXR76DtRd0svdx0000 | raw/my_fastq.fastq.gz | None | .fastq.gz | None | None | 20 | hi7ZmAzz8sfMd3vIQr-57Q | None | NaN | ... | True | False | 2026-02-16 07:30:05.476000+00:00 | 1 | 1 | 1 | 1 | 1 | NaN | 1 |
5 rows × 21 columns
# reverse ordering
ln.Artifact.filter().order_by("-key").to_dataframe()
Show code cell output
| uid | key | description | suffix | kind | otype | size | hash | n_files | n_observations | ... | is_latest | is_locked | created_at | branch_id | created_on_id | space_id | storage_id | run_id | schema_id | created_by_id | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | |||||||||||||||||||||
| 1 | UIGXR76DtRd0svdx0000 | raw/my_fastq.fastq.gz | None | .fastq.gz | None | None | 20 | hi7ZmAzz8sfMd3vIQr-57Q | None | NaN | ... | True | False | 2026-02-16 07:30:05.476000+00:00 | 1 | 1 | 1 | 1 | 1 | NaN | 1 |
| 2 | iKtT51jvCMWr6qQW0000 | my_image.jpg | None | .jpg | None | None | 29358 | r4tnqmKI_SjrkdLzpuWp4g | None | NaN | ... | True | False | 2026-02-16 07:30:05.669000+00:00 | 1 | 1 | 1 | 1 | 1 | NaN | 1 |
| 3 | GqRjzz4l253RsnqK0000 | iris.parquet | None | .parquet | dataset | DataFrame | 5202 | uoZObYqD8ln4P7nQ9de1YA | None | 150.0 | ... | True | False | 2026-02-16 07:30:05.852000+00:00 | 1 | 1 | 1 | 1 | 1 | NaN | 1 |
| 5 | 3taqR7IFSpWlfFMi0000 | examples/dataset2.h5ad | None | .h5ad | dataset | AnnData | 26896 | RKJjWbINYNIwYU8BxCejMw | None | 3.0 | ... | True | False | 2026-02-16 07:30:14.290000+00:00 | 1 | 1 | 1 | 1 | 1 | 3.0 | 1 |
| 4 | NctrRDzpuRv8Rj0y0000 | examples/dataset1.h5ad | None | .h5ad | dataset | AnnData | 31672 | FB3CeMjmg1ivN6HDy6wsSg | None | 3.0 | ... | True | False | 2026-02-16 07:30:11.368000+00:00 | 1 | 1 | 1 | 1 | 1 | 3.0 | 1 |
5 rows × 21 columns
contains¶
ln.Transform.filter(description__contains="search").to_dataframe().head(5)
Show code cell output
| uid | key | description | kind | source_code | hash | reference | reference_type | version_tag | is_latest | is_locked | created_at | branch_id | created_on_id | space_id | environment_id | plan_id | created_by_id | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | ||||||||||||||||||
| 1 | yEfnBDXNI2FF0000 | registries.ipynb | Query & search registries [.to_dataframe().head(5)
Show code cell output
| uid | key | description | kind | source_code | hash | reference | reference_type | version_tag | is_latest | is_locked | created_at | branch_id | created_on_id | space_id | environment_id | plan_id | created_by_id | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | ||||||||||||||||||
| 1 | yEfnBDXNI2FF0000 | registries.ipynb | Query & search registries [.to_dataframe()
Show code cell output
| uid | key | description | kind | source_code | hash | reference | reference_type | version_tag | is_latest | is_locked | created_at | branch_id | created_on_id | space_id | environment_id | plan_id | created_by_id | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | ||||||||||||||||||
| 1 | yEfnBDXNI2FF0000 | registries.ipynb | Query & search registries [ | ln.Q(suffix=".fastq.gz")).to_dataframe()
Show code cell output
| uid | key | description | suffix | kind | otype | size | hash | n_files | n_observations | ... | is_latest | is_locked | created_at | branch_id | created_on_id | space_id | storage_id | run_id | schema_id | created_by_id | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | |||||||||||||||||||||
| 2 | iKtT51jvCMWr6qQW0000 | my_image.jpg | None | .jpg | None | None | 29358 | r4tnqmKI_SjrkdLzpuWp4g | None | None | ... | True | False | 2026-02-16 07:30:05.669000+00:00 | 1 | 1 | 1 | 1 | 1 | None | 1 |
| 1 | UIGXR76DtRd0svdx0000 | raw/my_fastq.fastq.gz | None | .fastq.gz | None | None | 20 | hi7ZmAzz8sfMd3vIQr-57Q | None | None | ... | True | False | 2026-02-16 07:30:05.476000+00:00 | 1 | 1 | 1 | 1 | 1 | None | 1 |
2 rows × 21 columns
negate/ unequal¶
ln.Artifact.filter(~ln.Q(suffix=".jpg")).to_dataframe()
Show code cell output
| uid | key | description | suffix | kind | otype | size | hash | n_files | n_observations | ... | is_latest | is_locked | created_at | branch_id | created_on_id | space_id | storage_id | run_id | schema_id | created_by_id | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | |||||||||||||||||||||
| 5 | 3taqR7IFSpWlfFMi0000 | examples/dataset2.h5ad | None | .h5ad | dataset | AnnData | 26896 | RKJjWbINYNIwYU8BxCejMw | None | 3.0 | ... | True | False | 2026-02-16 07:30:14.290000+00:00 | 1 | 1 | 1 | 1 | 1 | 3.0 | 1 |
| 4 | NctrRDzpuRv8Rj0y0000 | examples/dataset1.h5ad | None | .h5ad | dataset | AnnData | 31672 | FB3CeMjmg1ivN6HDy6wsSg | None | 3.0 | ... | True | False | 2026-02-16 07:30:11.368000+00:00 | 1 | 1 | 1 | 1 | 1 | 3.0 | 1 |
| 3 | GqRjzz4l253RsnqK0000 | iris.parquet | None | .parquet | dataset | DataFrame | 5202 | uoZObYqD8ln4P7nQ9de1YA | None | 150.0 | ... | True | False | 2026-02-16 07:30:05.852000+00:00 | 1 | 1 | 1 | 1 | 1 | NaN | 1 |
| 1 | UIGXR76DtRd0svdx0000 | raw/my_fastq.fastq.gz | None | .fastq.gz | None | None | 20 | hi7ZmAzz8sfMd3vIQr-57Q | None | NaN | ... | True | False | 2026-02-16 07:30:05.476000+00:00 | 1 | 1 | 1 | 1 | 1 | NaN | 1 |
4 rows × 21 columns