Skip to content

Commit

Permalink
Merge pull request #6 from dice-group/versioning
Browse files Browse the repository at this point in the history
Github Action added and str property added for few classes
  • Loading branch information
Demirrr authored Mar 28, 2024
2 parents 969e0db + fdfc143 commit fc0830c
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 33 deletions.
53 changes: 24 additions & 29 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
#name: Python package
#
#on: [push,pull_request]
#
#jobs:
# build:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# python-version: ["3.9"]
# max-parallel: 5
# steps:
# - uses: actions/checkout@v3
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}
#
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install -r requirements.txt
#
# - name: Test with pytest
# run: |
# pip install pytest
# wget https://files.dice-research.org/projects/Ontolearn/KGs.zip
# unzip KGs.zip
# pytest -p no:warnings -x
name: Python package

on: [push,pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10.13"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
- name: Test with pytest
run: |
python -m pytest -p no:warnings -x
7 changes: 7 additions & 0 deletions owlapy/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,9 @@ def get_nnf(self) -> 'OWLClass':
# documented in parent
return self

@property
def str(self):
return self.get_iri().as_str()

class OWLPropertyExpression(OWLObject, metaclass=ABCMeta):
"""Represents a property or possibly the inverse of a property."""
Expand Down Expand Up @@ -408,6 +411,10 @@ def is_owl_top_object_property(self) -> bool:
# documented in parent
return self.get_iri() == OWLRDFVocabulary.OWL_TOP_OBJECT_PROPERTY.get_iri()

@property
def str(self)->str:
return self.get_iri().as_str()


class OWLObjectInverseOf(OWLObjectPropertyExpression):
"""Represents the inverse of a property expression (ObjectInverseOf). This can be used to refer to the inverse of
Expand Down
10 changes: 10 additions & 0 deletions owlapy/model/_iri.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,21 @@ def as_iri(self) -> 'IRI':

def as_str(self) -> str:
"""
CD: Should be deprecated.
Returns:
The string that specifies the IRI.
"""
return self._namespace + self._remainder

@property
def str(self) -> str:
"""
Returns:
The string that specifies the IRI.
"""
return self.as_str()

def get_short_form(self) -> str:
"""Gets the short form.
Expand Down
9 changes: 5 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@
install_requires=[
"pandas>=1.5.0",
"rdflib>=6.0.2",
"parsimonious>=0.8.1"],
author='Ontolearn Team',
"parsimonious>=0.8.1",
"pytest>=8.1.1"],
author='Caglar Demir',
author_email='[email protected]',
url='https://github.com/dice-group/owlapy',
classifiers=[
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.10",
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
"Topic :: Scientific/Engineering"],
python_requires='>=3.8',
python_requires='>=3.10',
long_description=long_description,
long_description_content_type="text/markdown",
)

0 comments on commit fc0830c

Please sign in to comment.