Skip to content
Permalink
Browse files
Replace master by main in source docs and tutorials
  • Loading branch information
kinow committed Feb 20, 2021
1 parent a1d9fc9 commit 30fd6af1990ed99e75b9becf830e9151ac08dab3
Show file tree
Hide file tree
Showing 25 changed files with 81 additions and 81 deletions.
@@ -3,9 +3,9 @@ title: CSV PropertyTable
slug: index
---

----
---
> This page covers the jena-csv module which has been retired.<br/>
> The last release of Jena with this module is Jena 3.9.0.<br/>
> See [jena-csv/README.md](https://github.com/apache/jena/tree/master/jena-csv).<br/>
> See [jena-csv/README.md](https://github.com/apache/jena/tree/main/jena-csv).<br/>
> The [original documentation](csv_index.html).
----
---
@@ -5,7 +5,7 @@ title: CSV PropertyTable
----
> This page covers the jena-csv module which has been retired.
> The last release of Jena with this module is Jena 3.9.0.
> See [jena-csv/README.md](https://github.com/apache/jena/tree/master/jena-csv).
> See [jena-csv/README.md](https://github.com/apache/jena/tree/main/jena-csv).
> This is the original documentation.
----
@@ -6,8 +6,8 @@ title: CSV PropertyTable - Design

The architecture of CSV PropertyTable mainly involves 2 components:

- [PropertyTable](https://github.com/apache/jena/tree/master/jena-csv/src/main/java/org/apache/jena/propertytable/PropertyTable.java)
- [GraphPropertyTable](https://github.com/apache/jena/tree/master/jena-csv/src/main/java/org/apache/jena/propertytable/impl/GraphPropertyTable.java)
- [PropertyTable](https://github.com/apache/jena/tree/main/jena-csv/src/main/java/org/apache/jena/propertytable/PropertyTable.java)
- [GraphPropertyTable](https://github.com/apache/jena/tree/main/jena-csv/src/main/java/org/apache/jena/propertytable/impl/GraphPropertyTable.java)

![Picture of architecture of jena-csv](jena-csv-architecture.png "Architecture of jena-csv")

@@ -23,9 +23,9 @@ With special storage, a PropertyTable
- can guarantee access orders

More explicitly, `PropertyTable` is designed to be a table of RDF terms, or
[Nodes](https://github.com/apache/jena/tree/master/jena-core/src/main/java/org/apache/jena/graph/Node.java) in Jena.
Each [Column](https://github.com/apache/jena/tree/master/jena-csv/src/main/java/org/apache/jena/propertytable/Column.java) of the `PropertyTable` has an unique columnKey `Node` of the predicate (or p for short).
Each [Row](https://github.com/apache/jena/tree/master/jena-csv/src/main/java/org/apache/jena/propertytable/Row.java) of the `PropertyTable` has an unique rowKey `Node` of the subject (or s for short).
[Nodes](https://github.com/apache/jena/tree/main/jena-core/src/main/java/org/apache/jena/graph/Node.java) in Jena.
Each [Column](https://github.com/apache/jena/tree/main/jena-csv/src/main/java/org/apache/jena/propertytable/Column.java) of the `PropertyTable` has an unique columnKey `Node` of the predicate (or p for short).
Each [Row](https://github.com/apache/jena/tree/main/jena-csv/src/main/java/org/apache/jena/propertytable/Row.java) of the `PropertyTable` has an unique rowKey `Node` of the subject (or s for short).
You can use `getColumn()` to get the `Column` by its columnKey `Node` of the predicate, while `getRow()` for `Row`.

A `PropertyTable` should be constructed in this workflow (in order):
@@ -38,8 +38,8 @@ Once a `PropertyTable` is built, tabular data within can be accessed by the API

## GraphPropertyTable

`GraphPropertyTable` implements the [Graph](https://github.com/apache/jena/tree/master/jena-core/src/main/java/org/apache/jena/graph/Graph.java) interface (read-only) over a `PropertyTable`.
This is subclass from [GraphBase](https://github.com/apache/jena/tree/master/jena-core/src/main/java/org/apache/jena/graph/impl/GraphBase.java) and implements `find()`.
`GraphPropertyTable` implements the [Graph](https://github.com/apache/jena/tree/main/jena-core/src/main/java/org/apache/jena/graph/Graph.java) interface (read-only) over a `PropertyTable`.
This is subclass from [GraphBase](https://github.com/apache/jena/tree/main/jena-core/src/main/java/org/apache/jena/graph/impl/GraphBase.java) and implements `find()`.
The `graphBaseFind()`(for matching a `Triple`) and `propertyTableBaseFind()`(for matching a whole `Row`) methods can choose the access route based on the find arguments.
`GraphPropertyTable` holds/wraps a reference of the `PropertyTable` instance, so that such a `Graph` can be treated in a more table-like fashion.

@@ -48,7 +48,7 @@ They are supposed to be compatible with any table-like data sources, such as rel

## GraphCSV

[GraphCSV](https://github.com/apache/jena/tree/master/jena-csv/src/main/java/org/apache/jena/propertytable/impl/GraphCSV.java) is a sub class of GraphPropertyTable aiming at CSV data.
[GraphCSV](https://github.com/apache/jena/tree/main/jena-csv/src/main/java/org/apache/jena/propertytable/impl/GraphCSV.java) is a sub class of GraphPropertyTable aiming at CSV data.
Its constructor takes a CSV file path as the parameter, parse the file using a CSV Parser, and makes a `PropertyTable` through `PropertyTableBuilder`.

For CSV to RDF mapping, we establish some basic principles:
@@ -26,7 +26,7 @@ Once registered, CSV PropertyTable provides 2 ways for the users to play with (i

### GraphCSV

[GraphCSV](https://github.com/apache/jena/tree/master/jena-csv/src/main/java/org/apache/jena/propertytable/graph/GraphCSV.java) wrappers a CSV file as a Graph, which makes a Model for SPARQL query:
[GraphCSV](https://github.com/apache/jena/tree/main/jena-csv/src/main/java/org/apache/jena/propertytable/graph/GraphCSV.java) wrappers a CSV file as a Graph, which makes a Model for SPARQL query:

Model model = ModelFactory.createModelForGraph(new GraphCSV("data.csv")) ;
QueryExecution qExec = QueryExecutionFactory.create(query, model) ;
@@ -42,7 +42,7 @@ or for multiple CSV files and/or other RDF data:
dataset.addNamedModel("http://example/other", other) ;
... normal SPARQL execution ...

You can also find the full examples from [GraphCSVTest](https://github.com/apache/jena/tree/master/jena-csv/src/test/java/org/apache/jena/propertytable/graph/GraphCSVTest.java).
You can also find the full examples from [GraphCSVTest](https://github.com/apache/jena/tree/main/jena-csv/src/test/java/org/apache/jena/propertytable/graph/GraphCSVTest.java).

In short, for Jena ARQ, a CSV table is actually a Graph (i.e. GraphCSV), without any differences from other types of Graphs when using it from the Jena ARQ API.

@@ -64,7 +64,7 @@ Note that, the requirements for the CSV files are listed in the documentation of

## Command Line Tool

[csv2rdf](https://github.com/apache/jena/tree/master/jena-csv/src/main/java/riotcmd/csv2rdf.java) is a tool for direct transforming from CSV to the formatted RDF syntax of N-Triples.
[csv2rdf](https://github.com/apache/jena/tree/main/jena-csv/src/main/java/riotcmd/csv2rdf.java) is a tool for direct transforming from CSV to the formatted RDF syntax of N-Triples.
The script calls the `csv2rdf` java program in the `riotcmd` package in this way:

java -cp ... riotcmdx.csv2rdf inputFile ...
@@ -11,8 +11,8 @@ PropertyTable Implementation | Description | Supported Indexes | Advantages | Di
`PropertyTableArrayImpl` | implemented by a two-dimensioned Java array of `Nodes`| SPO, PSO | compact memory usage, fast for querying with S and P, fast for query a whole `Row` | slow for query with O, table Row/Column size provided |
`PropertyTableHashMapImpl` | implemented by several Java `HashMaps` | PSO, POS | fast for querying with O, table Row/Column size not required | more memory usage for HashMaps |

By default, [PropertyTableArrayImpl]((https://github.com/apache/jena/tree/master/jena-csv/src/main/java/org/apache/jena/propertytable/impl/PropertyTableArrayImpl.java) is used as the `PropertyTable` implementation held by `GraphCSV`.
If you want to switch to [PropertyTableHashMapImpl](https://github.com/apache/jena/tree/master/jena-csv/src/main/java/org/apache/jena/propertytable/impl/PropertyTableHashMapImpl.java), just use the static method of `GraphCSV.createHashMapImpl()` to replace the default `new GraphCSV()` way.
By default, [PropertyTableArrayImpl]((https://github.com/apache/jena/tree/main/jena-csv/src/main/java/org/apache/jena/propertytable/impl/PropertyTableArrayImpl.java) is used as the `PropertyTable` implementation held by `GraphCSV`.
If you want to switch to [PropertyTableHashMapImpl](https://github.com/apache/jena/tree/main/jena-csv/src/main/java/org/apache/jena/propertytable/impl/PropertyTableHashMapImpl.java), just use the static method of `GraphCSV.createHashMapImpl()` to replace the default `new GraphCSV()` way.
Here is an example:

Model model_csv_array_impl = ModelFactory.createModelForGraph(new GraphCSV(file)); // PropertyTableArrayImpl
@@ -32,10 +32,10 @@ The following query pattern can be transformed into a `Row` querying, without ge
It's made by using the extension point of `StageGenerator`, because it's now just concerned with `BasicPattern`.
The detailed workflow goes in this way:

1. Split the incoming `BasicPattern` by subjects, (i.e. it becomes multiple sub BasicPatterns grouped by the same subjects. (see [QueryIterPropertyTable](https://github.com/apache/jena/tree/master/jena-csv/src/main/java/org/apache/jena/propertytable/impl/QueryIterPropertyTable.java) )
2. For each sub `BasicPattern`, if the `Triple` size within is greater than 1 (i.e. at least 2 `Triples`), it's turned into a `Row` querying, and processed by [QueryIterPropertyTableRow](https://github.com/apache/jena/tree/master/jena-csv/src/main/java/org/apache/jena/propertytable/impl/QueryIterPropertyTableRow.java), else if it contains only 1 `Triple`, it goes for the traditional `Triple` querying by `graph.graphBaseFind()`
1. Split the incoming `BasicPattern` by subjects, (i.e. it becomes multiple sub BasicPatterns grouped by the same subjects. (see [QueryIterPropertyTable](https://github.com/apache/jena/tree/main/jena-csv/src/main/java/org/apache/jena/propertytable/impl/QueryIterPropertyTable.java) )
2. For each sub `BasicPattern`, if the `Triple` size within is greater than 1 (i.e. at least 2 `Triples`), it's turned into a `Row` querying, and processed by [QueryIterPropertyTableRow](https://github.com/apache/jena/tree/main/jena-csv/src/main/java/org/apache/jena/propertytable/impl/QueryIterPropertyTableRow.java), else if it contains only 1 `Triple`, it goes for the traditional `Triple` querying by `graph.graphBaseFind()`

In order to turn on this optimization, we need to register the [StageGeneratorPropertyTable](https://github.com/apache/jena/tree/master/jena-csv/src/main/java/org/apache/jena/propertytable/impl/StageGeneratorPropertyTable.java) into ARQ context, before performing SPARQL querying:
In order to turn on this optimization, we need to register the [StageGeneratorPropertyTable](https://github.com/apache/jena/tree/main/jena-csv/src/main/java/org/apache/jena/propertytable/impl/StageGeneratorPropertyTable.java) into ARQ context, before performing SPARQL querying:

StageGenerator orig = (StageGenerator)ARQ.getContext().get(ARQ.stageGenerator) ;
StageGenerator stageGenerator = new StageGeneratorPropertyTable(orig) ;
@@ -117,7 +117,7 @@ Development builds (not a formal release):
[SNAPSHOT](https://repository.apache.org/content/repositories/snapshots/org/apache/jena/jena-fuseki/)

Source code:
[https://github.com/apache/jena/tree/master/jena-fuseki2](https://github.com/apache/jena/tree/master/jena-fuseki2)
[https://github.com/apache/jena/tree/main/jena-fuseki2](https://github.com/apache/jena/tree/main/jena-fuseki2)

The Fuseki module are under "jena-fuseki2/":

@@ -25,7 +25,7 @@ See [Fuseki Security](fuseki-security.html) for more information on security con

## Examples

Example server configuration files can be found at [jena-fuseki2/examples](https://github.com/apache/jena/tree/master/jena-fuseki2/examples).
Example server configuration files can be found at [jena-fuseki2/examples](https://github.com/apache/jena/tree/main/jena-fuseki2/examples).

## Security and Access Control

@@ -55,7 +55,7 @@ within the directory where the server is run.

## Default setting

The [default log4j2.properties](https://github.com/apache/jena/blob/master/jena-fuseki2/apache-jena-fuseki/log4j2.properties).
The [default log4j2.properties](https://github.com/apache/jena/blob/main/jena-fuseki2/apache-jena-fuseki/log4j2.properties).

## Logrotate

@@ -234,7 +234,7 @@ The base URI for reading models will be the original URI, not the alternative lo

## Advanced examples

Example code may be found in [jena-arq/src-examples](https://github.com/apache/jena/tree/master/jena-arq/src-examples/arq/examples/riot/).
Example code may be found in [jena-arq/src-examples](https://github.com/apache/jena/tree/main/jena-arq/src-examples/arq/examples/riot/).

### Iterating over parser output

@@ -243,8 +243,8 @@ this is useful when you don't want to go to the trouble of writing a full sink i
logic in normal iterator style.

To do this you use one of the subclasses of
[PipedRDFIterator](https://github.com/apache/jena/tree/master/jena-arq/src/main/java/org/apache/jena/riot/lang/PipedRDFIterator.java?view=markup)
in conjunction with a [PipedRDFStream](https://github.com/apache/jena/tree/master/jena-arq/src/main/java/org/apache/jena/riot/lang/PipedRDFStream.java?view=markup).
[PipedRDFIterator](https://github.com/apache/jena/tree/main/jena-arq/src/main/java/org/apache/jena/riot/lang/PipedRDFIterator.java?view=markup)
in conjunction with a [PipedRDFStream](https://github.com/apache/jena/tree/main/jena-arq/src/main/java/org/apache/jena/riot/lang/PipedRDFStream.java?view=markup).

This `PipedRDFStream` provides an implementation of `StreamRDF` which allows it to consume parser output and this is consumed by
the `PipedRDFIterator` implementation. This has some advantages over a direct `StreamRDF` implementation since it allows the parser
@@ -268,4 +268,4 @@ See [RIOT example 4](https://github.com/apache/jena/blob/main/jena-arq/src-examp

The set of languages is not fixed. A new language,
together with a parser, can be added to RIOT as shown in
[RIOT example 5](https://github.com/apache/jena/tree/master/jena-arq/src-examples/arq/examples/riot/ExRIOT5_StreamRDFCollect.java)
[RIOT example 5](https://github.com/apache/jena/tree/main/jena-arq/src-examples/arq/examples/riot/ExRIOT5_StreamRDFCollect.java)
@@ -367,7 +367,7 @@ pass the "frame" in the `JSONLD_FRAME_PRETTY` and `JSONLD_FRAME_FLAT`
cases.

What can be done, and how it can be, is explained in the
[sample code](https://github.com/apache/jena/tree/master/jena-arq/src-examples/arq/examples/riot/Ex_WriteJsonLD.java).
[sample code](https://github.com/apache/jena/tree/main/jena-arq/src-examples/arq/examples/riot/Ex_WriteJsonLD.java).

### RDF Binary {#rdf-thrift}

@@ -398,7 +398,7 @@ while the jena writer name defaults to a streaming plain output.

## Examples {#examples}

Example code may be found in [jena-arq/src-examples](https://github.com/apache/jena/tree/master/jena-arq/src-examples/arq/examples/riot/).
Example code may be found in [jena-arq/src-examples](https://github.com/apache/jena/tree/main/jena-arq/src-examples/arq/examples/riot/).

### Ways to write a model

@@ -452,7 +452,7 @@ might give:
### Adding a new output format

A complete example of adding a new output format is given in the example file:
[RIOT Output example 7](https://github.com/apache/jena/blob/master/jena-arq/src-examples/arq/examples/riot/ExRIOT7_AddNewWriter.java).
[RIOT Output example 7](https://github.com/apache/jena/blob/main/jena-arq/src-examples/arq/examples/riot/ExRIOT7_AddNewWriter.java).

## Notes {#notes}

@@ -39,7 +39,7 @@ This is an extract from the POM:
</transformers>

See
[jena-fuseki2/jena-fuseki-server/pom.xml](https://github.com/apache/jena/blob/master/jena-fuseki2/jena-fuseki-server/pom.xml)
[jena-fuseki2/jena-fuseki-server/pom.xml](https://github.com/apache/jena/blob/main/jena-fuseki2/jena-fuseki-server/pom.xml)
for the complete shade plugin setup used by Fuseki.

If doing manually, create a single file in your application jar the
@@ -399,7 +399,7 @@ This ontology presents a simple model for describing the concepts
and activities associated with a typical academic conference. A
copy of the ontology serialized in RDF/XML is included with the
Jena download, see:
[[`eswc-2006-09-21.rdf`](https://raw.githubusercontent.com/apache/jena/master/jena-core/src-examples/data/eswc-2006-09-21.rdf)]
[[`eswc-2006-09-21.rdf`](https://raw.githubusercontent.com/apache/jena/main/jena-core/src-examples/data/eswc-2006-09-21.rdf)]
(note that you may need to view the page source in some browsers to
see the XML code).

@@ -4,4 +4,4 @@ title: ARQ - Custom aggregates

ARQ supports custom aggregate functions as allowed by the SPARQL 1.1 specification.

See [example code](https://github.com/apache/jena/tree/master/jena-arq/src-examples/arq/examples/aggregates).
See [example code](https://github.com/apache/jena/tree/main/jena-arq/src-examples/arq/examples/aggregates).
@@ -25,7 +25,7 @@ Functions in involving sequences are not supported.

See [XSD Support](xsd-support.html) for details of datatypes and functions
currently supported. To check the exact current registrations, see
<tt>[function/StandardFunctions.java](https://github.com/apache/jena/blob/master/jena-arq/src/main/java/org/apache/jena/sparql/function/StandardFunctions.java)</tt>.
<tt>[function/StandardFunctions.java](https://github.com/apache/jena/blob/main/jena-arq/src/main/java/org/apache/jena/sparql/function/StandardFunctions.java)</tt>.

See also the [property functions](library-propfunc.html) library
page.
@@ -11,7 +11,7 @@ See the examples in the ARQ `src-examples/` directory of the ARQ
distribution, particularly `arq.examples.AlgebraExec`.

* [src-examples at gitbox.apache.org](https://gitbox.apache.org/repos/asf?p=jena.git;a=tree;f=jena-arq/src-examples/arq/examples)
* [src-examples at github.com](https://github.com/apache/jena/tree/master/jena-arq/src-examples/arq/examples)
* [src-examples at github.com](https://github.com/apache/jena/tree/main/jena-arq/src-examples/arq/examples)

See also [ARQ - SPARQL Algebra](algebra.html)

0 comments on commit 30fd6af

Please sign in to comment.