ontouml-models-lib Python Library
Project description
OntoUML/UFO Catalog Python Library
- OntoUML/UFO Catalog Python Library
Overview
This Python library provides tools for manipulating and querying ontology models within the OntoUML/UFO framework. It is designed to work with concepts and models that adhere to the standards and practices outlined in the OntoUML/UFO Catalog. The library supports operations on models stored in machine-readable formats such as JSON and Turtle, and enables the execution of SPARQL queries on these models.
About the OntoUML/UFO Catalog
The FAIR Model Catalog for Ontology-Driven Conceptual Modeling Research, also known as OntoUML/UFO Catalog, is a structured and open-source repository containing a collection of OntoUML and UFO ontology models. The catalog is designed to support empirical research in OntoUML and UFO, as well as the broader field of conceptual modeling. It provides a diverse range of models created by modelers with varying expertise, covering multiple domains and purposes. These models are available in machine-readable formats such as JSON and Turtle, which facilitate automated processing and querying. Each model in the catalog is accessible via a permanent identifier, ensuring long-term availability and reference.
The catalog organizes its content into a well-defined structure, storing models and their metadata in linked data formats. This structure allows for the integration of the models into a knowledge graph, enabling advanced querying and analysis using SPARQL. The OntoUML/UFO Catalog is built to be collaborative and accessible, allowing users to contribute to and leverage a comprehensive resource for conceptual modeling research. For more details, please visit the official OntoUML/UFO Catalog repository: OntoUML/UFO Catalog.
Features
- Catalog Management: Load, manage, and query collections of ontology models.
- Model Interaction: Interact with individual ontology models, including querying and metadata management.
- SPARQL Query Execution: Execute SPARQL queries on RDF graphs representing ontology models.
- Metadata Handling: Support for metadata schemas used in the OntoUML/UFO Catalog, ensuring consistency and compliance with the catalog's structure.
Installation
To install the library, use pip:
pip install ontouml-models-lib
The Library's Classes
The Catalog
, Model
, and Query
classes are core components of the OntoUML/UFO Catalog Python library, designed to enable manipulation and querying of ontology models. The Catalog
class is used to manage collections of ontology models, allowing users to load, query, and interact with multiple models as a cohesive unit. The Model
class represents an individual ontology model, providing methods for querying its RDF graph and accessing metadata. The Query
class encapsulates SPARQL queries, enabling their execution on RDF graphs within the OntoUML/UFO framework.
These classes are essential when working with the OntoUML/UFO Catalog, which is a repository of high-quality, curated ontology models. Users can utilize the Catalog
class to manage entire collections of models, the Model
class to interact with individual models, and the Query
class to run specific queries on the data. This design ensures that users can efficiently organize, access, and analyze ontology models in a standardized way.
Examples
Example 1: Working with the Catalog Class
from ontouml_models_lib import Catalog
## Load a catalog from a specified path
catalog = Catalog('/path/to/catalog')
## List all models in the catalog
models = catalog.list_models()
print(models)
## Perform a query across all models in the catalog
query = Query('/path/to/query.sparql')
results = catalog.execute_query(query)
print(results)
Example 2: Working with the Model Class
from ontouml_models_lib import Model, Query
## Load an individual ontology model
model = Model('/path/to/ontology_model_folder')
## Print the title of the model
print(model.title)
## Execute a SPARQL query on the model
query = Query('/path/to/query.sparql')
results = model.execute_query(query)
print(results)
Example 3: Working with the Query Class
from ontouml_models_lib import Query
## Load a SPARQL query from a file
query = Query('/path/to/query.sparql')
## Access the query content
print(query.query_content)
## Compute the hash of the query (useful for caching results)
print(query.hash)
How to Contribute
We welcome and appreciate contributions from the community! Whether you want to report a bug, suggest a new feature, or improve our codebase, your input is valuable.
Reporting Issues
- If you find a bug or wish to suggest a feature, please open a new issue.
- If you notice any discrepancies in the documentation created with the aid of AI, feel free to report them by opening an issue.
Code Contributions
- Fork the project repository and create a new feature branch for your work:
git checkout -b feature/YourFeatureName
. - Make and commit your changes with descriptive commit messages.
- Push your work back up to your fork:
git push origin feature/YourFeatureName
. - Submit a pull request to propose merging your feature branch into the main project repository.
Test Contributions
- Enhance the project's reliability by adding new tests or improving existing ones.
General Guidelines
- Ensure your code follows our coding standards.
- Update the documentation as necessary.
- Make sure your contributions do not introduce new issues.
We appreciate your time and expertise in contributing to this project!
License
This library is licensed under the Creative Commons Attribution-ShareAlike 4.0 International Public License. Please note that the models included in the OntoUML/UFO Catalog may have their own licenses, as specified in their metadata.
Author
The ontouml-models-lib library is developed and maintained by:
Feel free to reach out using the provided links. For inquiries, contributions, or to report any issues, you can open a new issue on this repository.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ontouml_models_lib-1.0.0b4.tar.gz
.
File metadata
- Download URL: ontouml_models_lib-1.0.0b4.tar.gz
- Upload date:
- Size: 25.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.5 Windows/11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b417d294b7c955410c4cb1c164888e026a31e37373041767b8403744cb45297 |
|
MD5 | 2950d1262af9a6672f5bef14d84e98e9 |
|
BLAKE2b-256 | 81c581ae9e6da239a8b7d4dc9202c1fd3d0862c5c7291a1f2fcc68bae8b5217b |
File details
Details for the file ontouml_models_lib-1.0.0b4-py3-none-any.whl
.
File metadata
- Download URL: ontouml_models_lib-1.0.0b4-py3-none-any.whl
- Upload date:
- Size: 29.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.5 Windows/11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a6982dc1c6ac7d9e680bdd38e7ac263dddfddd0c7dcdde75056be3c00cbbe2a |
|
MD5 | f6cfc55d44c89474035df958b49fcf7e |
|
BLAKE2b-256 | 9575ad4af4642c0f04d7590a6b3ead022ce3bc53e98cf237c1e062b36dee31c8 |