Skip to main content

Ontosample is a package that offers different sampling techniques for OWL ontologies.

Project description

OntoSample

Downloads Downloads Pypi

OntoSample is a python package that offers classic sampling techniques for OWL ontologies/knowledge bases. Furthermore, we have tailored the classic sampling techniques to the setting of concept learning making use of learning problem.

Paper: Accelerating Concept Learning via Sampling

Installation

pip install ontosample

or

# 1. clone 
git clone https://github.com/dice-group/Ontolearn.git 
# 2. setup virtual environment
python -m venv venv 
# 3. activate the virtual environment
source venv/bin/activate # for Unix and macOS
.\venv\Scripts\activate  # for Windows
# 4. install dependencies
pip install -r requirements.txt

Usage

from ontolearn_light.knowledge_base import KnowledgeBase
from ontosample.classic_samplers import RandomNodeSampler

# 1. Initialize KnowledgeBase object using the path of the ontology
kb = KnowledgeBase(path="KGs/Family/family-benchmark_rich_background.owl")

# 2. Initialize the sampler and generate the sample
sampler = RandomNodeSampler(kb)
sampled_kb = sampler.sample(30)  # will generate a sample with 30 nodes

# 3. Save the sampled ontology
sampler.save_sample(kb=sampled_kb, filename='sampled_kb')

Check the examples folder for more.

Citing

@inproceedings{10.1145/3583780.3615158,
author = {Baci, Alkid and Heindorf, Stefan},
title = {Accelerating Concept Learning via Sampling},
year = {2023},
isbn = {9798400701245},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
url = {https://doi.org/10.1145/3583780.3615158},
doi = {10.1145/3583780.3615158},
abstract = {Node classification is an important task in many fields, e.g., predicting entity types in knowledge graphs, classifying papers in citation graphs, or classifying nodes in social networks. In many cases, it is crucial to explain why certain predictions are made. Towards this end, concept learning has been proposed as a means of interpretable node classification: given positive and negative examples in a knowledge base, concepts in description logics are learned that serve as classification models. However, state-of-the-art concept learners, including EvoLearner and CELOE exhibit long runtimes. In this paper, we propose to accelerate concept learning with graph sampling techniques. We experiment with seven techniques and tailor them to the setting of concept learning. In our experiments, we achieve a reduction in training size by over 90\% while maintaining a high predictive performance.},
booktitle = {Proceedings of the 32nd ACM International Conference on Information and Knowledge Management},
pages = {3733–3737},
numpages = {5},
keywords = {knowledge bases, concept learning, graph sampling},
location = {Birmingham, United Kingdom},
series = {CIKM '23}
}

In case of any question please feel free to open an issue.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ontosample-0.2.6.tar.gz (43.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ontosample-0.2.6-py3-none-any.whl (48.6 kB view details)

Uploaded Python 3

File details

Details for the file ontosample-0.2.6.tar.gz.

File metadata

  • Download URL: ontosample-0.2.6.tar.gz
  • Upload date:
  • Size: 43.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.5

File hashes

Hashes for ontosample-0.2.6.tar.gz
Algorithm Hash digest
SHA256 bf6a80dfb976b1390c2eae4f3d7b9c0c193beac868f8041204169deb3699af26
MD5 d220b45a56260177b13874c37b769ac3
BLAKE2b-256 1280f95d55ae2016caf93e8ec6607edd2a4a4614d1340bf55a2357070c71865a

See more details on using hashes here.

File details

Details for the file ontosample-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: ontosample-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 48.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.5

File hashes

Hashes for ontosample-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 ae8452f0d1d55e0608f3c0a78ea55344c03aa72505ab2cab1c6038d6f47604f2
MD5 1b6441ec8a7a5d584d4f4f161392dd19
BLAKE2b-256 b690d579385d6cbe15b41c0f1ffc79ac39b4e10bb4340bea03242484eabd3194

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page