Author: jpz6311whu
Date: Sun Aug 3 09:13:57 2014
New Revision: 1615396
URL: http://svn.apache.org/r1615396
Log:
Design Documentation for CSV PropertyTable [JENA 625]
Added:
jena/site/trunk/content/documentation/csv/design.mdtext
jena/site/trunk/content/documentation/csv/implementation.mdtext
jena/site/trunk/content/documentation/csv/jena-csv-architecture.png (with
props)
Modified:
jena/site/trunk/content/documentation/csv/get_started.mdtext
jena/site/trunk/content/documentation/csv/index.mdtext
Added: jena/site/trunk/content/documentation/csv/design.mdtext
URL:
http://svn.apache.org/viewvc/jena/site/trunk/content/documentation/csv/design.mdtext?rev=1615396&view=auto
==============================================================================
--- jena/site/trunk/content/documentation/csv/design.mdtext (added)
+++ jena/site/trunk/content/documentation/csv/design.mdtext Sun Aug 3 09:13:57
2014
@@ -0,0 +1,41 @@
+Title: CSV PropertyTable - Design
+
+## Architecture
+
+The architecture of jena-csv mainly involves 2 components:
+
+-
[PropertyTable](https://svn.apache.org/repos/asf/jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/PropertyTable.java)
+-
[GraphPropertyTable](https://svn.apache.org/repos/asf/jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/impl/GraphPropertyTable.java)
+
+
+
+### PropertyTable
+
+A `PropertyTable` is collection of data that is sufficiently regular in shape
it can be treated as a table.
+That means each subject has a value for each one of the set of properties.
+Irregularity in terms of missing values needs to be handled but not multiple
values for the same property.
+With special storage, a PropertyTable
+
+- is more compact and more amenable to custom storage (e.g. a JSON document
store)
+- can have custom indexes on specific columns
+- can guarantee access orders
+
+More explicitly, `PropertyTable` is designed to be a table of RDF terms, or
[Nodes](https://svn.apache.org/repos/asf/jena/trunk/jena-core/src/main/java/com/hp/hpl/jena/graph/Node.java)
in Jena.
+Each
[Column](https://svn.apache.org/repos/asf/jena/Experimental/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://svn.apache.org/repos/asf/jena/Experimental/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`.
+
+### GraphPropertyTable
+
+`GraphPropertyTable` implements the
[Graph](https://svn.apache.org/repos/asf/jena/trunk/jena-core/src/main/java/com/hp/hpl/jena/graph/Graph.java)
interface (read-only) over a `PropertyTable`.
+This is subclass from
[GraphBase](https://svn.apache.org/repos/asf/jena/trunk/jena-core/src/main/java/com/hp/hpl/jena/graph/impl/GraphBase.java)
and implements `find()`.
+The `graphBaseFind()` method can choose the access route based on the find
arguments.
+It holds/wraps an reference of the `PropertyTable` instance, so that such a
graph can be treated in a more table-like fashion.
+
+Note that, both `PropertyTable` and `GraphPropertyTable` are *NOT* restricted
to CSV data.
+They are supposed to be compatible with any table-like data sources, such as
relational databases, Microsoft Excel, etc.
+
+### GraphCSV
+
+[GraphCSV](https://svn.apache.org/repos/asf/jena/Experimental/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 and makes a
`GraphPropertyTable` through parsing the file.
Modified: jena/site/trunk/content/documentation/csv/get_started.mdtext
URL:
http://svn.apache.org/viewvc/jena/site/trunk/content/documentation/csv/get_started.mdtext?rev=1615396&r1=1615395&r2=1615396&view=diff
==============================================================================
--- jena/site/trunk/content/documentation/csv/get_started.mdtext (original)
+++ jena/site/trunk/content/documentation/csv/get_started.mdtext Sun Aug 3
09:13:57 2014
@@ -25,12 +25,12 @@ In short, for Jena ARP, a CSV table is a
## Command Line Tool
-`[csv2rdf](https://svn.apache.org/repos/asf/jena/Experimental/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://svn.apache.org/repos/asf/jena/Experimental/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 ... riotcmd.csv2rdf -dest=outputFile inputFile ...
-It transforms the `inputFile`(i.e. CSV file(s)) into `outputFile`(i.e.
N-Triples file). For example,
+It transforms the CSV `inputFile` into N-Triples `outputFile`. For example,
java -cp ... riotcmd.csv2rdf --dest=test.ntriples
src/test/resources/test.csv
Added: jena/site/trunk/content/documentation/csv/implementation.mdtext
URL:
http://svn.apache.org/viewvc/jena/site/trunk/content/documentation/csv/implementation.mdtext?rev=1615396&view=auto
==============================================================================
--- jena/site/trunk/content/documentation/csv/implementation.mdtext (added)
+++ jena/site/trunk/content/documentation/csv/implementation.mdtext Sun Aug 3
09:13:57 2014
@@ -0,0 +1 @@
+Title: CSV PropertyTable - Implementation
\ No newline at end of file
Modified: jena/site/trunk/content/documentation/csv/index.mdtext
URL:
http://svn.apache.org/viewvc/jena/site/trunk/content/documentation/csv/index.mdtext?rev=1615396&r1=1615395&r2=1615396&view=diff
==============================================================================
--- jena/site/trunk/content/documentation/csv/index.mdtext (original)
+++ jena/site/trunk/content/documentation/csv/index.mdtext Sun Aug 3 09:13:57
2014
@@ -47,6 +47,9 @@ We can use the following SPARQL query fo
}
}
+What's more, we make some room for future extension through `PropertyTable`.
+The [architecture](design.html) is designed to be able to accommodate any
table-like data sources, such as relational databases, Microsoft Excel, etc.
+
## Documentation
- [Get Started](get_started.html)
Added: jena/site/trunk/content/documentation/csv/jena-csv-architecture.png
URL:
http://svn.apache.org/viewvc/jena/site/trunk/content/documentation/csv/jena-csv-architecture.png?rev=1615396&view=auto
==============================================================================
Binary file - no diff available.
Propchange: jena/site/trunk/content/documentation/csv/jena-csv-architecture.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream