Metadata-Version: 2.1
Name: aucampia.rdflib-xtl
Version: 0.6.0
Summary: Extra tools for rdflib
Home-page: https://gitlab.com/aucampia/project/rdflib-xtl
License: CC0-1.0
Author: Iwan Aucamp
Author-email: aucampia@gmail.com
Requires-Python: >=3.7,<4.0
Classifier: License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Requires-Dist: PyYAML (>=5.4.1,<6.0.0)
Requires-Dist: click (>=8.0.1,<9.0.0)
Requires-Dist: click-option-group (>=0.5.3,<0.6.0)
Requires-Dist: owlrl (>=5.2.1,<6.0.0)
Requires-Dist: pyparsing (>=2.0.0,<3.0.0)
Requires-Dist: pyyaml (>=5.3.1,<6.0.0)
Requires-Dist: rdflib (>=5.0.0,<6.0.0)
Requires-Dist: rdflib-jsonld (>=0.6.0,<0.7.0)
Requires-Dist: requests (>=2.26.0,<3.0.0)
Requires-Dist: typer (>=0.4.0,<0.5.0)
Description-Content-Type: text/markdown

# Extra command line tools for rdflib

This package provides some additional command line tools for rdflib:

* SPARQL Query execution with optional reasoning using [OWL-RL](https://github.com/RDFLib/OWL-RL):
    ```bash
    rdflib-xtl sparql --help
    ```
* OWL Reasoning using [OWL-RL](https://github.com/RDFLib/OWL-RL)
    ```bash
    rdflib-xtl reason --help
    ```

Usage examples:

```bash
# Install pipx
pip3 install --user --upgrade pipx

# (optionally) clear pipx cache if you want the latest version ...
\rm -vr ~/.local/pipx/.cache/

# check version
pipx run --spec aucampia.rdflib-xtl rdflib-xtl --version

# Run SPARQL without reasoning ...
pipx run --spec aucampia.rdflib-xtl \
  rdflib-xtl sparql \
  -q 'SELECT * WHERE { ?s rdfs:subClassOf owl:Thing. }' \
  http://xmlns.com/foaf/spec/index.rdf

# Dump input graph with SPARQL query ...
pipx run --spec aucampia.rdflib-xtl \
  rdflib-xtl sparql \
  -q 'CONSTRUCT { ?s ?p ?o } WHERE { ?s ?p ?o }' \
  http://xmlns.com/foaf/spec/index.rdf

# Run SPARQL with reasoning ...
pipx run --spec aucampia.rdflib-xtl \
  rdflib-xtl sparql --reason \
  -q 'SELECT * WHERE { ?s rdfs:subClassOf owl:Thing. }' \
  http://xmlns.com/foaf/spec/index.rdf

# Dump reasoned graph with SPARQL query ...
pipx run --spec aucampia.rdflib-xtl \
  rdflib-xtl sparql --reason \
  -q 'CONSTRUCT { ?s ?p ?o } WHERE { ?s ?p ?o }' \
  http://xmlns.com/foaf/spec/index.rdf

# Run reasoning ...
pipx run --spec aucampia.rdflib-xtl \
  rdflib-xtl reason http://xmlns.com/foaf/spec/index.rdf
```

