Skip to content

Commit 688f98f

Browse files
committed
mention aliases
1 parent 67b8237 commit 688f98f

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ Specifically, `ontoenv` looks for patterns like the following inside local ontol
3737

3838
When initialized, `ontoenv` searches the specified directories for ontology declarations, identifies their `owl:imports`, and recursively pulls in dependencies. Runtime queries operate on an in‑memory Oxigraph store. Persistent on‑disk state uses a compact RDF5D file at `.ontoenv/store.r5tu` with single‑writer, shared reader locking.
3939

40+
### Canonical IRIs and Source URLs
41+
42+
Ontologies fetched from a URL often declare a different, usually versioned, ontology IRI inside the file. `ontoenv` now remembers that relationship. When an ontology is added we record the source location and, if its declared name differs, create an alias from the normalized URL to the canonical ontology identifier. Future `owl:imports` that reference the versionless URL will therefore reuse the already downloaded ontology instead of refetching it. Removing an ontology clears any aliases associated with it, and loading an existing environment rebuilds the mapping automatically.
43+
4044
## CLI
4145

4246
### Installation

python/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ env = OntoEnv()
2323
brick_name = env.add("../brick/Brick.ttl")
2424
print(f"Added ontology {brick_name}")
2525

26+
# When you add from a URL whose declared ontology name differs (for example a
27+
# versioned IRI served at a versionless URL), pyontoenv records that alias. You
28+
# can later refer to the ontology by either the canonical name or the original
29+
# URL when resolving imports or querying.
30+
2631
# get the graph of the ontology we just added
2732
# env.get_graph returns an rdflib.Graph
2833
brick_graph = env.get_graph(brick_name)

0 commit comments

Comments
 (0)