Metadata-Version: 2.4
Name: django-ct-ontology
Version: 1.0.0
Summary: django-ct-ontology is a Django application for generating sematic tripples and graphs for content types and more.
Author-email: Amir Yousefi <admin@groupeffect.de>
Maintainer-email: Amir Yousefi <admin@groupeffect.de>
License-Expression: GPL-3.0
Project-URL: Changelog, https://github.com/groupeffect/django-ct-ontology/blob/main/CHANGELOG.rst
Project-URL: Repository, https://github.com/groupeffect/django-ct-ontology
Keywords: api,django,rest,database,ontology,semantic
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 6.0
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Typing :: Typed
Requires-Python: >=3.12
Description-Content-Type: text/x-rst
License-File: LICENSE
Requires-Dist: Django>=6
Requires-Dist: django-filter>=25
Requires-Dist: djangorestframework>=3.16
Requires-Dist: rdflib>=7.6
Dynamic: license-file

=====================
django-ct-ontology
=====================

A Django application for handling database content types with rdf ontology and more.

.. contents:: Table of Contents
   :depth: 2
   :local:


Requirements
============

- Python ≥ 3.12
- Django ≥ 6.0

Runtime dependencies (installed automatically):

- ``django-filter`` ≥ 25
- ``djangorestframework`` ≥ 3.16
- ``rdflib`` ≥ 7.6


Installation
============

Install from PyPI:

.. code-block:: bash

   pip install django-ct-ontology

Or via `uv <https://docs.astral.sh/uv/>`_:

.. code-block:: bash

   uv add django-ct-ontology


Configuration
=============

Add ``ontology`` to your ``INSTALLED_APPS`` in ``settings.py``:

.. code-block:: python

   INSTALLED_APPS = [
       ...
       'ontology',
   ]

To include the API endpoints, add the following to your project's ``urls.py``:

.. code-block:: python

   from django.urls import path, include

   urlpatterns = [
       ...
       path('api/', include('ontology.urls')),
   ]


Settings
========

The following settings can be configured in your ``settings.py``:

- ``ONTOLOGY_DISABLE_MODELS``: Set to ``True`` to disable loading the ontology database models and API routing. (Default: ``False``)
- ``ONTOLOGY_DISABLE_ADMIN``: Set to ``True`` to disable registering the models in the Django admin interface. (Default: ``False``)


API Endpoints
=============

When mounted at ``api/`` as shown above, the following endpoints are available:

- ``/api/ontology/predicate/``
- ``/api/ontology/subject/``
- ``/api/ontology/object/``
- ``/api/ontology/triple/``
- ``/api/ontology/domain/``
- ``/api/ontology/graph/``

These endpoints provide standard CRUD operations based on your authentication status.
