Skip to content

Ontolearn 0.11.0

Latest

Choose a tag to compare

@Demirrr Demirrr released this 16 Oct 13:06
7432b37

Ontolearn 0.11.0

A stability and correctness release: a new goal-directed learning-problem generator, reproducible Drill runs, a long list of bug fixes across TDL, CELOE, TripleStore, NCES and CLIP, and a much better-tested codebase.

Highlights

  • New: GoalDirectedLPGenerator (ontolearn.lp_generator). Generates learning problems top-down from an explicit DL-construct grammar instead of refining owl:Thing bottom-up like LPGen/KB2Data.
    • ComplexityProfile / DLConstruct control which constructors (⊓, ⊔, ∃, ∀, cardinality, has-value, ¬) and which length/depth/arity bounds are used.
    • Trivially solvable problems are filtered out; generate() oversamples and keeps the hardest problems by a difficulty score (target length/depth, baseline F1, near-miss negatives).
    • Works on any KB, including ones with no object properties; generate_benchmark() runs a whole curriculum of profiles.
    • See examples/benchmark_complexity_lp_generator_with_tdl.py.
  • Reproducible runs: Drill(random_state=...) seeds a dedicated RNG plus torch/CUDA (#624), and LPGen/KB2Data take a random_seed backed by their own RNG instead of the global random module (#595). (EvoLearner is still unseeded.)
  • TripleStore: instance retrieval is correct for ∃r.⊤ on triplestores without reasoning (#581), correct variable scoping for indirect instances (#575), and individuals_count / most_general_object_properties now use server-side COUNT/ASK instead of pulling whole result sets (#613).
  • CLIP: inference no longer feeds the positive examples in place of the negatives (#638, fixed in #639).
  • CI: the intermittent 1h+ NCES hangs are fixed at the root (DataLoader worker-pool deadlock) (#622).

Upgrade notes

  • Requires Python >= 3.11 (package metadata and docs now say so consistently).
  • Depends on owlapy 1.6.6, which makes owlready2 an optional extra. ontolearn.incomplete_kb and ontolearn.semantic_caching import it lazily; install it explicitly if you use them with owlready2.
  • Removed: ontolearn/tentris.py (not importable since the owlapy 1.1.0 migration), CELOE._add_node_evald, ontolearn/logging_tentris.conf.
  • Behavior changes to be aware of
    • CLIP length predictions can differ from 0.10.0 for the same inputs (negatives are now actually used at inference).
    • TDL/TDL_refinement no longer share a mutable kwargs_grid_search default between instances.
    • TDL/TDL_refinement data-property filtering gained a toggle for boolean data properties (use_data_properties_boolean, #588); TDL's feature-matrix max_runtime now defaults to None (#585).
    • Output previously print()ed in knowledge_base, semantic_caching, drill and a few more modules now goes through logging (configure levels as usual).

Fixed

  • TDL_refinement.classification_report always raised AttributeError (#616).
  • DRILLSearchTreePriorityQueue.get_top_n crashed (#605); LengthBasedRefinement never skipped disjoint refinements (#604).
  • ALCSAT/SPELL crashed on ontologies with illegal punning such as Biopax (#598, via owlapy 1.6.6).
  • EvoLearner instances no longer clobber each other's DEAP types (#609).
  • NCESTrainer/NCES/NCES2/ROCES multiprocessing DataLoader deadlocks (#610, #622).
  • TripleStore.peek() crash for properties without domain/range axioms.
  • Non-deterministic ConceptAbstractSyntaxTreeBuilder repairs.
  • Malformed range/domain axioms are skipped instead of aborting a run (#587); LearningProblemGenerator works again (#589); TDL++ integer handling (#593).
  • Several bare/broad except clauses narrowed so real errors are no longer swallowed.

Performance

  • ModifiedCELOERefinement computes max_nr_fillers lazily instead of sweeping every property against every individual up front (#612).
  • TDL_refinement renders each feature's DL syntax once instead of per example (#611).
  • TripleStore COUNT/ASK queries (see above).

Internal

  • TDL_refinement.fit() / create_training_data deduplicated into shared TDL hooks (#616); abox(), get_top_n and quality_funcs deduplicated.
  • New unit tests for quality_funcs (31→100%), nces_utils (39→87%), incomplete_kb (8→91%), data_struct (~60→97%), value_splitter (33→100%) and utils/static_funcs (37→92%).
  • Ruff >=0.16 with an explicit ruff.toml; CI job has a 90-minute safety timeout.

Full changelog: https://github.com/dice-group/Ontolearn/blob/develop/CHANGELOG.md
Compare: 0.10.0...0.11.0