You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by jp...@apache.org on 2014/08/15 10:46:17 UTC
svn commit: r1618117 - in /jena/Experimental/jena-csv: ./
src/main/java/org/apache/jena/propertytable/graph/
src/main/java/org/apache/jena/propertytable/impl/
src/main/java/org/apache/jena/propertytable/lang/
src/main/java/org/apache/jena/propertytable...
Author: jpz6311whu
Date: Fri Aug 15 08:46:16 2014
New Revision: 1618117
URL: http://svn.apache.org/r1618117
Log:
JENA-625: prepare release:
1. add ReleaseNotes, LICENSE and NOTICE files
2. add missing license headers and java docs
3. add scm links
Added:
jena/Experimental/jena-csv/LICENSE
jena/Experimental/jena-csv/NOTICE
jena/Experimental/jena-csv/ReleaseNotes.txt (with props)
Modified:
jena/Experimental/jena-csv/pom.xml
jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/graph/GraphCSV.java
jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/graph/GraphPropertyTable.java
jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/graph/QueryIterPropertyTable.java
jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/graph/QueryIterPropertyTableRow.java
jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/graph/RowMatch.java
jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/graph/StageGeneratorPropertyTable.java
jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/impl/ColumnImpl.java
jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/impl/PropertyTableArrayImpl.java
jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/impl/PropertyTableBuilder.java
jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/lang/LangCSV.java
jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/util/IRILib.java
jena/Experimental/jena-csv/src/main/java/riotcmd/LocatorOupputFile.java
jena/Experimental/jena-csv/src/main/java/riotcmd/ModDest.java
jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/AbstractColumnTest.java
jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/AbstractPropertyTableTest.java
jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/AbstractRowTest.java
jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/graph/GraphCSVTest.java
jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/impl/AbstractPropertyTableBuilderTest.java
jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/impl/PropertyTableArrayImplTest.java
jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/impl/PropertyTableBuilderForArrayImplTest.java
jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/impl/PropertyTableBuilderForHashMapImplTest.java
jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/impl/PropertyTableHashMapImplTest.java
jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/lang/TestLangCSV.java
Added: jena/Experimental/jena-csv/LICENSE
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-csv/LICENSE?rev=1618117&view=auto
==============================================================================
--- jena/Experimental/jena-csv/LICENSE (added)
+++ jena/Experimental/jena-csv/LICENSE Fri Aug 15 08:46:16 2014
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
Added: jena/Experimental/jena-csv/NOTICE
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-csv/NOTICE?rev=1618117&view=auto
==============================================================================
--- jena/Experimental/jena-csv/NOTICE (added)
+++ jena/Experimental/jena-csv/NOTICE Fri Aug 15 08:46:16 2014
@@ -0,0 +1,11 @@
+Apache Jena - CSV PropertyTable module
+Copyright 2011, 2012, 2013, 2014 The Apache Software Foundation
+
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).
+
+Portions of this software were originally based on the following:
+ - Copyright 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP
+ - Copyright 2010, 2011 Epimorphics Ltd.
+ - Copyright 2010 Talis Systems Ltd.
+These have been licensed to the Apache Software Foundation under a software grant.
\ No newline at end of file
Added: jena/Experimental/jena-csv/ReleaseNotes.txt
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-csv/ReleaseNotes.txt?rev=1618117&view=auto
==============================================================================
--- jena/Experimental/jena-csv/ReleaseNotes.txt (added)
+++ jena/Experimental/jena-csv/ReleaseNotes.txt Fri Aug 15 08:46:16 2014
@@ -0,0 +1,9 @@
+Release Notes
+=============
+
+==== Apache Jena - CSV PropertyTable 1.0.0
+
++ PropertyTable and 2 implementations:
+
++
+
Propchange: jena/Experimental/jena-csv/ReleaseNotes.txt
------------------------------------------------------------------------------
svn:mime-type = text/plain
Modified: jena/Experimental/jena-csv/pom.xml
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-csv/pom.xml?rev=1618117&r1=1618116&r2=1618117&view=diff
==============================================================================
--- jena/Experimental/jena-csv/pom.xml (original)
+++ jena/Experimental/jena-csv/pom.xml Fri Aug 15 08:46:16 2014
@@ -22,7 +22,7 @@
<artifactId>jena-csv</artifactId>
<packaging>jar</packaging>
<name>Apache Jena - Data Tables for SPARQL</name>
- <version>1.0</version>
+ <version>1.0.0</version>
<parent>
<groupId>org.apache.jena</groupId>
@@ -45,6 +45,12 @@
<description>jena-csv is for getting CSVs into a form that is amenable to Jena SPARQL processing, and doing so in a way that is not specific to CSV files. It includes getting the right architecture in place for regular table shaped data, using the core abstraction of PropertyTable.</description>
+ <scm>
+ <connection>scm:svn:https://svn.apache.org/repos/asf/jena/Experimental/jena-csv</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/jena/Experimental/jena-csv</developerConnection>
+ <url>https://svn.apache.org/repos/asf/jena/Experimental/jena-csv</url>
+ </scm>
+
<properties>
<maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm:ssZ</maven.build.timestamp.format>
<build.time.xsd>${maven.build.timestamp}</build.time.xsd>
Modified: jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/graph/GraphCSV.java
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/graph/GraphCSV.java?rev=1618117&r1=1618116&r2=1618117&view=diff
==============================================================================
--- jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/graph/GraphCSV.java (original)
+++ jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/graph/GraphCSV.java Fri Aug 15 08:46:16 2014
@@ -22,6 +22,12 @@ import org.apache.jena.propertytable.Pro
import org.apache.jena.propertytable.impl.PropertyTableBuilder;
+/**
+ * GraphCSV 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.
+ *
+ */
public class GraphCSV extends GraphPropertyTable {
public static GraphCSV createHashMapImpl( String csvFilePath ){
@@ -36,6 +42,7 @@ public class GraphCSV extends GraphPrope
super(table);
}
+ // use the Java array implementation of PropertyTable for default
public GraphCSV ( String csvFilePath ){
super(PropertyTableBuilder.buildPropetyTableArrayImplFromCsv(csvFilePath));
}
Modified: jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/graph/GraphPropertyTable.java
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/graph/GraphPropertyTable.java?rev=1618117&r1=1618116&r2=1618117&view=diff
==============================================================================
--- jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/graph/GraphPropertyTable.java (original)
+++ jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/graph/GraphPropertyTable.java Fri Aug 15 08:46:16 2014
@@ -37,6 +37,13 @@ import com.hp.hpl.jena.util.iterator.Fil
import com.hp.hpl.jena.util.iterator.NullIterator;
import com.hp.hpl.jena.util.iterator.WrappedIterator;
+/**
+ * GraphPropertyTable implements the Graph interface (read-only) over a PropertyTable.
+ * This is subclass from GraphBase 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 an reference of the PropertyTable instance, so that such a Graph can be treated in a more table-like fashion.
+ *
+ */
public class GraphPropertyTable extends GraphBase {
private PropertyTable pt;
Modified: jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/graph/QueryIterPropertyTable.java
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/graph/QueryIterPropertyTable.java?rev=1618117&r1=1618116&r2=1618117&view=diff
==============================================================================
--- jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/graph/QueryIterPropertyTable.java (original)
+++ jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/graph/QueryIterPropertyTable.java Fri Aug 15 08:46:16 2014
@@ -37,84 +37,79 @@ import com.hp.hpl.jena.sparql.serializer
import com.hp.hpl.jena.sparql.util.FmtUtils;
import com.hp.hpl.jena.sparql.util.Utils;
-public class QueryIterPropertyTable extends QueryIter1
- {
- private BasicPattern pattern ;
- private Graph graph ;
- private QueryIterator output ;
-
- public static QueryIterator create(QueryIterator input,
- BasicPattern pattern ,
- ExecutionContext execContext)
- {
- return new QueryIterPropertyTable(input, pattern, execContext) ;
- }
-
- private QueryIterPropertyTable(QueryIterator input,
- BasicPattern pattern ,
- ExecutionContext execContext)
- {
- super(input, execContext) ;
- this.pattern = pattern ;
- graph = execContext.getActiveGraph() ;
- // Create a chain of triple iterators.
- QueryIterator chain = getInput() ;
- Collection<BasicPattern> patterns = sort(pattern);
- for (BasicPattern p : patterns)
- chain = new QueryIterPropertyTableRow(chain, p, execContext) ;
- output = chain ;
- }
-
- private Collection<BasicPattern> sort(BasicPattern pattern){
- HashMap<Node, BasicPattern> map= new HashMap<Node, BasicPattern>();
- for(Triple triple: pattern.getList()){
- Node subject = triple.getSubject();
- if(! map.containsKey(subject)){
- List<Triple> triples = new ArrayList<Triple>();
- BasicPattern p = BasicPattern.wrap(triples);
- map.put(subject, p);
- p.add(triple);
- }else {
- map.get(subject).add(triple);
- }
- }
- return map.values();
- }
-
- @Override
- protected boolean hasNextBinding()
- {
- return output.hasNext() ;
- }
-
- @Override
- protected Binding moveToNextBinding()
- {
- return output.nextBinding() ;
- }
-
- @Override
- protected void closeSubIterator()
- {
- if ( output != null )
- output.close() ;
- output = null ;
- }
-
- @Override
- protected void requestSubCancel()
- {
- if ( output != null )
- output.cancel();
- }
-
- @Override
- protected void details(IndentedWriter out, SerializationContext sCxt)
- {
- out.print(Utils.className(this)) ;
- out.println() ;
- out.incIndent() ;
- FmtUtils.formatPattern(out, pattern, sCxt) ;
- out.decIndent() ;
- }
+/**
+ * Split the incoming BasicPattern by subjects, (i.e. it becomes multiple sub BasicPatterns grouped by the same subjects.
+ *
+ */
+public class QueryIterPropertyTable extends QueryIter1 {
+
+ private BasicPattern pattern;
+ private Graph graph;
+ private QueryIterator output;
+
+ public static QueryIterator create(QueryIterator input,
+ BasicPattern pattern, ExecutionContext execContext) {
+ return new QueryIterPropertyTable(input, pattern, execContext);
+ }
+
+ private QueryIterPropertyTable(QueryIterator input, BasicPattern pattern,
+ ExecutionContext execContext) {
+ super(input, execContext);
+ this.pattern = pattern;
+ graph = execContext.getActiveGraph();
+ // Create a chain of triple iterators.
+ QueryIterator chain = getInput();
+ Collection<BasicPattern> patterns = sort(pattern);
+ for (BasicPattern p : patterns)
+ chain = new QueryIterPropertyTableRow(chain, p, execContext);
+ output = chain;
+ }
+
+ private Collection<BasicPattern> sort(BasicPattern pattern) {
+ HashMap<Node, BasicPattern> map = new HashMap<Node, BasicPattern>();
+ for (Triple triple : pattern.getList()) {
+ Node subject = triple.getSubject();
+ if (!map.containsKey(subject)) {
+ List<Triple> triples = new ArrayList<Triple>();
+ BasicPattern p = BasicPattern.wrap(triples);
+ map.put(subject, p);
+ p.add(triple);
+ } else {
+ map.get(subject).add(triple);
+ }
+ }
+ return map.values();
+ }
+
+ @Override
+ protected boolean hasNextBinding() {
+ return output.hasNext();
+ }
+
+ @Override
+ protected Binding moveToNextBinding() {
+ return output.nextBinding();
+ }
+
+ @Override
+ protected void closeSubIterator() {
+ if (output != null)
+ output.close();
+ output = null;
+ }
+
+ @Override
+ protected void requestSubCancel() {
+ if (output != null)
+ output.cancel();
+ }
+
+ @Override
+ protected void details(IndentedWriter out, SerializationContext sCxt) {
+ out.print(Utils.className(this));
+ out.println();
+ out.incIndent();
+ FmtUtils.formatPattern(out, pattern, sCxt);
+ out.decIndent();
+ }
}
Modified: jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/graph/QueryIterPropertyTableRow.java
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/graph/QueryIterPropertyTableRow.java?rev=1618117&r1=1618116&r2=1618117&view=diff
==============================================================================
--- jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/graph/QueryIterPropertyTableRow.java (original)
+++ jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/graph/QueryIterPropertyTableRow.java Fri Aug 15 08:46:16 2014
@@ -42,7 +42,13 @@ import com.hp.hpl.jena.util.iterator.Ext
import com.hp.hpl.jena.util.iterator.NiceIterator;
import com.hp.hpl.jena.util.iterator.WrappedIterator;
+/**
+ * If the triple size within a BasicePattern is greater than 1 (i.e. at least 2 triples), it's turned into a row querying.
+ *
+ */
public class QueryIterPropertyTableRow extends QueryIterRepeatApply{
+
+
private final BasicPattern pattern ;
public QueryIterPropertyTableRow( QueryIterator input,
Modified: jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/graph/RowMatch.java
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/graph/RowMatch.java?rev=1618117&r1=1618116&r2=1618117&view=diff
==============================================================================
--- jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/graph/RowMatch.java (original)
+++ jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/graph/RowMatch.java Fri Aug 15 08:46:16 2014
@@ -21,6 +21,10 @@ package org.apache.jena.propertytable.gr
import com.hp.hpl.jena.graph.Node;
import com.hp.hpl.jena.sparql.core.BasicPattern;
+/**
+ * The data structure for matching a Row
+ *
+ */
public class RowMatch {
private BasicPattern pattern;
Modified: jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/graph/StageGeneratorPropertyTable.java
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/graph/StageGeneratorPropertyTable.java?rev=1618117&r1=1618116&r2=1618117&view=diff
==============================================================================
--- jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/graph/StageGeneratorPropertyTable.java (original)
+++ jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/graph/StageGeneratorPropertyTable.java Fri Aug 15 08:46:16 2014
@@ -25,6 +25,10 @@ import com.hp.hpl.jena.sparql.engine.Exe
import com.hp.hpl.jena.sparql.engine.QueryIterator;
import com.hp.hpl.jena.sparql.engine.main.StageGenerator;
+/**
+ * The extension of StageGenerator for querying a Row.
+ *
+ */
public class StageGeneratorPropertyTable implements StageGenerator {
// Using OpExecutor is preferred.
@@ -42,13 +46,10 @@ public class StageGeneratorPropertyTable
Graph g = execCxt.getActiveGraph() ;
if ( ! ( g instanceof GraphPropertyTable ) )
- // Not us - bounce up the StageGenerator chain
return above.execute(pattern, input, execCxt) ;
if (pattern.size() <= 1){
-// System.out.println( "<=1 "+ pattern);
return above.execute(pattern, input, execCxt) ;
}
-// System.out.println( ">1" + pattern);
return QueryIterPropertyTable.create(input, pattern, execCxt);
}
Modified: jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/impl/ColumnImpl.java
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/impl/ColumnImpl.java?rev=1618117&r1=1618116&r2=1618117&view=diff
==============================================================================
--- jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/impl/ColumnImpl.java (original)
+++ jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/impl/ColumnImpl.java Fri Aug 15 08:46:16 2014
@@ -26,7 +26,13 @@ import org.apache.jena.propertytable.Pro
import com.hp.hpl.jena.graph.Node;
+/**
+ * The simple implementation of Column
+ *
+ */
public class ColumnImpl implements Column {
+
+
private final PropertyTable table;
private Node p;
Modified: jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/impl/PropertyTableArrayImpl.java
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/impl/PropertyTableArrayImpl.java?rev=1618117&r1=1618116&r2=1618117&view=diff
==============================================================================
--- jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/impl/PropertyTableArrayImpl.java (original)
+++ jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/impl/PropertyTableArrayImpl.java Fri Aug 15 08:46:16 2014
@@ -35,6 +35,11 @@ import com.hp.hpl.jena.graph.Triple;
import com.hp.hpl.jena.util.iterator.ExtendedIterator;
import com.hp.hpl.jena.util.iterator.WrappedIterator;
+/**
+ * A PropertyTable Implementation using a two dimension array.
+ * It contains SPO and PSO indexes.
+ *
+ */
public class PropertyTableArrayImpl implements PropertyTable {
private final List<Node> rowList;
Modified: jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/impl/PropertyTableBuilder.java
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/impl/PropertyTableBuilder.java?rev=1618117&r1=1618116&r2=1618117&view=diff
==============================================================================
--- jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/impl/PropertyTableBuilder.java (original)
+++ jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/impl/PropertyTableBuilder.java Fri Aug 15 08:46:16 2014
@@ -35,6 +35,11 @@ import com.hp.hpl.jena.graph.Node;
import com.hp.hpl.jena.graph.NodeFactory;
+/**
+ * A tool for constructing PropertyTable from a file (e.g., a CSV file).
+ *
+ *
+ */
public class PropertyTableBuilder {
public static Node CSV_ROW_NODE = NodeFactory.createURI(LangCSV.CSV_ROW);
Modified: jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/lang/LangCSV.java
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/lang/LangCSV.java?rev=1618117&r1=1618116&r2=1618117&view=diff
==============================================================================
--- jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/lang/LangCSV.java (original)
+++ jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/lang/LangCSV.java Fri Aug 15 08:46:16 2014
@@ -46,6 +46,10 @@ import com.hp.hpl.jena.graph.Node;
import com.hp.hpl.jena.graph.NodeFactory;
import com.hp.hpl.jena.sparql.util.Context;
+/**
+ * The LangRIOT implementation for CSV
+ *
+ */
public class LangCSV implements LangRIOT {
public static final String CSV_PREFIX = "http://w3c/future-csv-vocab/";
Modified: jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/util/IRILib.java
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/util/IRILib.java?rev=1618117&r1=1618116&r2=1618117&view=diff
==============================================================================
--- jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/util/IRILib.java (original)
+++ jena/Experimental/jena-csv/src/main/java/org/apache/jena/propertytable/util/IRILib.java Fri Aug 15 08:46:16 2014
@@ -27,8 +27,10 @@ import org.apache.jena.atlas.lib.StrUtil
import org.apache.jena.riot.SysRIOT ;
/**
- * Operations related to IRIs
- * Add '£', based on org.apache.jena.riot.system.IRILib
+ * Operations related to IRIs.
+ * Add support for '£', based on {@link org.apache.jena.riot.system.IRILib}
+ *
+ * This class should be merged into riot IRILib in future.
*/
public class IRILib
{
Modified: jena/Experimental/jena-csv/src/main/java/riotcmd/LocatorOupputFile.java
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-csv/src/main/java/riotcmd/LocatorOupputFile.java?rev=1618117&r1=1618116&r2=1618117&view=diff
==============================================================================
--- jena/Experimental/jena-csv/src/main/java/riotcmd/LocatorOupputFile.java (original)
+++ jena/Experimental/jena-csv/src/main/java/riotcmd/LocatorOupputFile.java Fri Aug 15 08:46:16 2014
@@ -31,7 +31,7 @@ import com.hp.hpl.jena.util.FileManager;
import com.hp.hpl.jena.util.FileUtils;
import com.hp.hpl.jena.util.LocatorFile;
-public class LocatorOupputFile {
+class LocatorOupputFile {
static Logger log = LoggerFactory.getLogger(LocatorOupputFile.class) ;
private String thisDir = null ;
private String thisDirLogStr = "" ;
Modified: jena/Experimental/jena-csv/src/main/java/riotcmd/ModDest.java
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-csv/src/main/java/riotcmd/ModDest.java?rev=1618117&r1=1618116&r2=1618117&view=diff
==============================================================================
--- jena/Experimental/jena-csv/src/main/java/riotcmd/ModDest.java (original)
+++ jena/Experimental/jena-csv/src/main/java/riotcmd/ModDest.java Fri Aug 15 08:46:16 2014
@@ -24,7 +24,7 @@ import arq.cmdline.ArgModuleGeneral;
import arq.cmdline.CmdArgModule;
import arq.cmdline.CmdGeneral;
-public class ModDest implements ArgModuleGeneral{
+class ModDest implements ArgModuleGeneral{
private ArgDecl argDest = new ArgDecl(ArgDecl.HasValue, "dest") ;
private String dest = null ;
Modified: jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/AbstractColumnTest.java
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/AbstractColumnTest.java?rev=1618117&r1=1618116&r2=1618117&view=diff
==============================================================================
--- jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/AbstractColumnTest.java (original)
+++ jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/AbstractColumnTest.java Fri Aug 15 08:46:16 2014
@@ -26,6 +26,10 @@ import org.junit.Test;
import com.hp.hpl.jena.graph.Node;
import com.hp.hpl.jena.graph.NodeFactory;
+/**
+ * Tests related to Column.
+ *
+ */
public abstract class AbstractColumnTest extends BaseTest{
Modified: jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/AbstractPropertyTableTest.java
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/AbstractPropertyTableTest.java?rev=1618117&r1=1618116&r2=1618117&view=diff
==============================================================================
--- jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/AbstractPropertyTableTest.java (original)
+++ jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/AbstractPropertyTableTest.java Fri Aug 15 08:46:16 2014
@@ -25,6 +25,10 @@ import org.junit.Test;
import com.hp.hpl.jena.graph.NodeFactory;
+/**
+ * Tests related to PropertyTable.
+ *
+ */
public abstract class AbstractPropertyTableTest extends AbstractRowTest{
@Test
Modified: jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/AbstractRowTest.java
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/AbstractRowTest.java?rev=1618117&r1=1618116&r2=1618117&view=diff
==============================================================================
--- jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/AbstractRowTest.java (original)
+++ jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/AbstractRowTest.java Fri Aug 15 08:46:16 2014
@@ -24,7 +24,10 @@ import org.junit.Test;
import com.hp.hpl.jena.graph.Node;
import com.hp.hpl.jena.graph.NodeFactory;
-
+/**
+ * Tests related to Row.
+ *
+ */
public abstract class AbstractRowTest extends AbstractColumnTest{
@Test
Modified: jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/graph/GraphCSVTest.java
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/graph/GraphCSVTest.java?rev=1618117&r1=1618116&r2=1618117&view=diff
==============================================================================
--- jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/graph/GraphCSVTest.java (original)
+++ jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/graph/GraphCSVTest.java Fri Aug 15 08:46:16 2014
@@ -36,6 +36,10 @@ import com.hp.hpl.jena.rdf.model.ModelFa
import com.hp.hpl.jena.sparql.engine.main.StageBuilder;
import com.hp.hpl.jena.sparql.engine.main.StageGenerator;
+/**
+ * Tests related to GraphCSV with some real world data.
+ *
+ */
public class GraphCSVTest extends Assert {
@BeforeClass
Modified: jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/impl/AbstractPropertyTableBuilderTest.java
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/impl/AbstractPropertyTableBuilderTest.java?rev=1618117&r1=1618116&r2=1618117&view=diff
==============================================================================
--- jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/impl/AbstractPropertyTableBuilderTest.java (original)
+++ jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/impl/AbstractPropertyTableBuilderTest.java Fri Aug 15 08:46:16 2014
@@ -31,6 +31,11 @@ import org.junit.Test;
import com.hp.hpl.jena.graph.Node;
import com.hp.hpl.jena.graph.NodeFactory;
+
+/**
+ * Tests related to PropertyTableBuilder, or more explicitly for the CSV parser in the current release.
+ *
+ */
public abstract class AbstractPropertyTableBuilderTest extends BaseTest {
@Test
Modified: jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/impl/PropertyTableArrayImplTest.java
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/impl/PropertyTableArrayImplTest.java?rev=1618117&r1=1618116&r2=1618117&view=diff
==============================================================================
--- jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/impl/PropertyTableArrayImplTest.java (original)
+++ jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/impl/PropertyTableArrayImplTest.java Fri Aug 15 08:46:16 2014
@@ -24,6 +24,10 @@ import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
+/**
+ * Tests for PropertyTableArrayImpl
+ *
+ */
public class PropertyTableArrayImplTest extends AbstractPropertyTableTest{
private static int rowNum = 10;
Modified: jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/impl/PropertyTableBuilderForArrayImplTest.java
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/impl/PropertyTableBuilderForArrayImplTest.java?rev=1618117&r1=1618116&r2=1618117&view=diff
==============================================================================
--- jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/impl/PropertyTableBuilderForArrayImplTest.java (original)
+++ jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/impl/PropertyTableBuilderForArrayImplTest.java Fri Aug 15 08:46:16 2014
@@ -1,3 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.apache.jena.propertytable.impl;
import org.junit.After;
Modified: jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/impl/PropertyTableBuilderForHashMapImplTest.java
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/impl/PropertyTableBuilderForHashMapImplTest.java?rev=1618117&r1=1618116&r2=1618117&view=diff
==============================================================================
--- jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/impl/PropertyTableBuilderForHashMapImplTest.java (original)
+++ jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/impl/PropertyTableBuilderForHashMapImplTest.java Fri Aug 15 08:46:16 2014
@@ -1,3 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.apache.jena.propertytable.impl;
import org.junit.After;
Modified: jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/impl/PropertyTableHashMapImplTest.java
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/impl/PropertyTableHashMapImplTest.java?rev=1618117&r1=1618116&r2=1618117&view=diff
==============================================================================
--- jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/impl/PropertyTableHashMapImplTest.java (original)
+++ jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/impl/PropertyTableHashMapImplTest.java Fri Aug 15 08:46:16 2014
@@ -22,7 +22,10 @@ import org.apache.jena.propertytable.Abs
import org.junit.After;
import org.junit.Before;
-
+/**
+ * Tests for PropertyTableHashMapImpl
+ *
+ */
public class PropertyTableHashMapImplTest extends AbstractPropertyTableTest{
@Before
Modified: jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/lang/TestLangCSV.java
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/lang/TestLangCSV.java?rev=1618117&r1=1618116&r2=1618117&view=diff
==============================================================================
--- jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/lang/TestLangCSV.java (original)
+++ jena/Experimental/jena-csv/src/test/java/org/apache/jena/propertytable/lang/TestLangCSV.java Fri Aug 15 08:46:16 2014
@@ -32,7 +32,13 @@ import org.junit.Test;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.rdf.model.ModelFactory;
+
+/**
+ * Tests for the registered LangCSV in RIOT.
+ *
+ */
public class TestLangCSV extends BaseTest {
+
private static final String FILE_NAME = "src/test/resources/test.csv";
private static final String FILE_URI = IRIResolver.resolveString(FILE_NAME);