Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Github Action added and str property added for few classes #6

Merged
merged 2 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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='caglardemir8@gmail.com',
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",
)
Loading