You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2016/05/14 17:22:18 UTC
[22/40] jena git commit: Fix line endings
http://git-wip-us.apache.org/repos/asf/jena/blob/d6ae87fd/jena-arq/src/test/java/org/apache/jena/riot/TestRiotReader.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/test/java/org/apache/jena/riot/TestRiotReader.java b/jena-arq/src/test/java/org/apache/jena/riot/TestRiotReader.java
index b54df07..24f4738 100644
--- a/jena-arq/src/test/java/org/apache/jena/riot/TestRiotReader.java
+++ b/jena-arq/src/test/java/org/apache/jena/riot/TestRiotReader.java
@@ -1,85 +1,85 @@
-/*
- * 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.riot;
-
-import static org.junit.Assert.assertEquals ;
-import static org.junit.Assert.assertFalse ;
-import static org.junit.Assert.assertNotNull ;
-import static org.junit.Assert.assertTrue ;
-
-import java.io.ByteArrayInputStream ;
-import java.nio.charset.StandardCharsets ;
-import java.util.Iterator ;
-
-import org.apache.jena.atlas.lib.StrUtils ;
-import org.apache.jena.graph.Triple ;
-import org.junit.Test ;
-
-public class TestRiotReader
-{
- @Test
- public void testCreateIteratorTriples_01()
- {
- Iterator<Triple> it = RDFDataMgr.createIteratorTriples(new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8)), RDFLanguages.NTRIPLES, "http://example/");
-
- assertFalse(it.hasNext());
- }
-
- @Test
- public void testEncodedUTF8()
- {
- Iterator<Triple> it = RDFDataMgr.createIteratorTriples(new ByteArrayInputStream("<a> <b> \"\\u263A\" .".getBytes(StandardCharsets.UTF_8)), RDFLanguages.NTRIPLES, null);
-
- assertTrue(it.hasNext());
- assertEquals("\u263a", it.next().getObject().getLiteralLexicalForm());
- }
-
- @Test
- public void testRawUTF8()
- {
- Iterator<Triple> it = RDFDataMgr.createIteratorTriples(new ByteArrayInputStream("<a> <b> \"\u263a\" .".getBytes(StandardCharsets.UTF_8)), RDFLanguages.NTRIPLES, null);
-
- assertTrue(it.hasNext());
- assertEquals("\u263a", it.next().getObject().getLiteralLexicalForm());
- }
-
- @Test
- public void testCreateIteratorTriples_02()
- {
- String x = StrUtils.strjoinNL(
- "<rdf:RDF",
- " xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"",
- " xmlns:j.0=\"http://example/\">" ,
- " <rdf:Description rdf:about=\"http://example/s\">" ,
- " <j.0:p rdf:resource=\"http://example/o\"/>" ,
- " </rdf:Description>" ,
- "</rdf:RDF>") ;
-
- Iterator<Triple> it = RDFDataMgr.createIteratorTriples(new ByteArrayInputStream(x.getBytes()), RDFLanguages.RDFXML, "http://example/");
-
- assertTrue(it.hasNext());
- Triple t = it.next();
- assertNotNull(t);
- assertEquals("http://example/s", t.getSubject().getURI());
- assertEquals("http://example/p", t.getPredicate().getURI());
- assertEquals("http://example/o", t.getObject().getURI());
-
- assertFalse(it.hasNext());
- }
-}
+/*
+ * 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.riot;
+
+import static org.junit.Assert.assertEquals ;
+import static org.junit.Assert.assertFalse ;
+import static org.junit.Assert.assertNotNull ;
+import static org.junit.Assert.assertTrue ;
+
+import java.io.ByteArrayInputStream ;
+import java.nio.charset.StandardCharsets ;
+import java.util.Iterator ;
+
+import org.apache.jena.atlas.lib.StrUtils ;
+import org.apache.jena.graph.Triple ;
+import org.junit.Test ;
+
+public class TestRiotReader
+{
+ @Test
+ public void testCreateIteratorTriples_01()
+ {
+ Iterator<Triple> it = RDFDataMgr.createIteratorTriples(new ByteArrayInputStream("".getBytes(StandardCharsets.UTF_8)), RDFLanguages.NTRIPLES, "http://example/");
+
+ assertFalse(it.hasNext());
+ }
+
+ @Test
+ public void testEncodedUTF8()
+ {
+ Iterator<Triple> it = RDFDataMgr.createIteratorTriples(new ByteArrayInputStream("<a> <b> \"\\u263A\" .".getBytes(StandardCharsets.UTF_8)), RDFLanguages.NTRIPLES, null);
+
+ assertTrue(it.hasNext());
+ assertEquals("\u263a", it.next().getObject().getLiteralLexicalForm());
+ }
+
+ @Test
+ public void testRawUTF8()
+ {
+ Iterator<Triple> it = RDFDataMgr.createIteratorTriples(new ByteArrayInputStream("<a> <b> \"\u263a\" .".getBytes(StandardCharsets.UTF_8)), RDFLanguages.NTRIPLES, null);
+
+ assertTrue(it.hasNext());
+ assertEquals("\u263a", it.next().getObject().getLiteralLexicalForm());
+ }
+
+ @Test
+ public void testCreateIteratorTriples_02()
+ {
+ String x = StrUtils.strjoinNL(
+ "<rdf:RDF",
+ " xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"",
+ " xmlns:j.0=\"http://example/\">" ,
+ " <rdf:Description rdf:about=\"http://example/s\">" ,
+ " <j.0:p rdf:resource=\"http://example/o\"/>" ,
+ " </rdf:Description>" ,
+ "</rdf:RDF>") ;
+
+ Iterator<Triple> it = RDFDataMgr.createIteratorTriples(new ByteArrayInputStream(x.getBytes()), RDFLanguages.RDFXML, "http://example/");
+
+ assertTrue(it.hasNext());
+ Triple t = it.next();
+ assertNotNull(t);
+ assertEquals("http://example/s", t.getSubject().getURI());
+ assertEquals("http://example/p", t.getPredicate().getURI());
+ assertEquals("http://example/o", t.getObject().getURI());
+
+ assertFalse(it.hasNext());
+ }
+}
http://git-wip-us.apache.org/repos/asf/jena/blob/d6ae87fd/jena-arq/src/test/java/org/apache/jena/sparql/engine/index/TestIndexTable.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/test/java/org/apache/jena/sparql/engine/index/TestIndexTable.java b/jena-arq/src/test/java/org/apache/jena/sparql/engine/index/TestIndexTable.java
index 30ff9d4..5c14139 100644
--- a/jena-arq/src/test/java/org/apache/jena/sparql/engine/index/TestIndexTable.java
+++ b/jena-arq/src/test/java/org/apache/jena/sparql/engine/index/TestIndexTable.java
@@ -1,205 +1,205 @@
-/**
- * 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.sparql.engine.index ;
-
-import static org.apache.jena.reasoner.rulesys.Util.makeIntNode ;
-import static org.junit.Assert.assertEquals ;
-import static org.junit.Assert.assertTrue ;
-import static org.junit.Assert.assertFalse ;
-import static org.junit.Assert.fail ;
-
-import java.util.ArrayList ;
-import java.util.Collections ;
-import java.util.LinkedHashSet ;
-import java.util.List ;
-import java.util.Map ;
-import java.util.Set ;
-
-import org.apache.jena.sparql.core.Var ;
-import org.apache.jena.sparql.engine.QueryIterator ;
-import org.apache.jena.sparql.engine.binding.Binding ;
-import org.apache.jena.sparql.engine.binding.BindingHashMap ;
-import org.apache.jena.sparql.engine.index.HashIndexTable ;
-import org.apache.jena.sparql.engine.index.IndexFactory ;
-import org.apache.jena.sparql.engine.index.IndexTable ;
-import org.apache.jena.sparql.engine.index.LinearIndex ;
-import org.apache.jena.sparql.engine.index.HashIndexTable.Key ;
-import org.apache.jena.sparql.engine.index.HashIndexTable.MissingBindingException ;
-import org.apache.jena.sparql.engine.iterator.QueryIterPlainWrapper ;
-import org.junit.Test ;
-import org.junit.Before ;
-
-/**
- * Tests the {@link HashIndexTable} and
- * {@link LinearIndex} classes. Also tests
- * that the {@link IndexFactory} instantiates
- * the correct type of index depending on the data.
- */
-public class TestIndexTable {
- // Contribution from P Gearon (@quoll)
-
- private Var[] vars ;
-
- // sets of vars with different iteration orders
- private Set<Var> order1 ;
- private Set<Var> order2 ;
-
- private List<Binding> fData ;
- private List<Binding> pData ;
-
- @Before
- public void setup()
- {
- vars = new Var[] { Var.alloc("a"), Var.alloc("b"), Var.alloc("c") } ;
- order1 = new LinkedHashSet<>() ;
- order2 = new LinkedHashSet<>() ;
- for ( int i = 0 ; i < vars.length ; i++ )
- {
- order1.add(vars[i]) ;
- order2.add(vars[vars.length - i - 1]) ;
- }
-
- fData = new ArrayList<>() ;
- pData = new ArrayList<>() ;
- for ( int i = 10 ; i <= 100 ; i += 10 )
- {
- BindingHashMap bindingFull = new BindingHashMap() ;
- BindingHashMap bindingPart = new BindingHashMap() ;
- for ( int b = 0 ; b < vars.length ; b++ )
- {
- bindingFull.add(vars[b], makeIntNode(i + b)) ; // 10,11,12 - 20,21,22 - 30,31,32 ... 100,101,102
- if ( (i + b) % 7 != 0 ) bindingPart.add(vars[b], makeIntNode(i + b)) ; // skips 21, 42, 70, 91
- }
- fData.add(bindingFull) ;
- pData.add(bindingPart) ;
- }
- }
-
- @Test
- public void testHashIndexTableConstruction() throws Exception
- {
- new HashIndexTable(order1, fullData()) ;
- assertTrue(IndexFactory.createIndex(order1, fullData()) instanceof HashIndexTable) ;
- assertTrue(IndexFactory.createIndex(order1, partData()) instanceof LinearIndex) ;
-
- try {
-
- new HashIndexTable(order1, partData()) ;
- fail("Index built without failure on partial bindings") ;
-
- } catch (MissingBindingException e)
- {
- // check that the expected mapping occurred
- Map<Var,Integer> map = e.getMap() ;
- for ( int i = 0 ; i < vars.length ; i++ )
- {
- assertEquals(Integer.valueOf(i), map.get(vars[i])) ;
- }
-
- // check for rows of {a=10,b=11,c=12}, {a=20,c=22}
- Set<Key> data = e.getData() ;
- assertEquals(2, data.size()) ;
-
- for ( Key key: data )
- {
- Binding b = LinearIndex.toBinding(key, map) ;
- if ( b.size() == 3 )
- {
- for ( int i = 0 ; i < vars.length ; i++ )
- assertEquals(b.get(vars[i]), makeIntNode(10 + i)) ;
- } else
- {
- assertEquals(b.get(vars[0]), makeIntNode(20)) ;
- assertEquals(b.get(vars[2]), makeIntNode(22)) ;
- }
- }
- }
- }
-
- @Test
- public void testHashIndexTableData() throws Exception
- {
- // test twice with different internal mappings
- testTableData(new HashIndexTable(order1, fullData())) ;
- testTableData(new HashIndexTable(order2, fullData())) ;
- }
-
- @Test
- public void testLinearIndexTableData()
- {
- // test twice with different internal mappings
- testTableData(IndexFactory.createIndex(order1, partData())) ;
- testTableData(IndexFactory.createIndex(order2, partData())) ;
-
- // test the linear index with full data, since this should also work
- Set<Key> emptyKeys = Collections.emptySet() ;
- Map<Var,Integer> emptyMapping = Collections.emptyMap() ;
-
- testTableData(new LinearIndex(order1, fullData(), emptyKeys, emptyMapping)) ;
- testTableData(new LinearIndex(order2, fullData(), emptyKeys, emptyMapping)) ;
-
- // construction directly from part data should also work
- testTableData(new LinearIndex(order1, partData(), emptyKeys, emptyMapping)) ;
- testTableData(new LinearIndex(order2, partData(), emptyKeys, emptyMapping)) ;
- }
-
- private void testTableData(IndexTable index)
- {
- // positive test for matching
- for ( Binding b: fData )
- assertTrue(index.containsCompatibleWithSharedDomain(b)) ;
-
- assertTrue(index.containsCompatibleWithSharedDomain(binding("abcd", 10, 11, 12, 13))) ;
- assertTrue(index.containsCompatibleWithSharedDomain(binding("ab", 10, 11))) ;
- assertTrue(index.containsCompatibleWithSharedDomain(binding("bc", 11, 12))) ;
- assertTrue(index.containsCompatibleWithSharedDomain(binding("ac", 10, 12))) ;
- assertTrue(index.containsCompatibleWithSharedDomain(binding("a", 10))) ;
- assertTrue(index.containsCompatibleWithSharedDomain(binding("ab", 70, 71))) ;
- assertTrue(index.containsCompatibleWithSharedDomain(binding("bc", 71, 72))) ;
- assertTrue(index.containsCompatibleWithSharedDomain(binding("ac", 70, 72))) ;
- assertTrue(index.containsCompatibleWithSharedDomain(binding("a", 80))) ; // a=70 won't match for partData
-
- // negative test for matching
- assertFalse(index.containsCompatibleWithSharedDomain(binding("abc", 10, 11, 11))) ;
- assertFalse(index.containsCompatibleWithSharedDomain(binding("d", 10))) ;
- assertFalse(index.containsCompatibleWithSharedDomain(binding("abc", 10, 21, 32))) ;
- assertFalse(index.containsCompatibleWithSharedDomain(binding("xyz", 10, 11, 12))) ;
- }
-
- private QueryIterator fullData() { return new QueryIterPlainWrapper(fData.iterator()) ; }
-
- private QueryIterator partData() { return new QueryIterPlainWrapper(pData.iterator()) ; }
-
-
- /**
- * A convenience method that creates a binding of Vars with single letter names bound to integers.
- * @param varNames A string of variable names. The length must match the number of integers to bind to.
- * @param ints The values of the integers to be bound to the variables.
- */
- private static Binding binding(String varNames, Integer... ints)
- {
- assert varNames.length() == ints.length ;
-
- BindingHashMap b = new BindingHashMap() ;
- for ( int s = 0 ; s < varNames.length() ; s++ )
- b.add(Var.alloc(varNames.substring(s, s + 1)), makeIntNode(ints[s])) ;
- return b ;
- }
-}
-
+/**
+ * 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.sparql.engine.index ;
+
+import static org.apache.jena.reasoner.rulesys.Util.makeIntNode ;
+import static org.junit.Assert.assertEquals ;
+import static org.junit.Assert.assertTrue ;
+import static org.junit.Assert.assertFalse ;
+import static org.junit.Assert.fail ;
+
+import java.util.ArrayList ;
+import java.util.Collections ;
+import java.util.LinkedHashSet ;
+import java.util.List ;
+import java.util.Map ;
+import java.util.Set ;
+
+import org.apache.jena.sparql.core.Var ;
+import org.apache.jena.sparql.engine.QueryIterator ;
+import org.apache.jena.sparql.engine.binding.Binding ;
+import org.apache.jena.sparql.engine.binding.BindingHashMap ;
+import org.apache.jena.sparql.engine.index.HashIndexTable ;
+import org.apache.jena.sparql.engine.index.IndexFactory ;
+import org.apache.jena.sparql.engine.index.IndexTable ;
+import org.apache.jena.sparql.engine.index.LinearIndex ;
+import org.apache.jena.sparql.engine.index.HashIndexTable.Key ;
+import org.apache.jena.sparql.engine.index.HashIndexTable.MissingBindingException ;
+import org.apache.jena.sparql.engine.iterator.QueryIterPlainWrapper ;
+import org.junit.Test ;
+import org.junit.Before ;
+
+/**
+ * Tests the {@link HashIndexTable} and
+ * {@link LinearIndex} classes. Also tests
+ * that the {@link IndexFactory} instantiates
+ * the correct type of index depending on the data.
+ */
+public class TestIndexTable {
+ // Contribution from P Gearon (@quoll)
+
+ private Var[] vars ;
+
+ // sets of vars with different iteration orders
+ private Set<Var> order1 ;
+ private Set<Var> order2 ;
+
+ private List<Binding> fData ;
+ private List<Binding> pData ;
+
+ @Before
+ public void setup()
+ {
+ vars = new Var[] { Var.alloc("a"), Var.alloc("b"), Var.alloc("c") } ;
+ order1 = new LinkedHashSet<>() ;
+ order2 = new LinkedHashSet<>() ;
+ for ( int i = 0 ; i < vars.length ; i++ )
+ {
+ order1.add(vars[i]) ;
+ order2.add(vars[vars.length - i - 1]) ;
+ }
+
+ fData = new ArrayList<>() ;
+ pData = new ArrayList<>() ;
+ for ( int i = 10 ; i <= 100 ; i += 10 )
+ {
+ BindingHashMap bindingFull = new BindingHashMap() ;
+ BindingHashMap bindingPart = new BindingHashMap() ;
+ for ( int b = 0 ; b < vars.length ; b++ )
+ {
+ bindingFull.add(vars[b], makeIntNode(i + b)) ; // 10,11,12 - 20,21,22 - 30,31,32 ... 100,101,102
+ if ( (i + b) % 7 != 0 ) bindingPart.add(vars[b], makeIntNode(i + b)) ; // skips 21, 42, 70, 91
+ }
+ fData.add(bindingFull) ;
+ pData.add(bindingPart) ;
+ }
+ }
+
+ @Test
+ public void testHashIndexTableConstruction() throws Exception
+ {
+ new HashIndexTable(order1, fullData()) ;
+ assertTrue(IndexFactory.createIndex(order1, fullData()) instanceof HashIndexTable) ;
+ assertTrue(IndexFactory.createIndex(order1, partData()) instanceof LinearIndex) ;
+
+ try {
+
+ new HashIndexTable(order1, partData()) ;
+ fail("Index built without failure on partial bindings") ;
+
+ } catch (MissingBindingException e)
+ {
+ // check that the expected mapping occurred
+ Map<Var,Integer> map = e.getMap() ;
+ for ( int i = 0 ; i < vars.length ; i++ )
+ {
+ assertEquals(Integer.valueOf(i), map.get(vars[i])) ;
+ }
+
+ // check for rows of {a=10,b=11,c=12}, {a=20,c=22}
+ Set<Key> data = e.getData() ;
+ assertEquals(2, data.size()) ;
+
+ for ( Key key: data )
+ {
+ Binding b = LinearIndex.toBinding(key, map) ;
+ if ( b.size() == 3 )
+ {
+ for ( int i = 0 ; i < vars.length ; i++ )
+ assertEquals(b.get(vars[i]), makeIntNode(10 + i)) ;
+ } else
+ {
+ assertEquals(b.get(vars[0]), makeIntNode(20)) ;
+ assertEquals(b.get(vars[2]), makeIntNode(22)) ;
+ }
+ }
+ }
+ }
+
+ @Test
+ public void testHashIndexTableData() throws Exception
+ {
+ // test twice with different internal mappings
+ testTableData(new HashIndexTable(order1, fullData())) ;
+ testTableData(new HashIndexTable(order2, fullData())) ;
+ }
+
+ @Test
+ public void testLinearIndexTableData()
+ {
+ // test twice with different internal mappings
+ testTableData(IndexFactory.createIndex(order1, partData())) ;
+ testTableData(IndexFactory.createIndex(order2, partData())) ;
+
+ // test the linear index with full data, since this should also work
+ Set<Key> emptyKeys = Collections.emptySet() ;
+ Map<Var,Integer> emptyMapping = Collections.emptyMap() ;
+
+ testTableData(new LinearIndex(order1, fullData(), emptyKeys, emptyMapping)) ;
+ testTableData(new LinearIndex(order2, fullData(), emptyKeys, emptyMapping)) ;
+
+ // construction directly from part data should also work
+ testTableData(new LinearIndex(order1, partData(), emptyKeys, emptyMapping)) ;
+ testTableData(new LinearIndex(order2, partData(), emptyKeys, emptyMapping)) ;
+ }
+
+ private void testTableData(IndexTable index)
+ {
+ // positive test for matching
+ for ( Binding b: fData )
+ assertTrue(index.containsCompatibleWithSharedDomain(b)) ;
+
+ assertTrue(index.containsCompatibleWithSharedDomain(binding("abcd", 10, 11, 12, 13))) ;
+ assertTrue(index.containsCompatibleWithSharedDomain(binding("ab", 10, 11))) ;
+ assertTrue(index.containsCompatibleWithSharedDomain(binding("bc", 11, 12))) ;
+ assertTrue(index.containsCompatibleWithSharedDomain(binding("ac", 10, 12))) ;
+ assertTrue(index.containsCompatibleWithSharedDomain(binding("a", 10))) ;
+ assertTrue(index.containsCompatibleWithSharedDomain(binding("ab", 70, 71))) ;
+ assertTrue(index.containsCompatibleWithSharedDomain(binding("bc", 71, 72))) ;
+ assertTrue(index.containsCompatibleWithSharedDomain(binding("ac", 70, 72))) ;
+ assertTrue(index.containsCompatibleWithSharedDomain(binding("a", 80))) ; // a=70 won't match for partData
+
+ // negative test for matching
+ assertFalse(index.containsCompatibleWithSharedDomain(binding("abc", 10, 11, 11))) ;
+ assertFalse(index.containsCompatibleWithSharedDomain(binding("d", 10))) ;
+ assertFalse(index.containsCompatibleWithSharedDomain(binding("abc", 10, 21, 32))) ;
+ assertFalse(index.containsCompatibleWithSharedDomain(binding("xyz", 10, 11, 12))) ;
+ }
+
+ private QueryIterator fullData() { return new QueryIterPlainWrapper(fData.iterator()) ; }
+
+ private QueryIterator partData() { return new QueryIterPlainWrapper(pData.iterator()) ; }
+
+
+ /**
+ * A convenience method that creates a binding of Vars with single letter names bound to integers.
+ * @param varNames A string of variable names. The length must match the number of integers to bind to.
+ * @param ints The values of the integers to be bound to the variables.
+ */
+ private static Binding binding(String varNames, Integer... ints)
+ {
+ assert varNames.length() == ints.length ;
+
+ BindingHashMap b = new BindingHashMap() ;
+ for ( int s = 0 ; s < varNames.length() ; s++ )
+ b.add(Var.alloc(varNames.substring(s, s + 1)), makeIntNode(ints[s])) ;
+ return b ;
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/jena/blob/d6ae87fd/jena-arq/src/test/java/org/apache/jena/web/AbstractTestDatasetGraphAccessor.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/test/java/org/apache/jena/web/AbstractTestDatasetGraphAccessor.java b/jena-arq/src/test/java/org/apache/jena/web/AbstractTestDatasetGraphAccessor.java
index e013f0c..1aececa 100644
--- a/jena-arq/src/test/java/org/apache/jena/web/AbstractTestDatasetGraphAccessor.java
+++ b/jena-arq/src/test/java/org/apache/jena/web/AbstractTestDatasetGraphAccessor.java
@@ -16,8 +16,8 @@
* limitations under the License.
*/
-package org.apache.jena.web;
-
+package org.apache.jena.web;
+
import org.apache.jena.atlas.junit.BaseTest ;
import org.apache.jena.graph.Graph ;
import org.apache.jena.graph.GraphUtil ;
@@ -30,8 +30,8 @@ import org.apache.jena.riot.RDFDataMgr ;
import org.apache.jena.sparql.graph.GraphFactory ;
import org.apache.jena.sparql.sse.SSE ;
import org.junit.Test ;
-
-public abstract class AbstractTestDatasetGraphAccessor extends BaseTest
+
+public abstract class AbstractTestDatasetGraphAccessor extends BaseTest
{
protected static final String gn1 = "http://graph/1" ;
protected static final String gn2 = "http://graph/2" ;
@@ -46,135 +46,135 @@ public abstract class AbstractTestDatasetGraphAccessor extends BaseTest
protected static final Model model1 = ModelFactory.createModelForGraph(graph1) ;
protected static final Model model2 = ModelFactory.createModelForGraph(graph2) ;
-
- // return a DatasetGraphAccessor backed by an empty dataset
- protected abstract DatasetGraphAccessor getDatasetUpdater() ;
-
- private static void assertNullOrEmpty(Graph graph)
- {
+
+ // return a DatasetGraphAccessor backed by an empty dataset
+ protected abstract DatasetGraphAccessor getDatasetUpdater() ;
+
+ private static void assertNullOrEmpty(Graph graph)
+ {
if ( graph == null ) return ;
if ( ! graph.isEmpty() ) {
System.out.println("----") ;
RDFDataMgr.write(System.out, graph, Lang.TTL) ;
}
-
- assertTrue(graph.isEmpty()) ;
- }
-
- @Test public void get_01()
- {
- DatasetGraphAccessor updater = getDatasetUpdater() ;
- Graph graph = updater.httpGet() ;
- assertNullOrEmpty(graph) ;
- Graph graph2 = updater.httpGet(n1) ;
- }
-
- @Test public void get_02()
- {
- DatasetGraphAccessor updater = getDatasetUpdater() ;
- Graph graph = updater.httpGet(n1) ;
- assertNullOrEmpty(graph) ;
- }
-
- @Test public void put_01()
- {
- DatasetGraphAccessor updater = getDatasetUpdater() ;
- updater.httpPut(graph1) ;
-
- Graph graph = updater.httpGet() ;
- assertNotNull("Graph is null", graph) ;
- assertTrue(graph.isIsomorphicWith(graph1)) ;
- }
-
-
- @Test public void put_02()
+
+ assertTrue(graph.isEmpty()) ;
+ }
+
+ @Test public void get_01()
+ {
+ DatasetGraphAccessor updater = getDatasetUpdater() ;
+ Graph graph = updater.httpGet() ;
+ assertNullOrEmpty(graph) ;
+ Graph graph2 = updater.httpGet(n1) ;
+ }
+
+ @Test public void get_02()
+ {
+ DatasetGraphAccessor updater = getDatasetUpdater() ;
+ Graph graph = updater.httpGet(n1) ;
+ assertNullOrEmpty(graph) ;
+ }
+
+ @Test public void put_01()
+ {
+ DatasetGraphAccessor updater = getDatasetUpdater() ;
+ updater.httpPut(graph1) ;
+
+ Graph graph = updater.httpGet() ;
+ assertNotNull("Graph is null", graph) ;
+ assertTrue(graph.isIsomorphicWith(graph1)) ;
+ }
+
+
+ @Test public void put_02()
{
- DatasetGraphAccessor updater = getDatasetUpdater() ;
- updater.httpPut(n1, graph1) ;
-
- Graph graph = updater.httpGet() ;
- assertNullOrEmpty(graph) ;
-
- graph = updater.httpGet(n1) ;
- assertNotNull("Graph is null", graph) ;
- assertTrue(graph.isIsomorphicWith(graph1)) ;
- }
-
- @Test public void post_01()
- {
- DatasetGraphAccessor updater = getDatasetUpdater() ;
- updater.httpPost(graph1) ;
- updater.httpPost(graph2) ;
- Graph graph = updater.httpGet() ;
-
- Graph graph3 = GraphFactory.createDefaultGraph() ;
- GraphUtil.addInto(graph3, graph1) ;
+ DatasetGraphAccessor updater = getDatasetUpdater() ;
+ updater.httpPut(n1, graph1) ;
+
+ Graph graph = updater.httpGet() ;
+ assertNullOrEmpty(graph) ;
+
+ graph = updater.httpGet(n1) ;
+ assertNotNull("Graph is null", graph) ;
+ assertTrue(graph.isIsomorphicWith(graph1)) ;
+ }
+
+ @Test public void post_01()
+ {
+ DatasetGraphAccessor updater = getDatasetUpdater() ;
+ updater.httpPost(graph1) ;
+ updater.httpPost(graph2) ;
+ Graph graph = updater.httpGet() ;
+
+ Graph graph3 = GraphFactory.createDefaultGraph() ;
+ GraphUtil.addInto(graph3, graph1) ;
GraphUtil.addInto(graph3, graph2) ;
- assertTrue(graph.isIsomorphicWith(graph3)) ;
- assertFalse(graph.isIsomorphicWith(graph1)) ;
- assertFalse(graph.isIsomorphicWith(graph2)) ;
- }
-
- @Test public void post_02()
- {
- DatasetGraphAccessor updater = getDatasetUpdater() ;
- updater.httpPost(n1, graph1) ;
- updater.httpPost(n1, graph2) ;
- Graph graph = updater.httpGet(n1) ;
- Graph graph3 = GraphFactory.createDefaultGraph() ;
+ assertTrue(graph.isIsomorphicWith(graph3)) ;
+ assertFalse(graph.isIsomorphicWith(graph1)) ;
+ assertFalse(graph.isIsomorphicWith(graph2)) ;
+ }
+
+ @Test public void post_02()
+ {
+ DatasetGraphAccessor updater = getDatasetUpdater() ;
+ updater.httpPost(n1, graph1) ;
+ updater.httpPost(n1, graph2) ;
+ Graph graph = updater.httpGet(n1) ;
+ Graph graph3 = GraphFactory.createDefaultGraph() ;
GraphUtil.addInto(graph3, graph1) ;
GraphUtil.addInto(graph3, graph2) ;
- assertTrue(graph.isIsomorphicWith(graph3)) ;
- assertFalse(graph.isIsomorphicWith(graph1)) ;
- assertFalse(graph.isIsomorphicWith(graph2)) ;
-
- graph = updater.httpGet() ;
- assertFalse(graph.isIsomorphicWith(graph3)) ;
- }
-
- // Default graph
- @Test public void delete_01()
- {
- DatasetGraphAccessor updater = getDatasetUpdater() ;
- updater.httpDelete() ;
- Graph graph = updater.httpGet() ;
- assertTrue(graph.isEmpty()) ;
-
- updater.httpPut(graph1) ;
- graph = updater.httpGet() ;
- assertFalse(graph.isEmpty()) ;
-
- updater.httpDelete() ;
- graph = updater.httpGet() ;
- assertTrue(graph.isEmpty()) ;
- }
-
- // Named graph, no side effects.
- @Test public void delete_02()
- {
- DatasetGraphAccessor updater = getDatasetUpdater() ;
- //updater.httpDelete(n1) ;
- Graph graph = updater.httpGet(n1) ;
- assertNullOrEmpty(graph) ;
-
- updater.httpPut(graph2) ;
- updater.httpPut(n1, graph1) ;
-
- updater.httpDelete() ;
- graph = updater.httpGet() ;
- assertTrue(graph.isEmpty()) ;
- updater.httpPut(graph2) ;
-
- graph = updater.httpGet(n1) ;
- assertFalse(graph.isEmpty()) ;
-
- updater.httpDelete(n1) ;
- graph = updater.httpGet(n1) ;
- assertNullOrEmpty(graph) ;
- graph = updater.httpGet() ;
- assertFalse(graph.isEmpty()) ;
- }
-
-// @Test public void compound_01() {}
-// @Test public void compound_02() {}
+ assertTrue(graph.isIsomorphicWith(graph3)) ;
+ assertFalse(graph.isIsomorphicWith(graph1)) ;
+ assertFalse(graph.isIsomorphicWith(graph2)) ;
+
+ graph = updater.httpGet() ;
+ assertFalse(graph.isIsomorphicWith(graph3)) ;
+ }
+
+ // Default graph
+ @Test public void delete_01()
+ {
+ DatasetGraphAccessor updater = getDatasetUpdater() ;
+ updater.httpDelete() ;
+ Graph graph = updater.httpGet() ;
+ assertTrue(graph.isEmpty()) ;
+
+ updater.httpPut(graph1) ;
+ graph = updater.httpGet() ;
+ assertFalse(graph.isEmpty()) ;
+
+ updater.httpDelete() ;
+ graph = updater.httpGet() ;
+ assertTrue(graph.isEmpty()) ;
+ }
+
+ // Named graph, no side effects.
+ @Test public void delete_02()
+ {
+ DatasetGraphAccessor updater = getDatasetUpdater() ;
+ //updater.httpDelete(n1) ;
+ Graph graph = updater.httpGet(n1) ;
+ assertNullOrEmpty(graph) ;
+
+ updater.httpPut(graph2) ;
+ updater.httpPut(n1, graph1) ;
+
+ updater.httpDelete() ;
+ graph = updater.httpGet() ;
+ assertTrue(graph.isEmpty()) ;
+ updater.httpPut(graph2) ;
+
+ graph = updater.httpGet(n1) ;
+ assertFalse(graph.isEmpty()) ;
+
+ updater.httpDelete(n1) ;
+ graph = updater.httpGet(n1) ;
+ assertNullOrEmpty(graph) ;
+ graph = updater.httpGet() ;
+ assertFalse(graph.isEmpty()) ;
+ }
+
+// @Test public void compound_01() {}
+// @Test public void compound_02() {}
}
http://git-wip-us.apache.org/repos/asf/jena/blob/d6ae87fd/jena-arq/src/test/java/org/apache/jena/web/TestDatasetGraphAccessorMem.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/test/java/org/apache/jena/web/TestDatasetGraphAccessorMem.java b/jena-arq/src/test/java/org/apache/jena/web/TestDatasetGraphAccessorMem.java
index f2a633a..14295c3 100644
--- a/jena-arq/src/test/java/org/apache/jena/web/TestDatasetGraphAccessorMem.java
+++ b/jena-arq/src/test/java/org/apache/jena/web/TestDatasetGraphAccessorMem.java
@@ -16,19 +16,19 @@
* limitations under the License.
*/
-package org.apache.jena.web;
-
-
+package org.apache.jena.web;
+
+
import org.apache.jena.query.DatasetAccessorFactory ;
import org.apache.jena.sparql.core.DatasetGraph ;
import org.apache.jena.sparql.core.DatasetGraphFactory ;
-
-public class TestDatasetGraphAccessorMem extends AbstractTestDatasetGraphAccessor
-{
- @Override
- protected DatasetGraphAccessor getDatasetUpdater()
- {
- DatasetGraph dsg = DatasetGraphFactory.create() ;
- return DatasetAccessorFactory.make(dsg) ;
- }
+
+public class TestDatasetGraphAccessorMem extends AbstractTestDatasetGraphAccessor
+{
+ @Override
+ protected DatasetGraphAccessor getDatasetUpdater()
+ {
+ DatasetGraph dsg = DatasetGraphFactory.create() ;
+ return DatasetAccessorFactory.make(dsg) ;
+ }
}
http://git-wip-us.apache.org/repos/asf/jena/blob/d6ae87fd/jena-arq/testing/ARQ/Construct/results-construct-quad-data-2.ttl
----------------------------------------------------------------------
diff --git a/jena-arq/testing/ARQ/Construct/results-construct-quad-data-2.ttl b/jena-arq/testing/ARQ/Construct/results-construct-quad-data-2.ttl
index 9a434a5..858a0bc 100644
--- a/jena-arq/testing/ARQ/Construct/results-construct-quad-data-2.ttl
+++ b/jena-arq/testing/ARQ/Construct/results-construct-quad-data-2.ttl
@@ -1,2 +1,2 @@
-@prefix : <http://example.org/ns#> .
+@prefix : <http://example.org/ns#> .
:s :p :o .
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jena/blob/d6ae87fd/jena-arq/testing/ARQ/Construct/results-construct-quad-dataset.trig
----------------------------------------------------------------------
diff --git a/jena-arq/testing/ARQ/Construct/results-construct-quad-dataset.trig b/jena-arq/testing/ARQ/Construct/results-construct-quad-dataset.trig
index 2ca2b27..2dd369a 100644
--- a/jena-arq/testing/ARQ/Construct/results-construct-quad-dataset.trig
+++ b/jena-arq/testing/ARQ/Construct/results-construct-quad-dataset.trig
@@ -1,4 +1,4 @@
-@prefix : <http://example.org/ns#> .
-{:s :m :o}
-<g1.ttl> {:s1 :m :o1 }
+@prefix : <http://example.org/ns#> .
+{:s :m :o}
+<g1.ttl> {:s1 :m :o1 }
<g2.ttl> {:s2 :m :o2 }
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jena/blob/d6ae87fd/jena-arq/testing/ARQ/Construct/results-construct-quad-default-graph.ttl
----------------------------------------------------------------------
diff --git a/jena-arq/testing/ARQ/Construct/results-construct-quad-default-graph.ttl b/jena-arq/testing/ARQ/Construct/results-construct-quad-default-graph.ttl
index f07c90c..c39d57f 100644
--- a/jena-arq/testing/ARQ/Construct/results-construct-quad-default-graph.ttl
+++ b/jena-arq/testing/ARQ/Construct/results-construct-quad-default-graph.ttl
@@ -1,3 +1,3 @@
-@prefix : <http://example.org/ns#> .
-:s1 :m :o1 .
-:s2 :m :o2 .
+@prefix : <http://example.org/ns#> .
+:s1 :m :o1 .
+:s2 :m :o2 .
http://git-wip-us.apache.org/repos/asf/jena/blob/d6ae87fd/jena-arq/testing/ARQ/Construct/results-construct-quad-named-graph.trig
----------------------------------------------------------------------
diff --git a/jena-arq/testing/ARQ/Construct/results-construct-quad-named-graph.trig b/jena-arq/testing/ARQ/Construct/results-construct-quad-named-graph.trig
index 876197f..d789da4 100644
--- a/jena-arq/testing/ARQ/Construct/results-construct-quad-named-graph.trig
+++ b/jena-arq/testing/ARQ/Construct/results-construct-quad-named-graph.trig
@@ -1,3 +1,3 @@
-@prefix : <http://example.org/ns#> .
-<g1.ttl> {:s1 :m :o1 }
+@prefix : <http://example.org/ns#> .
+<g1.ttl> {:s1 :m :o1 }
<g2.ttl> {:s2 :m :o2 }
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jena/blob/d6ae87fd/jena-arq/testing/ARQ/Construct/results-construct-quad-short-form-1.trig
----------------------------------------------------------------------
diff --git a/jena-arq/testing/ARQ/Construct/results-construct-quad-short-form-1.trig b/jena-arq/testing/ARQ/Construct/results-construct-quad-short-form-1.trig
index f95c57b..7ed6d7f 100644
--- a/jena-arq/testing/ARQ/Construct/results-construct-quad-short-form-1.trig
+++ b/jena-arq/testing/ARQ/Construct/results-construct-quad-short-form-1.trig
@@ -1,3 +1,3 @@
-@prefix : <http://example.org/ns#> .
-<g1.ttl> {:s1 :p :o1 }
+@prefix : <http://example.org/ns#> .
+<g1.ttl> {:s1 :p :o1 }
<g2.ttl> {:s2 :p :o2 }
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jena/blob/d6ae87fd/jena-arq/testing/ARQ/Construct/results-construct-quad-short-form-2.ttl
----------------------------------------------------------------------
diff --git a/jena-arq/testing/ARQ/Construct/results-construct-quad-short-form-2.ttl b/jena-arq/testing/ARQ/Construct/results-construct-quad-short-form-2.ttl
index 9a434a5..858a0bc 100644
--- a/jena-arq/testing/ARQ/Construct/results-construct-quad-short-form-2.ttl
+++ b/jena-arq/testing/ARQ/Construct/results-construct-quad-short-form-2.ttl
@@ -1,2 +1,2 @@
-@prefix : <http://example.org/ns#> .
+@prefix : <http://example.org/ns#> .
:s :p :o .
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jena/blob/d6ae87fd/jena-arq/testing/ARQ/Construct/results-construct-quad-short-form-3.trig
----------------------------------------------------------------------
diff --git a/jena-arq/testing/ARQ/Construct/results-construct-quad-short-form-3.trig b/jena-arq/testing/ARQ/Construct/results-construct-quad-short-form-3.trig
index ab87333..6b48ffd 100644
--- a/jena-arq/testing/ARQ/Construct/results-construct-quad-short-form-3.trig
+++ b/jena-arq/testing/ARQ/Construct/results-construct-quad-short-form-3.trig
@@ -1,4 +1,4 @@
-@prefix : <http://example.org/ns#> .
-{:s :p :o}
-<g1.ttl> {:s1 :p :o1 }
+@prefix : <http://example.org/ns#> .
+{:s :p :o}
+<g1.ttl> {:s1 :p :o1 }
<g2.ttl> {:s2 :p :o2 }
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jena/blob/d6ae87fd/jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-1.trig
----------------------------------------------------------------------
diff --git a/jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-1.trig b/jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-1.trig
index ee42de7..78c9d04 100644
--- a/jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-1.trig
+++ b/jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-1.trig
@@ -1,2 +1,2 @@
-@prefix : <http://example.org/ns#> .
+@prefix : <http://example.org/ns#> .
:g {:s :p :o }
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jena/blob/d6ae87fd/jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-3.ttl
----------------------------------------------------------------------
diff --git a/jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-3.ttl b/jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-3.ttl
index 8914bbe..0cb2bd7 100644
--- a/jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-3.ttl
+++ b/jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-3.ttl
@@ -1,2 +1,2 @@
-@prefix : <http://example.org/ns#> .
+@prefix : <http://example.org/ns#> .
:s :p :o
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jena/blob/d6ae87fd/jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-4.trig
----------------------------------------------------------------------
diff --git a/jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-4.trig b/jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-4.trig
index eb40f00..7fdc75d 100644
--- a/jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-4.trig
+++ b/jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-4.trig
@@ -1,6 +1,6 @@
-@prefix : <http://example.org/ns#> .
-:s1 :p :o1 .
-:s2 :p :o2 .
-:a1 :b1 :c1 .
-<g1.ttl> {:s :p :o}
+@prefix : <http://example.org/ns#> .
+:s1 :p :o1 .
+:s2 :p :o2 .
+:a1 :b1 :c1 .
+<g1.ttl> {:s :p :o}
<g2.ttl> {:s :p :o}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jena/blob/d6ae87fd/jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-5.trig
----------------------------------------------------------------------
diff --git a/jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-5.trig b/jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-5.trig
index eb40f00..7fdc75d 100644
--- a/jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-5.trig
+++ b/jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-5.trig
@@ -1,6 +1,6 @@
-@prefix : <http://example.org/ns#> .
-:s1 :p :o1 .
-:s2 :p :o2 .
-:a1 :b1 :c1 .
-<g1.ttl> {:s :p :o}
+@prefix : <http://example.org/ns#> .
+:s1 :p :o1 .
+:s2 :p :o2 .
+:a1 :b1 :c1 .
+<g1.ttl> {:s :p :o}
<g2.ttl> {:s :p :o}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jena/blob/d6ae87fd/jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-6.trig
----------------------------------------------------------------------
diff --git a/jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-6.trig b/jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-6.trig
index 9ddbf74..67d9665 100644
--- a/jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-6.trig
+++ b/jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-6.trig
@@ -1,6 +1,6 @@
-@prefix : <http://example.org/ns#> .
-:s1 :p :o1 .
-:s2 :p :o2 .
-:a1 :b1 :c1 .
-<g1.ttl> {:s :p :o. :s1 :p :o1 . :a1 :b1 :c1 .}
+@prefix : <http://example.org/ns#> .
+:s1 :p :o1 .
+:s2 :p :o2 .
+:a1 :b1 :c1 .
+<g1.ttl> {:s :p :o. :s1 :p :o1 . :a1 :b1 :c1 .}
<g2.ttl> {:s :p :o. :s2 :p :o2 .}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jena/blob/d6ae87fd/jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-7.ttl
----------------------------------------------------------------------
diff --git a/jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-7.ttl b/jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-7.ttl
index 8914bbe..0cb2bd7 100644
--- a/jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-7.ttl
+++ b/jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-7.ttl
@@ -1,2 +1,2 @@
-@prefix : <http://example.org/ns#> .
+@prefix : <http://example.org/ns#> .
:s :p :o
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jena/blob/d6ae87fd/jena-arq/testing/DAWG-Final/sort/.manifest.ttl.swp
----------------------------------------------------------------------
diff --git a/jena-arq/testing/DAWG-Final/sort/.manifest.ttl.swp b/jena-arq/testing/DAWG-Final/sort/.manifest.ttl.swp
deleted file mode 100644
index 9a14952..0000000
Binary files a/jena-arq/testing/DAWG-Final/sort/.manifest.ttl.swp and /dev/null differ
http://git-wip-us.apache.org/repos/asf/jena/blob/d6ae87fd/jena-arq/testing/RIOT/Lang/TrigStd/literal_with_CARRIAGE_RETURN.trig
----------------------------------------------------------------------
diff --git a/jena-arq/testing/RIOT/Lang/TrigStd/literal_with_CARRIAGE_RETURN.trig b/jena-arq/testing/RIOT/Lang/TrigStd/literal_with_CARRIAGE_RETURN.trig
index 18d6fe8..0be04a9 100644
--- a/jena-arq/testing/RIOT/Lang/TrigStd/literal_with_CARRIAGE_RETURN.trig
+++ b/jena-arq/testing/RIOT/Lang/TrigStd/literal_with_CARRIAGE_RETURN.trig
@@ -1,2 +1,2 @@
-{<http://a.example/s> <http://a.example/p> '''
''' .}
+{<http://a.example/s> <http://a.example/p> '''
''' .}
<http://example/graph> {<http://a.example/s> <http://a.example/p> '''
''' .}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/jena/blob/d6ae87fd/jena-core/src/main/java/org/apache/jena/vocabulary/SKOS.java
----------------------------------------------------------------------
diff --git a/jena-core/src/main/java/org/apache/jena/vocabulary/SKOS.java b/jena-core/src/main/java/org/apache/jena/vocabulary/SKOS.java
index 426a3a4..a26f05a 100644
--- a/jena-core/src/main/java/org/apache/jena/vocabulary/SKOS.java
+++ b/jena-core/src/main/java/org/apache/jena/vocabulary/SKOS.java
@@ -1,96 +1,96 @@
-/*
- * 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.vocabulary;
-
-
-import org.apache.jena.rdf.model.Model ;
-import org.apache.jena.rdf.model.ModelFactory ;
-import org.apache.jena.rdf.model.Property ;
-import org.apache.jena.rdf.model.Resource ;
-
-/**
- * Vocabulary definition for the
- * <a href="http://www.w3.org/2009/08/skos-reference/skos.html">W3C SKOS Recommendation</a>.
- */
-public class SKOS {
- /**
- * The RDF model that holds the SKOS entities
- */
- private static final Model m = ModelFactory.createDefaultModel();
- /**
- * The namespace of the SKOS vocabulary as a string
- */
- public static final String uri = "http://www.w3.org/2004/02/skos/core#";
- /**
- * Returns the namespace of the SKOS schema as a string
- * @return the namespace of the SKOS schema
- */
- public static String getURI() {
- return uri;
- }
- /**
- * The namespace of the SKOS vocabulary
- */
- public static final Resource NAMESPACE = m.createResource( uri );
- /* ##########################################################
- * Defines SKOS Classes
- ########################################################## */
- public static final Resource Concept = m.createResource( uri + "Concept");
- public static final Resource ConceptScheme = m.createResource( uri + "ConceptScheme");
- public static final Resource Collection = m.createResource(uri + "Collection");
- public static final Resource OrderedCollection = m.createResource( uri + "OrderedCollection");
- /* ##########################################################
- * Defines SKOS Properties
- ########################################################## */
- // SKOS lexical label properties
- public static final Property prefLabel = m.createProperty( uri + "prefLabel");
- public static final Property altLabel = m.createProperty( uri + "altLabel");
- public static final Property hiddenLabel = m.createProperty( uri + "hiddenLabel");
- // SKOS documentation properties
- public static final Property definition = m.createProperty( uri + "definition");
- public static final Property note = m.createProperty( uri + "note");
- public static final Property scopeNote = m.createProperty( uri + "scopeNote");
- public static final Property historyNote = m.createProperty( uri + "historyNote");
- public static final Property changeNote = m.createProperty( uri + "changeNote");
- public static final Property editorialNote = m.createProperty( uri + "editorialNote");
- public static final Property example = m.createProperty( uri + "example");
- // SKOS notation properties
- public static final Property notation = m.createProperty( uri + "notation");
- // SKOS semantic relations properties
- public static final Property semanticRelation = m.createProperty( uri + "semanticRelation");
- public static final Property broaderTransitive = m.createProperty( uri + "broaderTransitive");
- public static final Property broader = m.createProperty( uri + "broader");
- public static final Property narrowerTransitive = m.createProperty( uri + "narrowerTransitive");
- public static final Property narrower = m.createProperty( uri + "narrower");
- public static final Property related = m.createProperty( uri + "related");
- // SKOS mapping properties
- public static final Property mappingRelation = m.createProperty( uri + "mappingRelation");
- public static final Property exactMatch = m.createProperty( uri + "exactMatch");
- public static final Property closeMatch = m.createProperty( uri + "closeMatch");
- public static final Property broadMatch = m.createProperty( uri + "broadMatch");
- public static final Property narrowMatch = m.createProperty( uri + "narrowMatch");
- public static final Property relatedMatch = m.createProperty( uri + "relatedMatch");
- // SKOS concept scheme properties
- public static final Property inScheme = m.createProperty( uri + "inScheme");
- public static final Property hasTopConcept = m.createProperty( uri + "hasTopConcept");
- public static final Property topConceptOf = m.createProperty( uri + "topConceptOf");
- // SKOS collection properties
- public static final Property member = m.createProperty( uri + "member");
- public static final Property memberList = m.createProperty( uri + "memberList");
-}
+/*
+ * 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.vocabulary;
+
+
+import org.apache.jena.rdf.model.Model ;
+import org.apache.jena.rdf.model.ModelFactory ;
+import org.apache.jena.rdf.model.Property ;
+import org.apache.jena.rdf.model.Resource ;
+
+/**
+ * Vocabulary definition for the
+ * <a href="http://www.w3.org/2009/08/skos-reference/skos.html">W3C SKOS Recommendation</a>.
+ */
+public class SKOS {
+ /**
+ * The RDF model that holds the SKOS entities
+ */
+ private static final Model m = ModelFactory.createDefaultModel();
+ /**
+ * The namespace of the SKOS vocabulary as a string
+ */
+ public static final String uri = "http://www.w3.org/2004/02/skos/core#";
+ /**
+ * Returns the namespace of the SKOS schema as a string
+ * @return the namespace of the SKOS schema
+ */
+ public static String getURI() {
+ return uri;
+ }
+ /**
+ * The namespace of the SKOS vocabulary
+ */
+ public static final Resource NAMESPACE = m.createResource( uri );
+ /* ##########################################################
+ * Defines SKOS Classes
+ ########################################################## */
+ public static final Resource Concept = m.createResource( uri + "Concept");
+ public static final Resource ConceptScheme = m.createResource( uri + "ConceptScheme");
+ public static final Resource Collection = m.createResource(uri + "Collection");
+ public static final Resource OrderedCollection = m.createResource( uri + "OrderedCollection");
+ /* ##########################################################
+ * Defines SKOS Properties
+ ########################################################## */
+ // SKOS lexical label properties
+ public static final Property prefLabel = m.createProperty( uri + "prefLabel");
+ public static final Property altLabel = m.createProperty( uri + "altLabel");
+ public static final Property hiddenLabel = m.createProperty( uri + "hiddenLabel");
+ // SKOS documentation properties
+ public static final Property definition = m.createProperty( uri + "definition");
+ public static final Property note = m.createProperty( uri + "note");
+ public static final Property scopeNote = m.createProperty( uri + "scopeNote");
+ public static final Property historyNote = m.createProperty( uri + "historyNote");
+ public static final Property changeNote = m.createProperty( uri + "changeNote");
+ public static final Property editorialNote = m.createProperty( uri + "editorialNote");
+ public static final Property example = m.createProperty( uri + "example");
+ // SKOS notation properties
+ public static final Property notation = m.createProperty( uri + "notation");
+ // SKOS semantic relations properties
+ public static final Property semanticRelation = m.createProperty( uri + "semanticRelation");
+ public static final Property broaderTransitive = m.createProperty( uri + "broaderTransitive");
+ public static final Property broader = m.createProperty( uri + "broader");
+ public static final Property narrowerTransitive = m.createProperty( uri + "narrowerTransitive");
+ public static final Property narrower = m.createProperty( uri + "narrower");
+ public static final Property related = m.createProperty( uri + "related");
+ // SKOS mapping properties
+ public static final Property mappingRelation = m.createProperty( uri + "mappingRelation");
+ public static final Property exactMatch = m.createProperty( uri + "exactMatch");
+ public static final Property closeMatch = m.createProperty( uri + "closeMatch");
+ public static final Property broadMatch = m.createProperty( uri + "broadMatch");
+ public static final Property narrowMatch = m.createProperty( uri + "narrowMatch");
+ public static final Property relatedMatch = m.createProperty( uri + "relatedMatch");
+ // SKOS concept scheme properties
+ public static final Property inScheme = m.createProperty( uri + "inScheme");
+ public static final Property hasTopConcept = m.createProperty( uri + "hasTopConcept");
+ public static final Property topConceptOf = m.createProperty( uri + "topConceptOf");
+ // SKOS collection properties
+ public static final Property member = m.createProperty( uri + "member");
+ public static final Property memberList = m.createProperty( uri + "memberList");
+}
http://git-wip-us.apache.org/repos/asf/jena/blob/d6ae87fd/jena-core/src/main/java/org/apache/jena/vocabulary/SKOSXL.java
----------------------------------------------------------------------
diff --git a/jena-core/src/main/java/org/apache/jena/vocabulary/SKOSXL.java b/jena-core/src/main/java/org/apache/jena/vocabulary/SKOSXL.java
index 05f4b0f..1b14ce2 100644
--- a/jena-core/src/main/java/org/apache/jena/vocabulary/SKOSXL.java
+++ b/jena-core/src/main/java/org/apache/jena/vocabulary/SKOSXL.java
@@ -1,62 +1,62 @@
-/*
- * 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.vocabulary;
-
-import org.apache.jena.rdf.model.Model ;
-import org.apache.jena.rdf.model.ModelFactory ;
-import org.apache.jena.rdf.model.Property ;
-import org.apache.jena.rdf.model.Resource ;
-
-/**
- * Vocabulary definition for the
- * <a href="http://www.w3.org/TR/skos-reference/skos-xl.html">W3C SKOS-XL Recommendation</a>.
- */
-public class SKOSXL {
- /**
- * The RDF model that holds the SKOS-XL entities
- */
- private static final Model m = ModelFactory.createDefaultModel();
- /**
- * The namespace of the SKOS-XL vocabulary as a string
- */
- public static final String uri = "http://www.w3.org/2008/05/skos-xl#";
- /**
- * Returns the namespace of the SKOS-XL schema as a string
- * @return the namespace of the SKOS-XL schema
- */
- public static String getURI() {
- return uri;
- }
- /**
- * The namespace of the SKOS-XL vocabulary
- */
- public static final Resource NAMESPACE = m.createResource( uri );
- /* ##########################################################
- * Defines SKOS-XL Classes
- ########################################################## */
- public static final Resource Label = m.createResource( uri + "Label");
- /* ##########################################################
- * Defines SKOS-XL Properties
- ########################################################## */
- public static final Property prefLabel = m.createProperty( uri + "prefLabel");
- public static final Property altLabel = m.createProperty( uri + "altLabel");
- public static final Property hiddenLabel = m.createProperty( uri + "hiddenLabel");
- public static final Property labelRelation = m.createProperty( uri + "labelRelation");
- public static final Property literalForm = m.createProperty( uri + "literalForm");
-}
+/*
+ * 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.vocabulary;
+
+import org.apache.jena.rdf.model.Model ;
+import org.apache.jena.rdf.model.ModelFactory ;
+import org.apache.jena.rdf.model.Property ;
+import org.apache.jena.rdf.model.Resource ;
+
+/**
+ * Vocabulary definition for the
+ * <a href="http://www.w3.org/TR/skos-reference/skos-xl.html">W3C SKOS-XL Recommendation</a>.
+ */
+public class SKOSXL {
+ /**
+ * The RDF model that holds the SKOS-XL entities
+ */
+ private static final Model m = ModelFactory.createDefaultModel();
+ /**
+ * The namespace of the SKOS-XL vocabulary as a string
+ */
+ public static final String uri = "http://www.w3.org/2008/05/skos-xl#";
+ /**
+ * Returns the namespace of the SKOS-XL schema as a string
+ * @return the namespace of the SKOS-XL schema
+ */
+ public static String getURI() {
+ return uri;
+ }
+ /**
+ * The namespace of the SKOS-XL vocabulary
+ */
+ public static final Resource NAMESPACE = m.createResource( uri );
+ /* ##########################################################
+ * Defines SKOS-XL Classes
+ ########################################################## */
+ public static final Resource Label = m.createResource( uri + "Label");
+ /* ##########################################################
+ * Defines SKOS-XL Properties
+ ########################################################## */
+ public static final Property prefLabel = m.createProperty( uri + "prefLabel");
+ public static final Property altLabel = m.createProperty( uri + "altLabel");
+ public static final Property hiddenLabel = m.createProperty( uri + "hiddenLabel");
+ public static final Property labelRelation = m.createProperty( uri + "labelRelation");
+ public static final Property literalForm = m.createProperty( uri + "literalForm");
+}
http://git-wip-us.apache.org/repos/asf/jena/blob/d6ae87fd/jena-csv/src/main/java/org/apache/jena/propertytable/Column.java
----------------------------------------------------------------------
diff --git a/jena-csv/src/main/java/org/apache/jena/propertytable/Column.java b/jena-csv/src/main/java/org/apache/jena/propertytable/Column.java
index 5650d07..50d7ebf 100644
--- a/jena-csv/src/main/java/org/apache/jena/propertytable/Column.java
+++ b/jena-csv/src/main/java/org/apache/jena/propertytable/Column.java
@@ -1,45 +1,45 @@
-/*
- * 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;
-
-import java.util.List;
-
-import org.apache.jena.graph.Node ;
-
-/**
- * Each Column of the PropertyTable has an unique columnKey Node of the predicate (or p for short).
- *
- */
-public interface Column {
-
- /**
- * @return the PropertyTable it belongs to
- */
- PropertyTable getTable();
-
- /**
- * @return the columnKey Node of the predicate
- */
- Node getColumnKey();
-
- /**
- * @return all the values within a Column
- */
- List<Node> getValues();
-
-}
+/*
+ * 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;
+
+import java.util.List;
+
+import org.apache.jena.graph.Node ;
+
+/**
+ * Each Column of the PropertyTable has an unique columnKey Node of the predicate (or p for short).
+ *
+ */
+public interface Column {
+
+ /**
+ * @return the PropertyTable it belongs to
+ */
+ PropertyTable getTable();
+
+ /**
+ * @return the columnKey Node of the predicate
+ */
+ Node getColumnKey();
+
+ /**
+ * @return all the values within a Column
+ */
+ List<Node> getValues();
+
+}
http://git-wip-us.apache.org/repos/asf/jena/blob/d6ae87fd/jena-csv/src/main/java/org/apache/jena/propertytable/PropertyTable.java
----------------------------------------------------------------------
diff --git a/jena-csv/src/main/java/org/apache/jena/propertytable/PropertyTable.java b/jena-csv/src/main/java/org/apache/jena/propertytable/PropertyTable.java
index 93b68c1..78c6967 100644
--- a/jena-csv/src/main/java/org/apache/jena/propertytable/PropertyTable.java
+++ b/jena-csv/src/main/java/org/apache/jena/propertytable/PropertyTable.java
@@ -1,126 +1,126 @@
-/*
- * 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;
-
-import java.util.Collection;
-import java.util.List;
-
-import org.apache.jena.graph.Node ;
-import org.apache.jena.graph.Triple ;
-import org.apache.jena.util.iterator.ExtendedIterator ;
-
-/**
- * PropertyTable is designed to be a table of RDF terms, or Nodes in Jena.
- * Each Column of the PropertyTable has an unique columnKey Node of the predicate (or p for short).
- * Each Row 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.
- *
- */
-public interface PropertyTable {
-
- /**
- * Query for ?s <p> <o>
- * @param column the Column with the columnKey Node of the predicate
- * @param value the object (or value) Node
- * @return the ExtendedIterator of the matching Triples
- */
- ExtendedIterator<Triple> getTripleIterator(Column column, Node value);
-
- /**
- * Query for ?s <p> ?o
- * @param column the Column with the columnKey Node of the predicate
- * @return the ExtendedIterator of the matching Triples
- */
- ExtendedIterator<Triple> getTripleIterator(Column column);
-
- /**
- * Query for ?s ?p <o>
- * @param value the object (or value) Node
- * @return the ExtendedIterator of the matching Triples
- */
- ExtendedIterator<Triple> getTripleIterator(Node value);
-
- /**
- * Query for <s> ?p ?o
- * @param row the Row with the rowKey Node of the subject
- * @return the ExtendedIterator of the matching Triples
- */
- ExtendedIterator<Triple> getTripleIterator(Row row);
-
- /**
- * Query for ?s ?p ?o
- * @return all of the Triples of the PropertyTable
- */
- ExtendedIterator<Triple> getTripleIterator();
-
- /**
- * @return all of the Columns of the PropertyTable
- */
- Collection<Column> getColumns();
-
- /**
- * Get Column by its columnKey Node of the predicate
- * @param p columnKey Node of the predicate
- * @return the Column
- */
- Column getColumn(Node p);
-
- /**
- * Create a Column by its columnKey Node of the predicate
- * @param p
- */
- Column createColumn(Node p);
-
- /**
- * Get Row by its rowKey Node of the subject
- * @param s rowKey Node of the subject
- * @return the Row
- */
- Row getRow(Node s);
-
-
- /**
- * Create Row by its rowKey Node of the subject
- * @param s rowKey Node of the subject
- * @return the Row created
- */
- Row createRow(Node s);
-
-
- /**
- * Get all of the rows
- */
- List<Row> getAllRows() ;
-
-
- /**
- * Get all the values within a Column
- * @param column
- * @return the values
- */
- List<Node> getColumnValues(Column column);
-
- /**
- * Get the Rows matching the value of a Column
- * @param column the Column with the columnKey Node of the predicate
- * @param value the object (or value) Node
- * @return the matching Rows
- */
- Collection<Row> getMatchingRows(Column column, Node value);
-
-}
+/*
+ * 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;
+
+import java.util.Collection;
+import java.util.List;
+
+import org.apache.jena.graph.Node ;
+import org.apache.jena.graph.Triple ;
+import org.apache.jena.util.iterator.ExtendedIterator ;
+
+/**
+ * PropertyTable is designed to be a table of RDF terms, or Nodes in Jena.
+ * Each Column of the PropertyTable has an unique columnKey Node of the predicate (or p for short).
+ * Each Row 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.
+ *
+ */
+public interface PropertyTable {
+
+ /**
+ * Query for ?s <p> <o>
+ * @param column the Column with the columnKey Node of the predicate
+ * @param value the object (or value) Node
+ * @return the ExtendedIterator of the matching Triples
+ */
+ ExtendedIterator<Triple> getTripleIterator(Column column, Node value);
+
+ /**
+ * Query for ?s <p> ?o
+ * @param column the Column with the columnKey Node of the predicate
+ * @return the ExtendedIterator of the matching Triples
+ */
+ ExtendedIterator<Triple> getTripleIterator(Column column);
+
+ /**
+ * Query for ?s ?p <o>
+ * @param value the object (or value) Node
+ * @return the ExtendedIterator of the matching Triples
+ */
+ ExtendedIterator<Triple> getTripleIterator(Node value);
+
+ /**
+ * Query for <s> ?p ?o
+ * @param row the Row with the rowKey Node of the subject
+ * @return the ExtendedIterator of the matching Triples
+ */
+ ExtendedIterator<Triple> getTripleIterator(Row row);
+
+ /**
+ * Query for ?s ?p ?o
+ * @return all of the Triples of the PropertyTable
+ */
+ ExtendedIterator<Triple> getTripleIterator();
+
+ /**
+ * @return all of the Columns of the PropertyTable
+ */
+ Collection<Column> getColumns();
+
+ /**
+ * Get Column by its columnKey Node of the predicate
+ * @param p columnKey Node of the predicate
+ * @return the Column
+ */
+ Column getColumn(Node p);
+
+ /**
+ * Create a Column by its columnKey Node of the predicate
+ * @param p
+ */
+ Column createColumn(Node p);
+
+ /**
+ * Get Row by its rowKey Node of the subject
+ * @param s rowKey Node of the subject
+ * @return the Row
+ */
+ Row getRow(Node s);
+
+
+ /**
+ * Create Row by its rowKey Node of the subject
+ * @param s rowKey Node of the subject
+ * @return the Row created
+ */
+ Row createRow(Node s);
+
+
+ /**
+ * Get all of the rows
+ */
+ List<Row> getAllRows() ;
+
+
+ /**
+ * Get all the values within a Column
+ * @param column
+ * @return the values
+ */
+ List<Node> getColumnValues(Column column);
+
+ /**
+ * Get the Rows matching the value of a Column
+ * @param column the Column with the columnKey Node of the predicate
+ * @param value the object (or value) Node
+ * @return the matching Rows
+ */
+ Collection<Row> getMatchingRows(Column column, Node value);
+
+}
http://git-wip-us.apache.org/repos/asf/jena/blob/d6ae87fd/jena-csv/src/main/java/org/apache/jena/propertytable/Row.java
----------------------------------------------------------------------
diff --git a/jena-csv/src/main/java/org/apache/jena/propertytable/Row.java b/jena-csv/src/main/java/org/apache/jena/propertytable/Row.java
index 3824d8f..cb2ae9b 100644
--- a/jena-csv/src/main/java/org/apache/jena/propertytable/Row.java
+++ b/jena-csv/src/main/java/org/apache/jena/propertytable/Row.java
@@ -1,75 +1,75 @@
-/*
- * 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;
-
-import java.util.Collection;
-
-import org.apache.jena.graph.Node ;
-import org.apache.jena.graph.Triple ;
-import org.apache.jena.util.iterator.ExtendedIterator ;
-
-/**
- * Each Row of the PropertyTable has an unique rowKey Node of the subject (or s for short).
- *
- */
-public interface Row {
-
- /**
- * @return the PropertyTable it belongs to
- */
- PropertyTable getTable();
-
- /**
- * Set the value of the Column in this Row
- * @param column
- * @param value
- */
- void setValue(Column column, Node value);
-
- /**
- * Get the value of the Column in this Row
- * @param column
- * @return value
- */
- Node getValue(Column column);
-
-
- /**
- * Get the value of the Column in this Row
- * @param ColumnKey
- * @return value
- */
- Node getValue(Node ColumnKey);
-
- /**
- * @return the rowKey Node of the subject
- */
- Node getRowKey();
-
- /**
- * @return the Triple Iterator over the values in this Row
- */
- ExtendedIterator<Triple> getTripleIterator();
-
- /**
- * @return all of the Columns of the PropertyTable
- */
- Collection<Column> getColumns();
-
-}
+/*
+ * 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;
+
+import java.util.Collection;
+
+import org.apache.jena.graph.Node ;
+import org.apache.jena.graph.Triple ;
+import org.apache.jena.util.iterator.ExtendedIterator ;
+
+/**
+ * Each Row of the PropertyTable has an unique rowKey Node of the subject (or s for short).
+ *
+ */
+public interface Row {
+
+ /**
+ * @return the PropertyTable it belongs to
+ */
+ PropertyTable getTable();
+
+ /**
+ * Set the value of the Column in this Row
+ * @param column
+ * @param value
+ */
+ void setValue(Column column, Node value);
+
+ /**
+ * Get the value of the Column in this Row
+ * @param column
+ * @return value
+ */
+ Node getValue(Column column);
+
+
+ /**
+ * Get the value of the Column in this Row
+ * @param ColumnKey
+ * @return value
+ */
+ Node getValue(Node ColumnKey);
+
+ /**
+ * @return the rowKey Node of the subject
+ */
+ Node getRowKey();
+
+ /**
+ * @return the Triple Iterator over the values in this Row
+ */
+ ExtendedIterator<Triple> getTripleIterator();
+
+ /**
+ * @return all of the Columns of the PropertyTable
+ */
+ Collection<Column> getColumns();
+
+}
http://git-wip-us.apache.org/repos/asf/jena/blob/d6ae87fd/jena-csv/src/main/java/org/apache/jena/propertytable/graph/GraphCSV.java
----------------------------------------------------------------------
diff --git a/jena-csv/src/main/java/org/apache/jena/propertytable/graph/GraphCSV.java b/jena-csv/src/main/java/org/apache/jena/propertytable/graph/GraphCSV.java
index d002ec6..4f2e3fd 100644
--- a/jena-csv/src/main/java/org/apache/jena/propertytable/graph/GraphCSV.java
+++ b/jena-csv/src/main/java/org/apache/jena/propertytable/graph/GraphCSV.java
@@ -1,62 +1,62 @@
-/*
- * 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.graph;
-
-import org.apache.jena.propertytable.PropertyTable;
-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 ){
- return new GraphCSVHashMapImpl(csvFilePath);
- }
-
- public static GraphCSV createArrayImpl( String csvFilePath ){
- return new GraphCSVArrayImpl(csvFilePath);
- }
-
- protected GraphCSV (PropertyTable table) {
- super(table);
- }
-
- // use the Java array implementation of PropertyTable for default
- public GraphCSV ( String csvFilePath ){
- super(PropertyTableBuilder.buildPropetyTableArrayImplFromCsv(csvFilePath));
- }
-}
-
-
-class GraphCSVHashMapImpl extends GraphCSV{
- protected GraphCSVHashMapImpl(String csvFilePath){
- super(PropertyTableBuilder.buildPropetyTableHashMapImplFromCsv(csvFilePath));
- }
-}
-
-class GraphCSVArrayImpl extends GraphCSV{
- protected GraphCSVArrayImpl(String csvFilePath){
- super(PropertyTableBuilder.buildPropetyTableArrayImplFromCsv(csvFilePath));
- }
-}
+/*
+ * 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.graph;
+
+import org.apache.jena.propertytable.PropertyTable;
+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 ){
+ return new GraphCSVHashMapImpl(csvFilePath);
+ }
+
+ public static GraphCSV createArrayImpl( String csvFilePath ){
+ return new GraphCSVArrayImpl(csvFilePath);
+ }
+
+ protected GraphCSV (PropertyTable table) {
+ super(table);
+ }
+
+ // use the Java array implementation of PropertyTable for default
+ public GraphCSV ( String csvFilePath ){
+ super(PropertyTableBuilder.buildPropetyTableArrayImplFromCsv(csvFilePath));
+ }
+}
+
+
+class GraphCSVHashMapImpl extends GraphCSV{
+ protected GraphCSVHashMapImpl(String csvFilePath){
+ super(PropertyTableBuilder.buildPropetyTableHashMapImplFromCsv(csvFilePath));
+ }
+}
+
+class GraphCSVArrayImpl extends GraphCSV{
+ protected GraphCSVArrayImpl(String csvFilePath){
+ super(PropertyTableBuilder.buildPropetyTableArrayImplFromCsv(csvFilePath));
+ }
+}