Ontology Term Lookup¶
Metaseed provides integrated ontology term lookup using the OLS4 (Ontology Lookup Service) API. This enables users to search and select standardized ontology terms when editing metadata.
Overview¶
Fields with type: ontology_term automatically get:
- Autocomplete: Type-ahead suggestions as you type
- Modal search: Full search interface via Tab key or search button
- OLS4 integration: Real-time queries to the EBI Ontology Lookup Service
- Smart display: Selected terms show as "label (ID)" for readability
Field Configuration¶
Basic Ontology Field¶
This creates an input that searches across all ontologies in OLS4.
Scoped to Specific Ontologies¶
Use ontologies to restrict searches to specific ontology IDs:
fields:
# Single ontology
- name: organism
type: ontology_term
ontologies: ["ncbitaxon"]
description: Organism from NCBI Taxonomy
# Multiple ontologies
- name: trait
type: ontology_term
ontologies: ["pato", "to"]
description: Trait from PATO or Trait Ontology
Common ontology IDs:
| ID | Ontology |
|---|---|
ncbitaxon |
NCBI Taxonomy (organisms) |
pato |
Phenotype and Trait Ontology |
envo |
Environment Ontology |
go |
Gene Ontology |
obi |
Ontology for Biomedical Investigations |
po |
Plant Ontology |
chebi |
Chemical Entities of Biological Interest |
uo |
Units of Measurement Ontology |
co_321 |
Crop Ontology - Wheat traits |
agro |
Agronomy Ontology |
peco |
Plant Experimental Conditions Ontology |
Browse all available ontologies at OLS4 Ontologies. The lowercase ontology ID shown in the URL (e.g., ncbitaxon from /ols4/ontologies/ncbitaxon) is the value to use in the ontologies field.
User Interface¶
Autocomplete¶
When typing in an ontology term field:
- Start typing (minimum 1 character)
- Suggestions appear after 300ms debounce
- Use arrow keys to navigate
- Press Enter or click to select
- Press Escape to dismiss
Each suggestion shows:
- Term ID (e.g., PATO:0000001)
- Label (e.g., "quality")
- Source ontology
- Description (truncated)
Display Format¶
After selection, terms display as "label (ID)" for readability:
centimeter (UO:0000015)instead ofUO:0000015temperature (PATO:0000146)instead ofPATO:0000146
The underlying data stores only the ID for interoperability.
Modal Search¶
For more detailed browsing:
- Press Tab when the input is focused, or
- Click the search button (magnifying glass icon)
The modal provides: - Full-text search across term labels and descriptions - Multi-select capability - Chip display of selected terms - Detailed term information
API Endpoint¶
The lookup uses the /api/ontology/search endpoint:
Parameters:
- q (required): Search query
- ontology (optional): Ontology ID(s) to filter results (comma-separated)
Response:
{
"results": [
{
"value": "PATO:0000146",
"label": "temperature",
"description": "A physical quality...",
"ontology": "PATO"
}
]
}
Profile Configuration¶
Define available ontologies in your profile's ontologies section:
spec_version: "0.4"
name: my-profile
version: "1.0"
ontologies:
PATO:
name: Phenotype and Trait Ontology
uri: http://purl.obolibrary.org/obo/pato.owl
ols_id: pato
ENVO:
name: Environment Ontology
uri: http://purl.obolibrary.org/obo/envo.owl
ols_id: envo
entities:
Sample:
fields:
- name: quality
type: ontology_term
ontologies: ["pato"]
- name: environment
type: ontology_term
ontologies: ["envo"]
The ols_id field maps to the OLS4 ontology identifier used for API queries.
HTML/CSS Classes¶
For developers extending the UI:
| Class | Purpose |
|---|---|
lookup-input |
Enables autocomplete behavior |
ontology-lookup-btn |
Search button that opens modal |
autocomplete-dropdown |
Suggestion dropdown container |
ontology-autocomplete |
Ontology-specific dropdown styling |
Data attributes:
- data-lookup-type="ontology" - Identifies ontology lookup
- data-ontologies="pato,envo" - Scopes to specific ontologies (comma-separated)
Keyboard Shortcuts¶
| Key | Action |
|---|---|
| Tab | Open search modal (when no dropdown visible) |
| Tab | Select highlighted item (when dropdown visible) |
| Enter | Select highlighted item |
| Escape | Close dropdown or modal |
| Arrow Up/Down | Navigate suggestions |
See Also¶
- Schema Specification - Field type reference
- REST API - API endpoint documentation
- OLS4 Ontologies Browser - Browse all available ontologies
- OLS4 API Documentation - OLS4 REST API reference