Skip to content

Commit b4f1f44

Browse files
committed
✏️ add complexity score example script
1 parent 1e4fff3 commit b4f1f44

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

examples/complexity_score.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
from ontolearner.tools import Analyzer
2+
from ontolearner.ontology import Wine
3+
4+
# Step 1 — Load ontology
5+
ontology = Wine()
6+
ontology.build_graph()
7+
8+
# Step 2 — Create the analyzer
9+
analyzer = Analyzer()
10+
11+
# Step 3 — Compute topology and dataset metrics
12+
topology_metrics = analyzer.compute_topology_metrics(ontology)
13+
dataset_metrics = analyzer.compute_dataset_metrics(ontology)
14+
15+
# Step 4 — Compute overall complexity score
16+
complexity_score = analyzer.compute_complexity_score(
17+
topology_metrics=topology_metrics,
18+
dataset_metrics=dataset_metrics
19+
)
20+
21+
# Step 5 — Display results
22+
print("Topology Metrics:", topology_metrics)
23+
print("Dataset Metrics:", dataset_metrics)
24+
print("Ontology Complexity Score:", complexity_score)

0 commit comments

Comments
 (0)