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

owlrl v6.0.2 #3

Merged
merged 3 commits into from Dec 14, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ci_support/linux_64_.yaml
@@ -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
@@ -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
@@ -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