ontometer_corpus.growth_network¶
The ontology specialisation network placed in time, from tables in the corpus directory.
Three small tables in the corpus directory are enough to rebuild G(t), the specialisation network of ontologies at any time t, without the object store:
ontology_abstractness.parquet
one row per ontology (index onto): release family, registry, captured
release date, reuse community, population flags (subject marks the
measured ontologies).
ontology_dates.parquet
first-evidence date per release family (ontometer-corpus dates).
ontology_specialisations.parquet
one row per (child, parent) pair of ontologies where a class homed in the
child is asserted, by the child, under a class homed in the parent; with
n_terms (term-level specialisations behind the pair) and
panel_first (the first release of the child asserting it, where the
child's releases are in the release panel). Written by
ontometer-corpus growth, which derives it from the entity network.
:func:load_tracked reads them and places ontologies and pairs in time
(:func:ontometer_corpus.dating.time_pairs); :func:viz_payload turns the
result into the data behind the interactive G(t) view, with the Poincaré-disk
layout of :mod:ontometer_corpus.network.hyperbolic.
Attributes¶
EPOCH = pd.Timestamp('1970-01-01')
module-attribute
¶
YEAR = 365.25
module-attribute
¶
COHORTS = [(0, 2009, 'before 2010'), (2010, 2014, '2010-14'), (2015, 2019, '2015-19')]
module-attribute
¶
Classes¶
TimedNetwork
dataclass
¶
Ontologies and specialisation pairs with their times, in days since the epoch.
Attributes:
| Name | Type | Description |
|---|---|---|
onto |
DataFrame
|
one row per ontology, positionally indexed by |
dep |
DataFrame
|
one row per (child, parent) pair: |
b_obs |
ndarray
|
first-evidence birth per ontology. |
b_bnd |
ndarray
|
birth bounded by the first observed specialisation of its classes. |
eps |
ndarray
|
arrival per pair, before the rule that a pair never predates its parent. |
as_of |
float
|
capture date, in days since the epoch. |
as_of_label |
str
|
capture date as given in the dates table ( |
Source code in ontometer_corpus/growth_network.py
Functions:¶
days(values)
¶
Days since the epoch of date-like values.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
values
|
Series
|
dates, date strings or missing values. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
A float array of days since 1970-01-01; NaN where missing or unparseable. |
Source code in ontometer_corpus/growth_network.py
decimal_year(d)
¶
Decimal year of days since the epoch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
d
|
ndarray | float
|
days since 1970-01-01. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
The decimal year, as an array (NaN stays NaN). |
Source code in ontometer_corpus/growth_network.py
assemble(onto, dep, dates)
¶
Place ontologies and pairs in time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
onto
|
DataFrame
|
|
required |
dep
|
DataFrame
|
|
required |
dates
|
DataFrame
|
|
required |
Returns:
| Type | Description |
|---|---|
TimedNetwork
|
The network with first-evidence and bounded births per ontology and |
TimedNetwork
|
arrival times per pair. |
Raises:
| Type | Description |
|---|---|
ValueError
|
if |
Source code in ontometer_corpus/growth_network.py
load_tracked(paths)
¶
Load G(t) from the three tables in the corpus directory (see the module docstring).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
paths
|
CorpusPaths
|
corpus locations; only the corpus tables are read. |
required |
Returns:
| Type | Description |
|---|---|
TimedNetwork
|
The network placed in time, as :func: |
Raises:
| Type | Description |
|---|---|
ReleaseError
|
the corpus directory holds tables of another format. |
Source code in ontometer_corpus/growth_network.py
labels(db_path, onto)
¶
Short label and longer name per ontology, from registry metadata.
The label is the registry acronym or vocabulary prefix where there is one; the name is the registry's title, else the ontology IRI, else the family.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
db_path
|
Path
|
the corpus SQLite database ( |
required |
onto
|
DataFrame
|
needs |
required |
Returns:
| Type | Description |
|---|---|
list[str]
|
|
list[str]
|
characters and names capped at 120. |
Source code in ontometer_corpus/growth_network.py
viz_payload(net, short, long, step=0.25, series_from=2005.0)
¶
The data behind the interactive G(t) view.
Ontologies are shown from their bounded birth; undated ones are left out
and counted. Each ontology's angle is fixed by a radial tree over its
primary parents at capture; the page computes its radius at time t from
steps, the times at which its number of transitive specialisers
changes. series holds the share of ontologies in G(t) that some
ontology specialises, for the whole network and for birth cohorts.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
net
|
TimedNetwork
|
the network placed in time. |
required |
short
|
list[str]
|
short label per ontology (see :func: |
required |
long
|
list[str]
|
longer name per ontology. |
required |
step
|
float
|
spacing of the time grid, in years; radii and the series are evaluated at these times and at the capture date. |
0.25
|
series_from
|
float
|
first decimal year included in |
2005.0
|
Returns:
| Type | Description |
|---|---|
dict
|
A JSON-serialisable dict with |
dict
|
registry, |
dict
|
radius steps), |
dict
|
over node indices) and |
Source code in ontometer_corpus/growth_network.py
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 | |
build_viz(paths, step=0.25)
¶
:func:viz_payload for the corpus: tables in the corpus directory plus corpus.db.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
paths
|
CorpusPaths
|
corpus locations. |
required |
step
|
float
|
spacing of the time grid, in years. |
0.25
|
Returns:
| Type | Description |
|---|---|
dict
|
The payload of :func: |