{"id":28966199,"url":"https://github.com/dice-group/ontolearn","last_synced_at":"2025-06-24T07:30:51.319Z","repository":{"id":38067063,"uuid":"263887679","full_name":"dice-group/Ontolearn","owner":"dice-group","description":"OWL Class Expressions Learning in Python","archived":false,"fork":false,"pushed_at":"2025-06-11T09:47:26.000Z","size":11959,"stargazers_count":48,"open_issues_count":14,"forks_count":9,"subscribers_count":8,"default_branch":"develop","last_synced_at":"2025-06-11T10:52:00.099Z","etag":null,"topics":["concept-learning","description-logics","knowledge-base","machine-learning","ontology","owl","owl2","semantic-web","web-ontology-language"],"latest_commit_sha":null,"homepage":"https://ontolearn-docs-dice-group.netlify.app/index.html","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dice-group.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-05-14T10:45:25.000Z","updated_at":"2025-05-26T08:41:36.000Z","dependencies_parsed_at":"2023-10-15T06:13:38.252Z","dependency_job_id":"edc59183-bc58-4702-a07b-d0dc69d6eced","html_url":"https://github.com/dice-group/Ontolearn","commit_stats":{"total_commits":1277,"total_committers":17,"mean_commits":75.11764705882354,"dds":0.6233359436178543,"last_synced_commit":"db3a910d380d7086f671b1f3f5547557ece99605"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/dice-group/Ontolearn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dice-group%2FOntolearn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dice-group%2FOntolearn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dice-group%2FOntolearn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dice-group%2FOntolearn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dice-group","download_url":"https://codeload.github.com/dice-group/Ontolearn/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dice-group%2FOntolearn/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261627608,"owners_count":23186666,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["concept-learning","description-logics","knowledge-base","machine-learning","ontology","owl","owl2","semantic-web","web-ontology-language"],"created_at":"2025-06-24T07:30:48.886Z","updated_at":"2025-06-24T07:30:51.298Z","avatar_url":"https://github.com/dice-group.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Downloads](https://static.pepy.tech/badge/ontolearn)](https://pepy.tech/project/ontolearn)\n[![Downloads](https://img.shields.io/pypi/dm/ontolearn)](https://pypi.org/project/ontolearn/)\n[![Coverage](https://img.shields.io/badge/coverage-86%25-green)](https://ontolearn-docs-dice-group.netlify.app/usage/09_further_resources#code-coverage)\n[![Pypi](https://img.shields.io/badge/pypi-0.9.2-blue)](https://pypi.org/project/ontolearn/0.9.2/)\n[![Docs](https://img.shields.io/badge/documentation-0.9.2-yellow)](https://ontolearn-docs-dice-group.netlify.app/usage/01_introduction)\n[![Python](https://img.shields.io/badge/python-3.10.13+-4584b6)](https://www.python.org/downloads/release/python-31013/)\n[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/dice-group/Ontolearn)\n\u0026nbsp;\n\n![Ontolearn](docs/_static/images/Ontolearn_logo.png)\n\n# Ontolearn: Learning OWL Class Expressions\n\n*Ontolearn* is an open-source software library for learning owl class expressions at large scale.\n\nGiven positive and negative [OWL named individual](https://www.w3.org/TR/owl2-syntax/#Individuals) examples\n$E^+$ and $E^-$, learning [OWL Class expression](https://www.w3.org/TR/owl2-syntax/#Class_Expressions) problem refers to the following supervised Machine Learning problem\n\n$$\\forall p \\in E^+\\ \\mathcal{K} \\models H(p) \\wedge \\forall n \\in E^-\\ \\mathcal{K} \\not \\models H(n).$$\n\nTo tackle this supervised learning problem, ontolearn offers many symbolic, neuro-symbolic and deep learning based Learning algorithms: \n- **TDL** \u0026rarr; Tree-based OWL Class Expression Learner for Large Graphs\n- **Drill** \u0026rarr; [Neuro-Symbolic Class Expression Learning](https://www.ijcai.org/proceedings/2023/0403.pdf)\n- **EvoLearner** \u0026rarr; [EvoLearner: Learning Description Logics with Evolutionary Algorithms](https://dl.acm.org/doi/abs/10.1145/3485447.3511925)\n- **NCES2** \u0026rarr; [Neural Class Expression Synthesis in ALCHIQ(D)](https://papers.dice-research.org/2023/ECML_NCES2/NCES2_public.pdf)\n- **ROCES** \u0026rarr; [Robust Class Expression Synthesis in Description Logics via Iterative Sampling](https://www.ijcai.org/proceedings/2024/0479.pdf)\n- **NCES** \u0026rarr; [Neural Class Expression Synthesis](https://link.springer.com/chapter/10.1007/978-3-031-33455-9_13) \n- **NERO** \u0026rarr; (soon) [Learning Permutation-Invariant Embeddings for Description Logic Concepts](https://link.springer.com/chapter/10.1007/978-3-031-30047-9_9)\n- **CLIP** \u0026rarr; [Learning Concept Lengths Accelerates Concept Learning in ALC](https://link.springer.com/chapter/10.1007/978-3-031-06981-9_14)\n- **CELOE** \u0026rarr; [Class Expression Learning for Ontology Engineering](https://www.sciencedirect.com/science/article/abs/pii/S1570826811000023)\n- **OCEL** \u0026rarr; A limited version of CELOE\n\nFind more in the [Documentation](https://ontolearn-docs-dice-group.netlify.app/usage/01_introduction).\n\n[DeepWiki](https://deepwiki.com/dice-group/Ontolearn) can also help you get started with Ontolearn.\n\n\n## Installation\n\n```shell\npip install ontolearn \n```\nor\n```shell\ngit clone https://github.com/dice-group/Ontolearn.git \n# To create a virtual python env with conda \nconda create -n venv python=3.10.14 --no-default-packages \u0026\u0026 conda activate venv \u0026\u0026 pip install -e .\n# To download knowledge graphs\nwget https://files.dice-research.org/projects/Ontolearn/KGs.zip -O ./KGs.zip \u0026\u0026 unzip KGs.zip\n# To download learning problems\nwget https://files.dice-research.org/projects/Ontolearn/LPs.zip -O ./LPs.zip \u0026\u0026 unzip LPs.zip\n```\n\n## Learning OWL Class Expressions\n```python\nfrom ontolearn.learners import TDL\nfrom ontolearn.triple_store import TripleStore\nfrom ontolearn.knowledge_base import KnowledgeBase\nfrom ontolearn.learning_problem import PosNegLPStandard\nfrom owlapy.owl_individual import OWLNamedIndividual\nfrom owlapy import owl_expression_to_sparql, owl_expression_to_dl\n# (1) Initialize Triplestore or KnowledgeBase\n# sudo docker run -p 3030:3030 -e ADMIN_PASSWORD=pw123 stain/jena-fuseki\n# Login http://localhost:3030/#/ with admin and pw123 and upload KGs/Family/family.owl\n# kb = TripleStore(url=\"http://localhost:3030/family\")\nkb = KnowledgeBase(path=\"KGs/Family/father.owl\")\n# (2) Initialize a learner.\nmodel = TDL(knowledge_base=kb, use_nominals=True)\n# (3) Define a description logic concept learning problem.\nlp = PosNegLPStandard(pos={OWLNamedIndividual(\"http://example.com/father#stefan\")},\n                      neg={OWLNamedIndividual(\"http://example.com/father#heinz\"),\n                           OWLNamedIndividual(\"http://example.com/father#anna\"),\n                           OWLNamedIndividual(\"http://example.com/father#michelle\")})\n# (4) Learn description logic concepts best fitting (3).\nh = model.fit(learning_problem=lp).best_hypotheses()\nprint(h) \nprint(owl_expression_to_dl(h))\nprint(owl_expression_to_sparql(expression=h)) \n\"\"\"\nOWLObjectSomeValuesFrom(property=OWLObjectProperty(IRI('http://example.com/father#','hasChild')),filler=OWLObjectOneOf((OWLNamedIndividual(IRI('http://example.com/father#','markus')),)))\n\n∃ hasChild.{markus}\n\nSELECT\n DISTINCT ?x WHERE { \n?x \u003chttp://example.com/father#hasChild\u003e ?s_1 . \n FILTER ( ?s_1 IN ( \n\u003chttp://example.com/father#markus\u003e\n ) )\n }\n\"\"\"\nprint(model.classification_report)\n\"\"\"\nClassification Report: Negatives: -1 and Positives 1 \n              precision    recall  f1-score   support\n\n    Negative       1.00      1.00      1.00         3\n    Positive       1.00      1.00      1.00         1\n\n    accuracy                           1.00         4\n   macro avg       1.00      1.00      1.00         4\nweighted avg       1.00      1.00      1.00         4\n\"\"\"\n```\n\n## Learning OWL Class Expressions over DBpedia\n```python\nfrom ontolearn.learners import TDL, Drill\nfrom ontolearn.triple_store import TripleStore\nfrom ontolearn.learning_problem import PosNegLPStandard\nfrom owlapy.owl_individual import OWLNamedIndividual\nfrom owlapy import owl_expression_to_sparql, owl_expression_to_dl\nfrom ontolearn.utils.static_funcs import save_owl_class_expressions\n# (1) Initialize Triplestore\nkb = TripleStore(url=\"https://dbpedia.data.dice-research.org/sparql\")\n# (3) Initialize a learner.\nmodel = Drill(knowledge_base=kb) #  or  TDL(knowledge_base=kb)\n# (4) Define a description logic concept learning problem.\nlp = PosNegLPStandard(pos={OWLNamedIndividual(\"http://dbpedia.org/resource/Angela_Merkel\")},\n                      neg={OWLNamedIndividual(\"http://dbpedia.org/resource/Barack_Obama\")})\n# (5) Learn description logic concepts best fitting (4).\nh = model.fit(learning_problem=lp).best_hypotheses()\nprint(h)\nprint(owl_expression_to_dl(h))\nprint(owl_expression_to_sparql(expression=h))\nsave_owl_class_expressions(expressions=h,path=\"#owl_prediction\")\n```\n\nFore more please refer to the [examples](https://github.com/dice-group/Ontolearn/tree/develop/examples) folder.\n\n## ontolearn-webservice \n\n\u003cdetails\u003e\u003csummary\u003e Click me! \u003c/summary\u003e\n\nLoad an RDF knowledge graph \n```shell\nontolearn-webservice --path_knowledge_base KGs/Mutagenesis/mutagenesis.owl\n```\nor launch a Tentris instance https://github.com/dice-group/tentris over Mutagenesis.\n```shell\nontolearn-webservice --endpoint_triple_store http://0.0.0.0:9080/sparql\n```\nThe below code trains DRILL with 6 randomly generated learning problems\nprovided that **path_to_pretrained_drill** does not lead to a directory containing pretrained DRILL.\nThereafter, trained DRILL is saved in the directory **path_to_pretrained_drill**.\nFinally, trained DRILL will learn an OWL class expression.\n```python\nimport json\nimport requests\nwith open(f\"LPs/Mutagenesis/lps.json\") as json_file:\n    learning_problems = json.load(json_file)[\"problems\"]\nfor str_target_concept, examples in learning_problems.items():\n    response = requests.get('http://0.0.0.0:8000/cel',\n                            headers={'accept': 'application/json', 'Content-Type': 'application/json'},\n                            json={\"pos\": examples['positive_examples'],\n                                  \"neg\": examples['negative_examples'],\n                                  \"model\": \"Drill\",\n                                  \"path_embeddings\": \"mutagenesis_embeddings/Keci_entity_embeddings.csv\",\n                                  \"path_to_pretrained_drill\": \"pretrained_drill\",\n                                  # if pretrained_drill exists, upload, otherwise train one and save it there\n                                  \"num_of_training_learning_problems\": 2,\n                                  \"num_of_target_concepts\": 3,\n                                  \"max_runtime\": 60000,  # seconds\n                                  \"iter_bound\": 1  # number of iterations/applied refinement opt.\n                                  })\n    print(response.json())  # {'Prediction': '∀ hasAtom.(¬Nitrogen-34)', 'F1': 0.7283582089552239, 'saved_prediction': 'Predictions.owl'}\n```\nTDL (a more scalable learner) can also be used as follows\n```python\nimport json\nimport requests\nresponse = requests.get('http://0.0.0.0:8000/cel',\n                        headers={'accept': 'application/json', 'Content-Type': 'application/json'},\n                        json={\"pos\": examples['positive_examples'],\n                              \"neg\": examples['negative_examples'],\n                              \"model\": \"TDL\"})\nprint(response.json())\n```\nNCES (another scalable learner). The following will first train NCES if the provided path `path_to_pretrained_nces` does not exist\n```python\nimport json\nimport requests\nwith open(f\"LPs/Mutagenesis/lps.json\") as json_file:\n    learning_problems = json.load(json_file)[\"problems\"]\n## This trains NCES before solving the provided learning problems. Expect poor performance for this number of epochs, and this training data size.\n## If GPU is available, set `num_of_training_learning_problems` t0 10_000 or more. Set `nces_train_epochs` to 300 or more, and increase `nces_batch_size`.\nfor str_target_concept, examples in learning_problems.items():\n    response = requests.get('http://0.0.0.0:8000/cel',\n                            headers={'accept': 'application/json', 'Content-Type': 'application/json'},\n                            json={\"pos\": examples['positive_examples'],\n                                  \"neg\": examples['negative_examples'],\n                                  \"model\": \"NCES\",\n                                  \"path_embeddings\": \"mutagenesis_embeddings/Keci_entity_embeddings.csv\",\n                                  \"path_to_pretrained_nces\": None,\n                                  # if pretrained_nces exists, load weghts, otherwise train one and save it\n                                  \"num_of_training_learning_problems\": 100,\n                                  \"nces_train_epochs\": 5,\n                                  \"nces_batch_size\": 16\n                                  })\n    print(response.json())\n```\n\nNow this will use pretrained weights for NCES\n\n```python\nimport json\nimport requests\nwith open(f\"LPs/Mutagenesis/lps.json\") as json_file:\n    learning_problems = json.load(json_file)[\"problems\"]\nfor str_target_concept, examples in learning_problems.items():\n    response = requests.get('http://0.0.0.0:8000/cel',\n                            headers={'accept': 'application/json', 'Content-Type': 'application/json'},\n                            json={\"pos\": examples['positive_examples'],\n                                  \"neg\": examples['negative_examples'],\n                                  \"model\": \"NCES\",\n                                  \"path_embeddings\": \"./NCESData/mutagenesis/embeddings/ConEx_entity_embeddings.csv\",\n                                  \"path_to_pretrained_nces\": \"./NCESData/mutagenesis/trained_models/\",\n                                  # if pretrained_nces exists, load weghts, otherwise train one and save it\n                                  \"num_of_training_learning_problems\": 100,\n                                  \"nces_train_epochs\": 5,\n                                  \"nces_batch_size\": 16\n                                  })\n    print(response.json())\n```\n\n\u003c/details\u003e\n\n## Benchmark Results\n\n\u003cdetails\u003e \u003csummary\u003e To see the results \u003c/summary\u003e\n\n```shell\n# To download learning problems. # Benchmark learners on the Family benchmark dataset with benchmark learning problems.\nwget https://files.dice-research.org/projects/Ontolearn/LPs.zip -O ./LPs.zip \u0026\u0026 unzip LPs.zip\n```\n\n### 10-Fold Cross Validation Family Benchmark Results\n\nHere we apply 10-fold cross validation technique on each benchmark learning problem with max runtime of 60 seconds to measure the training and testing performance of learners.\nIn the evaluation, from a given single learning problem (a set of positive and negative examples), a learner learns an OWL Class Expression (H) on a given 9 fold of positive and negative examples.\nTo compute the training performance, We compute F1-score of H train positive and negative examples.\nTo compute the test performance, we compute F1-score of H w.r.t. test positive and negative examples.\n  \n```shell\n# To download learning problems and benchmark learners on the Family benchmark dataset with benchmark learning problems.\npython examples/concept_learning_cv_evaluation.py --kb ./KGs/Family/family-benchmark_rich_background.owl --lps ./LPs/Family/lps_difficult.json --path_of_nces_embeddings ./NCESData/family/embeddings/ConEx_entity_embeddings.csv --path_of_clip_embeddings ./CLIPData/family/embeddings/ConEx_entity_embeddings.csv --max_runtime 60 --report family_results.csv \n```\n\n```shell\n# To download learning problems and benchmark with selected learners on the Family benchmark dataset with benchmark learning problems.\npython examples/concept_learning_cv_evaluation.py --kb ./KGs/Family/family-benchmark_rich_background.owl --lps ./LPs/Family/lps_difficult.json --learner_types ocel drill tdl nces --path_of_nces_embeddings ./NCESData/family/embeddings/ConEx_entity_embeddings.csv --path_of_clip_embeddings ./CLIPData/family/embeddings/ConEx_entity_embeddings.csv --max_runtime 60 --report family_results.csv \n```\n\n```shell\n# To download learning problems and benchmark with a single learner on the Family benchmark dataset with benchmark learning problems.\npython examples/concept_learning_cv_evaluation.py --kb ./KGs/Family/family-benchmark_rich_background.owl --lps ./LPs/Family/lps_difficult.json --learner_types nces --path_of_nces_embeddings ./NCESData/family/embeddings/ConEx_entity_embeddings.csv --path_of_clip_embeddings ./CLIPData/family/embeddings/ConEx_entity_embeddings.csv --max_runtime 60 --report family_results.csv \n```\nIn the following python script, the results are summarized and the markdown displayed below generated.\n```python\nimport pandas as pd\ndf=pd.read_csv(\"family_results.csv\").groupby(\"LP\").mean()\nprint(df[[col for col in df if col.startswith('Test-F1') or col.startswith('RT')]].to_markdown(floatfmt=\".3f\"))\n```\n**Note that DRILL is untrained and we simply used accuracy driven heuristics to learn an OWL class expression.**\n\nBelow, we report the average test F1 score and the average runtimes of learners.\n\n|         LP         | Test-F1-OCEL | RT-OCEL | Test-F1-CELOE | RT-CELOE | Test-F1-Evo | RT-Evo | Test-F1-DRILL | RT-DRILL | Test-F1-TDL | RT-TDL |   Test-F1-NCES |   RT-NCES |   Test-F1-NCES2 |   RT-NCES2 |   Test-F1-ROCES |   RT-ROCES | Test-F1-CLIP | RT-CLIP |\n|:------------------:|-------------:|--------:|--------------:|---------:|------------:|-------:|--------------:|---------:|------------:|-------:|---------------:|----------:|----------------:|-----------:|----------------:|-----------:|-------------:|--------:|\n|        Aunt        |        0.614 |  13.697 |         0.855 |   13.697 |       0.978 |  5.278 |         0.811 |   60.351 |       0.956 |  0.118 |          0.805 |     0.632 |           0.812 |      1.136 |           0.812 |      1.119 |        0.855 |   14.059 |\n|       Cousin       |        0.712 |  10.846 |         0.789 |   10.846 |       0.993 |  3.311 |         0.701 |   60.485 |       0.820 |  0.176 |          0.608 |     0.628 |           0.680 |      1.177 |           0.695 |      1.086 |        0.779 |   9.050 |\n| Grandgranddaughter |        1.000 |   0.013 |         1.000 |    0.013 |       1.000 |  0.426 |         0.980 |   17.486 |       1.000 |  0.050 |          1.000 |     0.507 |           1.000 |      0.955 |           1.000 |      0.917 |        1.000 |   0.639 |\n|  Grandgrandfather  |        1.000 |   0.897 |         1.000 |    0.897 |       1.000 |  0.404 |         0.947 |   55.728 |       0.947 |  0.059 |          0.927 |     0.505 |           0.947 |      0.944 |           0.927 |      0.924 |        1.000 |   0.746  |\n|  Grandgrandmother  |        1.000 |   4.173 |         1.000 |    4.173 |       1.000 |  0.442 |         0.893 |   50.329 |       0.947 |  0.060 |          0.947 |     0.633 |           0.933 |      1.323 |           0.947 |      1.306 |        1.000 |   0.817 |\n|   Grandgrandson    |        1.000 |   1.632 |         1.000 |    1.632 |       1.000 |  0.452 |         0.931 |   60.358 |       0.911 |  0.070 |          0.909 |     0.598 |           0.931 |      1.171 |           0.931 |      1.146 |        1.000 |   0.939 |\n|       Uncle        |        0.876 |  16.244 |         0.891 |   16.244 |       0.964 |  4.516 |         0.876 |   60.416 |       0.933 |  0.098 |          0.854 |     0.538 |           0.891 |      0.948 |           0.891 |      0.905 |        0.928 |   17.682 |\n\n\n|         LP         | Train-F1-OCEL | Train-F1-CELOE | Train-F1-Evo | Train-F1-DRILL | Train-F1-TDL |   Train-F1-NCES |   Train-F1-NCES2 |   Train-F1-ROCES |   Train-F1-CLIP |\n|:------------------:|--------------:|---------------:|-------------:|---------------:|-------------:|----------------:|-----------------:|-----------------:|----------------:|\n|        Aunt        |         0.835 |          0.918 |        0.995 |          0.837 |        1.000 |           0.759 |            0.804 |            0.804 |           0.918 |\n|       Cousin       |         0.746 |          0.796 |        1.000 |          0.732 |        1.000 |           0.680 |            0.696 |            0.728 |           0.798 |\n| Grandgranddaughter |         1.000 |          1.000 |        1.000 |          1.000 |        1.000 |           1.000 |            1.000 |            1.000 |           1.000 |\n|  Grandgrandfather  |         1.000 |          1.000 |        1.000 |          0.968 |        1.000 |           0.910 |            0.944 |            0.942 |           1.000 |\n|  Grandgrandmother  |         1.000 |          1.000 |        1.000 |          0.975 |        1.000 |           0.923 |            0.941 |            0.944 |           1.000 |\n|   Grandgrandson    |         1.000 |          1.000 |        1.000 |          0.962 |        1.000 |           0.911 |            0.923 |            0.923 |           1.000 |\n|       Uncle        |         0.904 |          0.907 |        0.996 |          0.908 |        1.000 |           0.823 |            0.886 |            0.884 |           0.940 |\n\n\n### 10-Fold Cross Validation Mutagenesis Benchmark Results\n```shell\npython examples/concept_learning_cv_evaluation.py --kb ./KGs/Mutagenesis/mutagenesis.owl --lps ./LPs/Mutagenesis/lps.json --path_of_nces_embeddings ./NCESData/mutagenesis/embeddings/ConEx_entity_embeddings.csv --path_of_clip_embeddings ./CLIPData/mutagenesis/embeddings/ConEx_entity_embeddings.csv --max_runtime 60 --report mutagenesis_results.csv \n```\n\n| LP       | Train-F1-OCEL | Test-F1-OCEL | RT-OCEL | Train-F1-CELOE | Test-F1-CELOE | RT-CELOE | Train-F1-Evo | Test-F1-Evo | RT-Evo | Train-F1-DRILL | Test-F1-DRILL | RT-DRILL | Train-F1-TDL | Test-F1-TDL | RT-TDL |   Train-F1-NCES |   Test-F1-NCES |   RT-NCES |   Train-F1-NCES2 |   Test-F1-NCES2 |   RT-NCES2 |   Train-F1-ROCES |   Test-F1-ROCES |   RT-ROCES | Train-F1-CLIP | Test-F1-CLIP | RT-CLIP |\n|:---------|--------------:|-------------:|--------:|---------------:|--------------:|---------:|-------------:|------------:|-------:|---------------:|--------------:|---------:|-------------:|------------:|-------:|----------------:|---------------:|----------:|-----------------:|----------------:|-----------:|-----------------:|----------------:|-----------:|--------------:|-------------:|--------:|\n| NotKnown |         0.916 |        0.918 |  60.705 |          0.916 |         0.918 |   60.705 |        0.975 |       0.970 | 51.870 |          0.809 |         0.804 |   60.140 |        1.000 |       0.852 | 13.569 |           0.704 |          0.704 |     2.605 |            0.704 |           0.704 |      1.841 |            0.704 |           0.704 |      1.711 |         0.916 |        0.918 |   26.312|\n\n\n\n### 10-Fold Cross Validation Carcinogenesis Benchmark Results\n```shell\npython examples/concept_learning_cv_evaluation.py --kb ./KGs/Carcinogenesis/carcinogenesis.owl --lps ./LPs/Carcinogenesis/lps.json --path_of_nces_embeddings ./NCESData/carcinogenesis/embeddings/ConEx_entity_embeddings.csv --path_of_clip_embeddings ./CLIPData/carcinogenesis/embeddings/ConEx_entity_embeddings.csv --max_runtime 60 --report carcinogenesis_results.csv \n```\n\n| LP       | Train-F1-OCEL | Test-F1-OCEL | RT-OCEL | Train-F1-CELOE | Test-F1-CELOE | RT-CELOE | Train-F1-Evo | Test-F1-Evo | RT-Evo | Train-F1-DRILL | Test-F1-DRILL | RT-DRILL | Train-F1-TDL | Test-F1-TDL | RT-TDL |   Train-F1-NCES |   Test-F1-NCES |   RT-NCES |   Train-F1-NCES2 |   Test-F1-NCES2 |   RT-NCES2 |   Train-F1-ROCES |   Test-F1-ROCES |   RT-ROCES | Train-F1-CLIP | Test-F1-CLIP | RT-CLIP |\n|:---------|--------------:|-------------:|--------:|---------------:|--------------:|---------:|-------------:|------------:|-------:|---------------:|--------------:|---------:|-------------:|------------:|-------:|----------------:|---------------:|----------:|-----------------:|----------------:|-----------:|-----------------:|----------------:|-----------:|--------------:|-------------:|--------:|\n| NOTKNOWN |         0.737 |        0.711 |  62.048 |          0.740 |         0.701 |   62.048 |        0.822 |       0.628 | 64.508 |          0.740 |         0.707 |   60.120 |        1.000 |       0.616 |  5.196 |           0.709 |          0.709 |     2.718 |            0.705 |           0.704 |      1.912 |            0.705 |           0.704 |      1.774 |        0.740 |        0.701 |   48.475|\n\n\n### Benchmark Results on DBpedia. Results are based on the training examples only\n\n```shell\npython examples/owl_class_expression_learning_dbpedia.py --model Drill \u0026\u0026 python examples/owl_class_expression_learning_dbpedia.py --model TDL \n```\n|           LP-Type         | Train-F1-Drill |   RT-Drill   |  Train-F1-TDL  |     RT-TDL    |\n|:--------------------------|---------------:|-------------:|---------------:|--------------:|\n|  OWLObjectAllValuesFrom   |          0.438 |  240.331     |          1.000 |       206.288 |\n|  OWLObjectIntersectionOf  |          0.213 |  202.558     |          0.717 |        91.660 |\n|  OWLObjectUnionOf         |          0.546 |  187.144     |          0.967 |       129.700 |\n\n\u003c/details\u003e\n\n## Development\n\n\n\u003cdetails\u003e \u003csummary\u003e To see the results \u003c/summary\u003e\n\nCreating a feature branch **refactoring** from development branch\n\n```shell\ngit branch refactoring develop\n```\n\nEach feature branch must be merged to develop branch. To this end, the tests must run without a problem:\n```shell\n# To download knowledge graphs\nwget https://files.dice-research.org/projects/Ontolearn/KGs.zip -O ./KGs.zip \u0026\u0026 unzip KGs.zip\n# To download learning problems\nwget https://files.dice-research.org/projects/Ontolearn/LPs.zip -O ./LPs.zip \u0026\u0026 unzip LPs.zip\n# Download weights for some model for few tests\nwget https://files.dice-research.org/projects/NCES/NCES_Ontolearn_Data/NCESData.zip -O ./NCESData.zip \u0026\u0026 unzip NCESData.zip \u0026\u0026 rm NCESData.zip\nwget https://files.dice-research.org/projects/Ontolearn/CLIP/CLIPData.zip \u0026\u0026 unzip CLIPData.zip \u0026\u0026 rm CLIPData.zip \npytest -p no:warnings -x # Running 76 tests takes ~ 17 mins\n```\n\n\n\n\u003c/details\u003e\n\n## References\nCurrently, we are working on our manuscript describing our framework. \nIf you find our work useful in your research, please consider citing the respective paper:\n```\n# Ontolearn\n@article{demir2025ontolearn,\n  title={Ontolearn---A Framework for Large-scale OWL Class Expression Learning in Python},\n  author={Demir, Caglar and Baci, Alkid and Kouagou, N'Dah Jean and Sieger, Leonie Nora and Heindorf, Stefan and Bin, Simon and Bl{\\\"u}baum, Lukas and Bigerl, Alexander and Ngomo, Axel-Cyrille Ngonga},\n  journal={Journal of Machine Learning Research},\n  volume={26},\n  number={63},\n  pages={1--6},\n  year={2025}\n}\n\n# ROCES\n@inproceedings{kouagou2024roces,\n  title     = {ROCES: Robust Class Expression Synthesis in Description Logics via Iterative Sampling},\n  author    = {Kouagou, N'Dah Jean and Heindorf, Stefan and Demir, Caglar and Ngonga Ngomo, Axel-Cyrille},\n  booktitle = {Proceedings of the Thirty-Third International Joint Conference on\n               Artificial Intelligence, {IJCAI-24}},\n  publisher = {International Joint Conferences on Artificial Intelligence Organization},\n  editor    = {Kate Larson},\n  pages     = {4335--4343},\n  year      = {2024},\n  month     = {8},\n  note      = {Main Track},\n  doi       = {10.24963/ijcai.2024/479},\n  url       = {https://doi.org/10.24963/ijcai.2024/479},\n}\n\n# DRILL\n@inproceedings{demir2023drill,\n  author = {Demir, Caglar and Ngomo, Axel-Cyrille Ngonga},\n  booktitle = {The 32nd International Joint Conference on Artificial Intelligence, IJCAI 2023},\n  title = {Neuro-Symbolic Class Expression Learning},\n  url = {https://www.ijcai.org/proceedings/2023/0403.pdf},\n year={2023}\n}\n\n# NCES2\n@inproceedings{kouagou2023nces2,\nauthor={Kouagou, N'Dah Jean and Heindorf, Stefan and Demir, Caglar and Ngonga Ngomo, Axel-Cyrille},\ntitle={Neural Class Expression Synthesis in ALCHIQ(D)},\nurl = {https://papers.dice-research.org/2023/ECML_NCES2/NCES2_public.pdf},\nbooktitle={Machine Learning and Knowledge Discovery in Databases},\nyear={2023},\npublisher={Springer Nature Switzerland},\naddress=\"Cham\"\n}\n\n# NCES\n@inproceedings{kouagou2023neural,\n  title={Neural class expression synthesis},\n  author={Kouagou, N’Dah Jean and Heindorf, Stefan and Demir, Caglar and Ngonga Ngomo, Axel-Cyrille},\n  booktitle={European Semantic Web Conference},\n  pages={209--226},\n  year={2023},\n  publisher={Springer Nature Switzerland}\n}\n\n# EvoLearner\n@inproceedings{heindorf2022evolearner,\n  title={Evolearner: Learning description logics with evolutionary algorithms},\n  author={Heindorf, Stefan and Bl{\\\"u}baum, Lukas and D{\\\"u}sterhus, Nick and Werner, Till and Golani, Varun Nandkumar and Demir, Caglar and Ngonga Ngomo, Axel-Cyrille},\n  booktitle={Proceedings of the ACM Web Conference 2022},\n  pages={818--828},\n  year={2022}\n}\n\n\n# CLIP\n@inproceedings{kouagou2022learning,\n  title={Learning Concept Lengths Accelerates Concept Learning in ALC},\n  author={Kouagou, N’Dah Jean and Heindorf, Stefan and Demir, Caglar and Ngonga Ngomo, Axel-Cyrille},\n  booktitle={European Semantic Web Conference},\n  pages={236--252},\n  year={2022},\n  publisher={Springer Nature Switzerland}\n}\n```\n\nIn case you have any question, please contact: ```caglar.demir@upb.de``` or ```caglardemir8@gmail.com```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdice-group%2Fontolearn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdice-group%2Fontolearn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdice-group%2Fontolearn/lists"}