Skip to content

Commit

Permalink
Merge pull request #13 from hsolbrig/Issue_12
Browse files Browse the repository at this point in the history
Issue 12
  • Loading branch information
hsolbrig authored Dec 4, 2020
2 parents 5514f5a + 2d975ea commit 546e564
Show file tree
Hide file tree
Showing 14 changed files with 294 additions and 128 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build

on:
push:
branches: [ master ]

jobs:
update-requirements:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.8
- uses: dschep/install-pipenv-action@v1
- name: Update requirements
run: |
python -m pip install --upgrade pip
pip install pipenv-to-requirements
pipenv lock
git add Pipfile.lock
pipenv_to_requirements
git add requirements*.txt
if [[ -n $(git status -s requirements*.txt Pipfile.lock) ]]
then
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -m 'Automatically generated requirements and Pipfile.lock' requirements*.txt Pipfile.lock
git push
fi
test:
needs: update-requirements
name: Run TOX tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.7, 3.8, 3.9 ]

steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Run TOX
run: |
pip install tox
tox -e py
30 changes: 30 additions & 0 deletions .github/workflows/pypi-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Publish Python Package

on:
release:
types: [created]

jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install wheel
- name: build a binary wheel dist
run: |
rm -fr dist
python setup.py bdist_wheel sdist
- name: Publish distribution 📦 to PyPI
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.pypi_password }}
32 changes: 32 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,38 @@
CHANGES
=======

* Update test cases to reflect rdflib 5.0 differences
* Fix issue 12
* bit 'o cleanup'
* Major checkpoint -- refactored typing system
* Milestone -- passes all unit tests
* 12 failures, 7 skips out of 482 tests
* 38 failures and 7 skips out of 446 total tests
* Checkpoint
* Checkpoin t
* Update test harness to use the relative file names
* Revisit the test generation strategy
* Passes 411 out of 478 Tests
* Passing 315 out of 481 tests
* Test suite error
* Test suite error
* Fixed Test suite error
* Fix Test Suite Error
* Adding XML representations as a double check
* Checkpoint on test suite
* Test case error
* Test Case Error
* Test case error
* Further RDF progress
* Implement DataMinCardinality, DataPropertyRange, DataOneOf
* Ad-hoc fix for owl:Thing a owl:Class declaration
* Add DataSomeValuesFrom
* Add Bnode2somevaluesfrom to list of contested unit tests
* Tweaks to DataAllValuesFrom
* Implemented to\_rdf for DisjointClasses, DataAllValuesFrom and DisjointDataProperties
* Added \_\_str\_\_ method to ontology document to simplify serialization
* Release version 0.1.4

v0.1.4
------

Expand Down
6 changes: 3 additions & 3 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]
requests = "*"

[packages]
rdflib = ">=4.2.2"
pyjsg = ">=0.9.1"
rdflib = ">=5.0.0"
pyjsg = ">=0.11.6"
rfc3987 = "*"
bcp47 = "*"
coverage = "*"
140 changes: 53 additions & 87 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
![Owl in a bucket](images/owlinbucket.jpg)

[![Pyversions](https://img.shields.io/pypi/pyversions/funowl.svg)](https://pypi.python.org/pypi/funowl)

[![PyPi](https://img.shields.io/pypi/v/funowl.svg)](https://pypi.python.org/pypi/funowl)
![Build](https://github.com/hsolbrig/funowl/workflows/Build/badge.svg)
![Publish](https://github.com/hsolbrig/funowl/workflows/Publish%20Python%20Package/badge.svg)


# FunOwl - Functional OWL syntax for Python
[OWL2 Functional Style Syntax](https://www.w3.org/TR/owl2-syntax/) for python.
Expand Down Expand Up @@ -127,4 +129,4 @@ it creates an ontology-oriented programming API for ontologies, while what we wa
We have also recently discovered
* The `rdflib` [infixowl](https://rdflib.readthedocs.io/en/stable/apidocs/rdflib.extras.html#module-rdflib.extras.infixowl)
actually comes closer to what we've been trying to accomplish and, had we known of its existence before we got started, we
may have chosen to build on it instead of starting from scratch.
may have chosen to build on it instead of starting from scratch.
4 changes: 2 additions & 2 deletions funowl/class_expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def to_rdf(self, g: Graph, emit_type_arc: bool = False) -> BNode:
g.add((x, RDF.type, OWL.Restriction))
g.add((x, OWL.onProperty, self.objectPropertyExpression.to_rdf(g)))
if self.classExpression:
g.add((x, OWL.qualifiedCardinality, self.min_.to_rdf(g)))
g.add((x, OWL.qualifiedCardinality, self.card.to_rdf(g)))
g.add((x, OWL.onClass, self.classExpression.to_rdf(g)))
else:

Expand Down Expand Up @@ -482,4 +482,4 @@ def to_rdf(self, g: Graph, emit_type_arc: bool = False) -> BNode:
proc_forwards(ObjectUnionOf, globals())
proc_forwards(ObjectComplementOf, globals())
proc_forwards(ObjectSomeValuesFrom, globals())
proc_forwards(ObjectAllValuesFrom, globals())
proc_forwards(ObjectAllValuesFrom, globals())
6 changes: 3 additions & 3 deletions funowl/general_definitions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
nonNegativeInteger := a nonempty finite sequence of digits between 0 and 9
quotedString := a finite sequence of characters in which " (U+22) and \ (U+5C) occur only in pairs of the form \" (U+5C, U+22) and \\ (U+5C, U+5C), enclosed in a pair of " (U+22) characters
quotedString := a finite sequence of characters in which " (U+22) and \\ (U+5C) occur only in pairs of the form \\" (U+5C, U+22) and \\ (U+5C, U+5C), enclosed in a pair of " (U+22) characters
languageTag := @ (U+40) followed a nonempty sequence of characters matching the langtag production from [BCP 47]
nodeID := a finite sequence of characters matching the BLANK_NODE_LABEL production of [SPARQL]
Expand Down Expand Up @@ -42,8 +42,8 @@ def to_rdf(self, g: Graph, emit_type_arc: bool = False) -> Literal:


class QuotedString(QUOTED_STRING, FunOwlRoot):
""" finite sequence of characters in which " (U+22) and \ (U+5C) occur only in pairs of the form
\" (U+5C, U+22) and \\ (U+5C, U+5C), enclosed in a pair of " (U+22) characters
""" finite sequence of characters in which " (U+22) and \\ (U+5C) occur only in pairs of the form
"\\ (U+5C, U+22) and \\ (U+5C, U+5C), enclosed in a pair of " (U+22) characters
"""
def to_functional(self, w: FunctionalWriter) -> FunctionalWriter:
return w + ('"' + self.replace('\\', '\\\\').replace('"', '\\"') + '"')
Expand Down
13 changes: 13 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
################################################################################
# This requirements file has been automatically generated from `Pipfile` with
# `pipenv-to-requirements`
#
#
# This has been done to maintain backward compatibility with tools and services
# that do not support `Pipfile` yet.
#
# Do NOT edit it directly, use `pipenv install [-d]` to modify `Pipfile` and
# `Pipfile.lock` and then regenerate `requirements*.txt`.
################################################################################

requests
Loading

0 comments on commit 546e564

Please sign in to comment.