Skip to content

Commit

Permalink
updated doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Aklakan committed Sep 17, 2024
1 parent 1cf649d commit 1eef3dd
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 32 deletions.
30 changes: 0 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,36 +32,6 @@ rpt ngs wc file.trig
./produce-graphs.sh | ngs head -n 3
```

## Canned Queries
RPT ships with several useful queries on its classpath. Classpath resources can be printed out using `cpcat`. The following snippet shows examples of invocations and their output:

### Overview
```bash
$ rpt cpcat spo.rq
CONSTRUCT WHERE { ?s ?p ?o }

$ rpt cpcat gspo.rq
CONSTRUCT WHERE { GRAPH ?g { ?s ?p ?o } }
```
Any resource (query or data) on the classpath can be used as an argument to the `integrate` command:
```
rpt integrate yourdata.nt spo.rq
# When spo.rq is executed then the data is queried and printed out on STDOUT
```
### Reference
The exact definitions can be viewed with `rpt cpcat resource.rq`.
* `spo.rq`: Output triples from the default graph
* `gspo.rq`: Output quads from the named graphs
* `tree.rq`: Deterministically replaces all intermediate nodes with blank nodes. Intermediate nodes are those that appear both as subject and as objects. Useful in conjunction with `--out-format turtle/pretty` for formatting e.g. RML.
* `gtree.rq`: Named graph version of `tree.rq`
* `rename.rq`: Replaces all occurrences of an IRI in subject and object positions with a different one. Usage (using environment variables): `FROM='urn:from' TO='urn:to' rpt integrate data.nt rename.rq`
* `count.rq`: Return the sum of the counts of triples in the default graph and quads in the named graphs.
* `s.rq`: List the distinct subjects in the default graph

## Example Use Cases

Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ layout: default

You can download RPT as self-contained Debian or RPM packages from [RPT's GitHub release page](https://github.com/SmartDataAnalytics/RdfProcessingToolkit/releases).

Note, that for running the JAR bundle with the `java` command yourself you need to add the appropriate `--add-opens` declarations. This is documented on the [Building from Source](getting-started/build.html) page.
Note, that for running the JAR bundle with the `java` command yourself you need to add the appropriate `--add-opens` [JVM Options](build.html#jvm-options) page.

### Docker

Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ RPT is Java tool which comes with debian and rpm packaging. It is invoked using
* [ngs](named-graph-streams): Processor for named graph streams (ngs) which enables processing for collections of named graphs in streaming fashion. Process huge datasets without running into memory issues.
* [sbs](sparql-binding-streams): Processor for SPARQL binding streams (sbs) which enables processing of SPARQL result sets in streaming fashion. Most prominently for use in aggregating the output of a `ngs map` operation.
* [rmltk](https://github.com/Scaseco/r2rml-api-jena/tree/jena-5.0.0#usage-of-the-cli-tool): These are the (sub-)commands of our (R2)RML toolkit. The full documentation is available [here](https://github.com/SmartDataAnalytics/r2rml-api-jena).
* sansa: These are the (sub-)commands of our Semantic Analysis Stack (Stack) - a Big Data RDF Processing Framework. Features parallel execution of RML/SPARQL and TARQL (if the involved sources support it).
* [sansa]: These are the (sub-)commands of our Semantic Analysis Stack (Stack) - a Big Data RDF Processing Framework. Features parallel execution of RML/SPARQL and TARQL (if the involved sources support it).


**Check this [documentation](doc) for the supported SPARQL extensions with many examples**
Expand Down
39 changes: 39 additions & 0 deletions docs/integrate/canned-queries.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
title: Canned Queries
parent: RDF/SPARQL Processing
nav_order: 10
layout: default
---

## Canned Queries
RPT ships with several useful queries on its classpath. Classpath resources can be printed out using `cpcat`. The following snippet shows examples of invocations and their output:

### Overview
```bash
$ rpt cpcat spo.rq
CONSTRUCT WHERE { ?s ?p ?o }

$ rpt cpcat gspo.rq
CONSTRUCT WHERE { GRAPH ?g { ?s ?p ?o } }
```
Any resource (query or data) on the classpath can be used as an argument to the `integrate` command:
```
rpt integrate yourdata.nt spo.rq
# When spo.rq is executed then the data is queried and printed out on STDOUT
```
### Reference
The exact definitions can be viewed with `rpt cpcat resource.rq`.
* `spo.rq`: Output triples from the default graph.
* `gspo.rq`: Output quads from the named graphs.
* `spogspo.rq`: Output all triples followed by all quads.
* `tree.rq`: Deterministically replaces all intermediate nodes with blank nodes. Intermediate nodes are those that appear both as subject and as objects. Useful in conjunction with `--out-format turtle/pretty` for formatting e.g. RML.
* `gtree.rq`: Named graph version of `tree.rq`.
* `rename.rq`: Replaces all occurrences of an IRI in subject and object positions with a different one. Usage (using environment variables): `FROM='urn:from' TO='urn:to' rpt integrate data.nt rename.rq`
* `count.rq`: Return the sum of the counts of triples in the default graph and quads in the named graphs.
* `s.rq`: List the distinct subjects in the default graph.

0 comments on commit 1eef3dd

Please sign in to comment.