Skip to content

Commit

Permalink
Merge pull request #3 from regro-cf-autotick-bot/6.0.2_h3c4921
Browse files Browse the repository at this point in the history
owlrl v6.0.2
  • Loading branch information
bollwyvl authored Dec 14, 2021
2 parents a12179e + b53f6c6 commit 4501398
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .ci_support/linux_64_.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cdt_name:
- cos6
channel_sources:
- conda-forge,defaults
- conda-forge
channel_targets:
- conda-forge main
docker_image:
Expand Down
108 changes: 104 additions & 4 deletions recipe/0001-remove-scripts.patch
Original file line number Diff line number Diff line change
@@ -1,11 +1,111 @@
--- setup.py 2021-09-13 06:59:58.000000000 -0500
+++ setup.py 2021-09-15 08:44:10.840642958 -0500
@@ -35,7 +35,7 @@
diff --git a/scripts/owlrl b/scripts/owlrl
index 7cebef3..6399ada 100755
--- a/scripts/owlrl
+++ b/scripts/owlrl
@@ -2,29 +2,35 @@

import os
from optparse import OptionParser
-from owlrl import convert_graph, RDFXML, TURTLE, JSON, AUTO, RDFA
+from owlrl import convert_graph
+
+RDFXML = "xml"
+TURTLE = "turtle"
+JSON = "json"
+AUTO = "auto"
+RDFA = "rdfa"


def main():
parser = OptionParser(usage="%prog [options] fname1 fname2 ...")
parser.disable_interspersed_args()
-
+
# The 'text' field is not used in the command line, but the CGI environment uses it. This means that there
# is no option to change that, but is added to the final option structure
parser.set_defaults(format=TURTLE, owlClosure="no", rdfsClosure="no", owlExtras="no", axioms="no", daxioms="no",
iformat=AUTO, trimming="no", maximal="no", text=None)
-
+
parser.add_option("-f", "--file", type="string", dest="source",
help="input file; should be a .rdf or .ttl file, for RDF/XML or Turtle, respectively. If "
"missing, or if the value is '-' then standard input is used. Usage of this options is not "
"really necessary, the fname in the command lines refer to files by themselves")
-
+
parser.add_option("--owlrl", action="store", dest="owlClosure", choices=["yes", "no"],
help="execute OWL RL closure; argument must be yes|no [default: %default]")
-
+
parser.add_option("-w", action="store_const", dest="owlClosure", const="yes",
help="OWL-RL is executed; shorthand for --owlrl=yes")
-
+
parser.add_option("--rdfs", action="store", dest="rdfsClosure", choices=["yes", "no"],
help="execute RDFS closure; argument must be yes|no [default: %default]")

@@ -39,13 +45,13 @@ def main():

parser.add_option("--axioms", action="store", dest="axioms", choices=["yes", "no"],
help="axiomatic triples; argument must be yes|no [default: %default]")
-
+
parser.add_option("-a", action="store_const", dest="axioms", const="yes",
help="add axiomatic triples; shorthand for --axioms=yes [default: %default]")

parser.add_option("--daxioms", action="store", dest="daxioms", choices=["yes", "no"],
help="datatype axiomatic triples; argument must be true|false [default: %default]")
-
+
parser.add_option("-d", action="store_const", dest="daxioms", const="yes",
help="add axiomatic triples; shorthand for --daxioms=yes [default: %default]")

@@ -59,11 +65,11 @@ def main():
parser.add_option("-t", action="store_const", dest="trimming", const="yes",
help="trim the output of OWL 2 RL and extension; shorthand for --trimming=yes "
"[default: %default]")
-
+
parser.add_option("-o", "-s", "--serialization", "--syntax", action="store", dest="format",
choices=[TURTLE, JSON, RDFXML],
help="output format; argument must be turtle|json|xml [default: %default]")
-
+
parser.add_option("-i", "--input_syntax", action="store", dest="iformat",
choices=[AUTO, TURTLE, JSON, RDFA, RDFXML],
help="format of input; argument must be auto|turtle|xml|rdfa|json [default: %default]; auto "
@@ -74,10 +80,10 @@ def main():
options.sources = []
else:
options.sources = [options.source]
-
+
if len(args) > 0:
options.sources += args
-
+
if len(options.sources) == 0:
# the default mechanism, ie, to use standard input
options.sources = ["-"]
@@ -86,7 +92,7 @@ def main():
options.trimming = "yes"
options.owlClosure = "yes"
options.owlExtras = "yes"
-
+
print(convert_graph(options).decode('utf-8'))


diff --git a/setup.py b/setup.py
index 268dcc0..fde610b 100755
--- a/setup.py
+++ b/setup.py
@@ -35,7 +35,7 @@ with open_local(["requirements.txt"]) as req:
setup(
name="owlrl",
packages=["owlrl"],
- scripts=["scripts/owlrl", "scripts/RDFConvertService"],
+ entry_points={"console_scripts": ["owlrl = owlrl._cli:main"]},
+ entry_points={"console_scripts": ["owlrl=owlrl.cli:main"]},
package_dir={"owlrl": "./owlrl"},
version=version,
description="OWL-RL and RDFS based RDF Closure inferencing for Python",
6 changes: 3 additions & 3 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{% set version = "5.2.3" %}
{% set version = "6.0.2" %}

package:
name: owlrl
version: {{ version }}

source:
url: https://pypi.io/packages/source/o/owlrl/owlrl-{{ version }}.tar.gz
sha256: b1891d75b2c2fb0db9e1504a9b12dab738ed89236414c51393d1030597004342
sha256: 904e3310ff4df15101475776693d2427d1f8244ee9a6a9f9e13c3c57fae90b74
patches:
- 0001-remove-scripts.patch

Expand All @@ -33,7 +33,7 @@ test:
- owlrl
commands:
- owlrl --help
- cd test && pytest --cov=owlrl -k "not dt_not_type and not maxqc1" -vv --cov-report term-missing:skip-covered --cov-fail-under 54
- cd test && pytest --cov=owlrl -k "not dt_not_type and not maxqc1" -vv --cov-report term-missing:skip-covered --cov-fail-under 49

about:
home: https://github.com/RDFLib/OWL-RL
Expand Down

0 comments on commit 4501398

Please sign in to comment.