From b07f21fc5e899b2735454a9edaac0ab61e53659a Mon Sep 17 00:00:00 2001 From: Caglar Demir Date: Tue, 9 Apr 2024 20:01:04 +0200 Subject: [PATCH] owl class module created --- .../__init__.py} | 11 ++++++----- owlapy/model/__init__.py | 2 +- owlapy/parser.py | 2 +- owlapy/render.py | 3 ++- owlapy/util.py | 2 +- tests/test_owlapy_nnf.py | 2 +- tests/test_owlapy_parser.py | 2 +- tests/test_owlapy_render.py | 2 +- 8 files changed, 14 insertions(+), 12 deletions(-) rename owlapy/{owl_class_expression.py => data_ranges/__init__.py} (91%) diff --git a/owlapy/owl_class_expression.py b/owlapy/data_ranges/__init__.py similarity index 91% rename from owlapy/owl_class_expression.py rename to owlapy/data_ranges/__init__.py index 3cc02b4e..b745e0c8 100644 --- a/owlapy/owl_class_expression.py +++ b/owlapy/data_ranges/__init__.py @@ -1,11 +1,12 @@ from abc import abstractmethod, ABCMeta -from .owlobject import OWLObject, OWLEntity -from .meta_classes import HasOperands +from ..owlobject import OWLObject, OWLEntity +from ..meta_classes import HasOperands from typing import Final, Iterable, Sequence -from .ranges import OWLPropertyRange, OWLDataRange -from .owl_literal import OWLLiteral +from ..ranges import OWLPropertyRange, OWLDataRange +from ..owl_literal import OWLLiteral from typing import Final, Sequence, Union, Iterable -from .iri import IRI +from ..iri import IRI + class OWLDataComplementOf(OWLDataRange): """Represents DataComplementOf in the OWL 2 Specification.""" type_index: Final = 4002 diff --git a/owlapy/model/__init__.py b/owlapy/model/__init__.py index 1b6db030..61b76192 100644 --- a/owlapy/model/__init__.py +++ b/owlapy/model/__init__.py @@ -13,7 +13,7 @@ OWLObjectUnionOf, OWLObjectComplementOf from owlapy.class_expression import OWLThing, OWLNothing, OWLClass -from owlapy.owl_class_expression import OWLPropertyRange, OWLDataRange +from owlapy.data_ranges import OWLPropertyRange, OWLDataRange from owlapy.owl_property import OWLObjectPropertyExpression, OWLProperty, OWLPropertyExpression, \ OWLDataPropertyExpression, OWLDataProperty, OWLObjectProperty diff --git a/owlapy/parser.py b/owlapy/parser.py index 7d771dab..8978fc5e 100644 --- a/owlapy/parser.py +++ b/owlapy/parser.py @@ -19,7 +19,7 @@ OWLLiteral, OWLDataRange, OWLDataOneOf, OWLDatatype, OWLObjectCardinalityRestriction, \ OWLDataCardinalityRestriction, OWLObjectAllValuesFrom, OWLDataAllValuesFrom, BooleanOWLDatatype -from owlapy.owl_class_expression import OWLDataIntersectionOf, OWLDataUnionOf, OWLDataComplementOf +from owlapy.data_ranges import OWLDataIntersectionOf, OWLDataUnionOf, OWLDataComplementOf from owlapy.owl_restriction import OWLObjectHasValue, OWLDatatypeRestriction, OWLFacetRestriction, OWLObjectOneOf diff --git a/owlapy/render.py b/owlapy/render.py index 2969d06f..ea463229 100644 --- a/owlapy/render.py +++ b/owlapy/render.py @@ -19,7 +19,8 @@ OWLDataHasValue, OWLDataOneOf, OWLDataMaxCardinality, \ OWLDataMinCardinality, OWLDataExactCardinality) from owlapy.vocab import OWLFacet -from .owl_class_expression import OWLNaryDataRange, OWLDataComplementOf, OWLDataUnionOf, OWLDataIntersectionOf + +from .data_ranges import OWLNaryDataRange, OWLDataComplementOf, OWLDataUnionOf, OWLDataIntersectionOf from .owl_restriction import OWLObjectHasValue, OWLFacetRestriction, OWLDatatypeRestriction, OWLObjectOneOf _DL_SYNTAX = types.SimpleNamespace( diff --git a/owlapy/util.py b/owlapy/util.py index 0fad5f48..8b0b25e1 100644 --- a/owlapy/util.py +++ b/owlapy/util.py @@ -11,7 +11,7 @@ OWLDatatype,OWLDataOneOf, OWLLiteral, OWLObjectIntersectionOf, \ OWLDataCardinalityRestriction, OWLNaryBooleanClassExpression, OWLObjectUnionOf, \ OWLDataRange, OWLObject -from .owl_class_expression import OWLDataComplementOf, OWLDataUnionOf, OWLDataIntersectionOf, OWLNaryDataRange +from .data_ranges import OWLDataComplementOf, OWLDataUnionOf, OWLDataIntersectionOf, OWLNaryDataRange from .owl_restriction import OWLObjectHasValue, OWLDatatypeRestriction, OWLFacetRestriction, OWLObjectOneOf _HasIRI = TypeVar('_HasIRI', bound=HasIRI) #: diff --git a/tests/test_owlapy_nnf.py b/tests/test_owlapy_nnf.py index 94535417..3e3d0a6b 100644 --- a/tests/test_owlapy_nnf.py +++ b/tests/test_owlapy_nnf.py @@ -32,7 +32,7 @@ from owlapy.model.providers import OWLDatatypeMinMaxExclusiveRestriction from owlapy.util import NNF -from owlapy.owl_class_expression import OWLDataComplementOf, OWLDataIntersectionOf, OWLDataUnionOf +from owlapy.data_ranges import OWLDataComplementOf, OWLDataIntersectionOf, OWLDataUnionOf from owlapy.owl_restriction import OWLObjectHasValue, OWLObjectOneOf def iri(suffix): diff --git a/tests/test_owlapy_parser.py b/tests/test_owlapy_parser.py index 6abcdce8..a16e0ccd 100644 --- a/tests/test_owlapy_parser.py +++ b/tests/test_owlapy_parser.py @@ -10,7 +10,7 @@ OWLObjectHasSelf, OWLObjectIntersectionOf, OWLObjectMaxCardinality, OWLObjectProperty, OWLDataExactCardinality, OWLDataMaxCardinality, \ OWLDataMinCardinality, OWLDataHasValue, OWLThing, OWLNothing -from owlapy.owl_class_expression import OWLDataIntersectionOf, OWLDataComplementOf, OWLDataUnionOf +from owlapy.data_ranges import OWLDataIntersectionOf, OWLDataComplementOf, OWLDataUnionOf from owlapy.model.providers import OWLDatatypeMinExclusiveRestriction,\ OWLDatatypeMinMaxExclusiveRestriction, OWLDatatypeMaxExclusiveRestriction from owlapy.owl_restriction import OWLDataSomeValuesFrom, OWLDatatypeRestriction, OWLFacetRestriction, OWLObjectSomeValuesFrom, OWLObjectMinCardinality, OWLObjectHasValue,OWLObjectOneOf diff --git a/tests/test_owlapy_render.py b/tests/test_owlapy_render.py index 7b2c5e4b..6dc5f0c4 100644 --- a/tests/test_owlapy_render.py +++ b/tests/test_owlapy_render.py @@ -6,7 +6,7 @@ OWLDataOneOf, OWLDataSomeValuesFrom, OWLLiteral, BooleanOWLDatatype, \ OWLDataMaxCardinality -from owlapy.owl_class_expression import OWLDataComplementOf, OWLDataIntersectionOf, OWLDataUnionOf +from owlapy.data_ranges import OWLDataComplementOf, OWLDataIntersectionOf, OWLDataUnionOf from owlapy.model.providers import OWLDatatypeMinMaxInclusiveRestriction from owlapy.render import DLSyntaxObjectRenderer, ManchesterOWLSyntaxOWLObjectRenderer from owlapy.owl_restriction import OWLObjectHasValue, OWLObjectOneOf