Ontology import
Loads a vocabulary — a taxonomy, a thesaurus, an ontology, or a domain graph written as an edge list — into an index, as concepts a linker can match and edges a traversal can walk.
This is the endpoint behind Importing a vocabulary, which explains what the readers do and the rules that make re-importing safe. This page is the request contract.
Path and HTTP methods
POST /_plugins/_ontology/<vocabulary>/_import
<vocabulary> is the index the vocabulary is written to, and the name a concept_link processor refers to it by. It is created if absent.
Request fields
| Field | Data type | Description | Required |
|---|---|---|---|
uri | String | Where to fetch the vocabulary from: s3://, gs://, gcs://, az://, azure://, https://, or http://. | Yes |
format | String | rdf (default) for Turtle or N-Triples, or edge_list for delimited rows. | No |
profile | String | Which predicates mean what, for rdf: skos, owl, or default (both). Defaults to default. | No |
predicate | String | The edge field rows become, such as road. Required when format is edge_list. | No |
delimiter | String | A single character separating columns in an edge list. Omit to infer it from the first row. | No |
reference_config | Object | Passed to the content resolver unchanged, as an ingest processor's reference_config is. Plaintext HTTP requires {"allow_http": "true"}; an object store may need a region or endpoint. | No |
max_concepts | Integer | The most concepts one import may hold in memory. Defaults to 2000000. | No |
batch_size | Integer | Documents per bulk request. Defaults to 1000. | No |
Response fields
| Field | Data type | Description |
|---|---|---|
vocabulary | String | The index written to. |
concepts | Integer | Concept documents indexed. |
relations | Integer | Edge documents indexed. |
predicates | Array | The edge fields seen, and therefore mapped as graph_edge. |
took_in_millis | Integer | How long the import took. |
The counts are the point. An import that matched no predicate the profile knows still succeeds at every step, so an acknowledgement alone would read true over an empty vocabulary. "concepts": 0 is how you see that without going to look.
Example request
POST /_plugins/_ontology/concepts/_import
{
"uri": "s3://my-bucket/taxonomy.nt",
"format": "rdf",
"profile": "default",
"reference_config": { "region": "us-east-1" }
}
Example response
{
"vocabulary": "concepts",
"concepts": 2847,
"relations": 391,
"predicates": ["broader"],
"took_in_millis": 412
}
Importing a domain graph
POST /_plugins/_ontology/roads/_import
{
"uri": "s3://my-bucket/edges.tsv",
"format": "edge_list",
"predicate": "road",
"delimiter": "\t"
}
Columns beyond the first two become attributes of the edge. See Importing a vocabulary for how identifiers are treated and why a file mixing numeric and textual ones is refused.
What gets written
Both halves go into the one index: concept documents carrying id, iri, label and alt_labels, and edge documents carrying one object field named for the predicate, shaped {"broader": {"source": 12345, "target": 67890}}.
They share an index deliberately — the label matcher skips any document without a numeric id, so edges are invisible to it, and you name one thing rather than keeping two names in step.
The index is created with a single shard. A graph_edge field refuses any other count, because a traversal walks one shard's segments and a graph spread across shards would answer partially while appearing complete. A vocabulary therefore lives on one shard however large it is, and importing into an existing index with more shards will take the concepts and refuse the edges.
Re-importing
Identities are derived rather than assigned, so importing the same file again rewrites the same documents in place instead of appending a second copy. A large vocabulary published in parts can be imported part by part, in any order.
If a bulk write fails the import stops rather than continuing past it, because a vocabulary quietly missing whatever the cluster was too busy to accept is worse than one that failed loudly. Run it again.
Governance
The vocabulary is fetched under the same policy as every other fetch the ingest-content plugin makes, and enforcement is on by default. See content-source governance.
There is no file:// resolver, so a vocabulary on local disk cannot be imported — it has to be somewhere the cluster can fetch from.
Known limits
- Memory is proportional to concepts, not file size. A concept's labels are scattered through an RDF file, so concepts are held until the file closes while relations stream.
max_conceptsbounds this and fails by name rather than exhausting the heap. - The label cache is per node. An import drops that cache on the node that ran it. Re-importing a vocabulary already in use elsewhere will go on matching by the old labels on other nodes until they restart.