http://git-wip-us.apache.org/repos/asf/jena/blob/4b5cd267/jena-arq/src/test/java/org/apache/jena/riot/TestRiotReader.java ---------------------------------------------------------------------- diff --cc jena-arq/src/test/java/org/apache/jena/riot/TestRiotReader.java index b54df07,b54df07..24f4738 --- 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 +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("âº", it.next().getObject().getLiteralLexicalForm()); -- } -- -- @Test -- public void testRawUTF8() -- { -- Iterator<Triple> it = RDFDataMgr.createIteratorTriples(new ByteArrayInputStream("<a> <b> \"âº\" .".getBytes(StandardCharsets.UTF_8)), RDFLanguages.NTRIPLES, null); -- -- assertTrue(it.hasNext()); -- assertEquals("âº", 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("âº", it.next().getObject().getLiteralLexicalForm()); ++ } ++ ++ @Test ++ public void testRawUTF8() ++ { ++ Iterator<Triple> it = RDFDataMgr.createIteratorTriples(new ByteArrayInputStream("<a> <b> \"âº\" .".getBytes(StandardCharsets.UTF_8)), RDFLanguages.NTRIPLES, null); ++ ++ assertTrue(it.hasNext()); ++ assertEquals("âº", 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/4b5cd267/jena-arq/src/test/java/org/apache/jena/sparql/engine/index/TestIndexTable.java ---------------------------------------------------------------------- diff --cc jena-arq/src/test/java/org/apache/jena/sparql/engine/index/TestIndexTable.java index 30ff9d4,30ff9d4..5c14139 --- 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 +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/4b5cd267/jena-arq/src/test/java/org/apache/jena/sparql/expr/TestFunctions.java ---------------------------------------------------------------------- diff --cc jena-arq/src/test/java/org/apache/jena/sparql/expr/TestFunctions.java index 95b2cd3,5b4c5fc..1c9c30e --- a/jena-arq/src/test/java/org/apache/jena/sparql/expr/TestFunctions.java +++ b/jena-arq/src/test/java/org/apache/jena/sparql/expr/TestFunctions.java @@@ -18,14 -18,14 +18,20 @@@ package org.apache.jena.sparql.expr; --import static org.junit.Assert.* ; ++import static org.junit.Assert.assertEquals ; ++import static org.junit.Assert.assertFalse ; ++import static org.junit.Assert.assertTrue ; ++import static org.junit.Assert.fail ; ++ ++import java.text.ParseException; ++import java.text.SimpleDateFormat; ++import java.util.Date; ++import java.util.TimeZone; ++ import org.apache.jena.datatypes.xsd.XSDDatatype ; import org.apache.jena.graph.Node ; import org.apache.jena.graph.NodeFactory ; import org.apache.jena.sparql.ARQConstants ; --import org.apache.jena.sparql.expr.Expr ; --import org.apache.jena.sparql.expr.ExprEvalException ; --import org.apache.jena.sparql.expr.NodeValue ; import org.apache.jena.sparql.function.FunctionEnvBase ; import org.apache.jena.sparql.util.ExprUtils ; import org.junit.Test ; @@@ -76,33 -84,40 +82,63 @@@ public class TestFunction @Test public void exprSprintf_02() { test("afn:sprintf('%s', 'abcdefghi')",NodeValue.makeString("abcdefghi")) ; } @Test public void exprSprintf_03() { test("afn:sprintf('sometext %s', 'abcdefghi')",NodeValue.makeString("sometext abcdefghi")) ; } @Test public void exprSprintf_04() { test("afn:sprintf('%1$tm %1$te,%1$tY', '2016-03-17'^^xsd:date)",NodeValue.makeString("03 17,2016")) ; } --// @Test public void exprSprintf_05() { --// String nodeStr = NodeValue.makeDateTime("2005-10-14T13:09:43Z").toString(); --// test("afn:sprintf('%1$tm %1$te,%1$tY', "+nodeStr+")",NodeValue.makeString("10 14,2005")) ; --// } - private static void test_exprSprintf_05(String nodeStr, String... possible) { - private static void test_exprSprintf_05(String nodeStr) { ++ // Calculate the expected answer by using SimpleDateFormat ++ private static void test_exprSprintf_05_V1(String nodeStr) { + String exprStr = "afn:sprintf('%1$tm %1$te,%1$tY', "+NodeValue.makeDateTime(nodeStr).toString()+")" ; + Expr expr = ExprUtils.parse(exprStr) ; + NodeValue r = expr.eval(null, FunctionEnvBase.createTest()) ; + assertTrue(r.isString()) ; + String s = r.getString() ; + // Parse the date + String dtFormat = "yyyy-MM-dd'T'HH:mm:ssXXX"; + SimpleDateFormat sdtFormat = new SimpleDateFormat(dtFormat); + Date dtDate = null; + try { + dtDate = sdtFormat.parse(nodeStr); + } catch (ParseException e) { + assertFalse("Cannot parse the input date string. Message:"+e.getMessage(),false); + } + // print the date based on the current timeZone. + SimpleDateFormat stdFormatOut = new SimpleDateFormat("MM dd,yyyy"); + stdFormatOut.setTimeZone(TimeZone.getDefault()); + String outDate = stdFormatOut.format(dtDate); + assertEquals(s,outDate); + } + + // Temporary fix for JENA-1175 + // Timezone -11:00 to any timezone can be a day ahead - @Test public void exprSprintf_05a() { test_exprSprintf_05("2005-10-14T14:09:43-11:00") ; } ++ @Test public void exprSprintf_05a() { test_exprSprintf_05_V1("2005-10-14T14:09:43-11:00") ; } ++ // Timezone Z to any timezone can be a day behind or a day ahead ++ @Test public void exprSprintf_05b() { test_exprSprintf_05_V1("2005-10-14T12:09:43+00:00") ; } ++ // Timezone +11:00 can be a day behind ++ @Test public void exprSprintf_05c() { test_exprSprintf_05_V1("2005-10-14T10:09:43+11:00") ; } ++ ++ // Accept alternative possible "right" answers. ++ private static void test_exprSprintf_05_V2(String nodeStr, String... possible) { + String exprStr = "afn:sprintf('%1$tm %1$te,%1$tY', "+NodeValue.makeDateTime(nodeStr).toString()+")" ; + Expr expr = ExprUtils.parse(exprStr) ; + NodeValue r = expr.eval(null, FunctionEnvBase.createTest()) ; + assertTrue(r.isString()) ; + String s = r.getString() ; + // Timezones! The locale data can be -1, 0, +1 from the Z day. + boolean b = false ; + for (String poss : possible ) { + if ( poss.equals(s) ) + b = true ; + } + assertTrue(b) ; + } + + // Temporary fix for JENA-1175 + // Timezone -11:00 to any timezone can be a day ahead - @Test public void exprSprintf_05a() { test_exprSprintf_05("2005-10-14T14:09:43-11:00", "10 14,2005", "10 15,2005") ; } ++ @Test public void exprSprintf_05d() { test_exprSprintf_05_V2("2005-10-14T14:09:43-11:00", "10 14,2005", "10 15,2005") ; } // Timezone Z to any timezone can be a day behind or a day ahead - @Test public void exprSprintf_05b() { test_exprSprintf_05("2005-10-14T12:09:43Z", "10 13,2005", "10 14,2005", "10 15,2005") ; } - @Test public void exprSprintf_05b() { test_exprSprintf_05("2005-10-14T12:09:43+00:00") ; } ++ @Test public void exprSprintf_05e() { test_exprSprintf_05_V2("2005-10-14T12:09:43Z", "10 13,2005", "10 14,2005", "10 15,2005") ; } // Timezone +11:00 can be a day behind - @Test public void exprSprintf_05c() { test_exprSprintf_05("2005-10-14T10:09:43+11:00", "10 13,2005", "10 14,2005") ; } - @Test public void exprSprintf_05d() { test_exprSprintf_05("2005-10-14T10:09:43+11:00") ; } ++ @Test public void exprSprintf_05f() { test_exprSprintf_05_V2("2005-10-14T10:09:43+11:00", "10 13,2005", "10 14,2005") ; } ++ ++ @Test public void exprSprintf_06() { test("afn:sprintf('this is %s', 'false'^^xsd:boolean)",NodeValue.makeString("this is false")) ; } @Test public void exprSprintf_07() { test("afn:sprintf('this number is equal to %.2f', '11.22'^^xsd:decimal)",NodeValue.makeString("this number is equal to "+String.format("%.2f",11.22))) ; } http://git-wip-us.apache.org/repos/asf/jena/blob/4b5cd267/jena-arq/src/test/java/org/apache/jena/web/AbstractTestDatasetGraphAccessor.java ---------------------------------------------------------------------- diff --cc jena-arq/src/test/java/org/apache/jena/web/AbstractTestDatasetGraphAccessor.java index e013f0c,e013f0c..1aececa --- 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 +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 +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 +46,135 @@@ 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/4b5cd267/jena-arq/src/test/java/org/apache/jena/web/TestDatasetGraphAccessorMem.java ---------------------------------------------------------------------- diff --cc jena-arq/src/test/java/org/apache/jena/web/TestDatasetGraphAccessorMem.java index f2a633a,f2a633a..14295c3 --- 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 +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/4b5cd267/jena-arq/src/test/resources/test.csv ---------------------------------------------------------------------- diff --cc jena-arq/src/test/resources/test.csv index b9ac0e1,b9ac0e1..306e493 --- a/jena-arq/src/test/resources/test.csv +++ b/jena-arq/src/test/resources/test.csv @@@ -1,3 -1,3 +1,3 @@@ --Town,Population,Predicate With Space,`~!@#$%^&*()-_=+[{]}|\;:'"<.>/?,1234 --Southton,123000.0,PredicateWithSpace1,NonURICharacters1,DigitalLocalName1 --Northville,654000,PredicateWithSpace2,NonURICharacters2,DigitalLocalName2 ++Town,Population,Predicate With Space,`~!@#$%^&*()-_=+[{]}|\;:'"<.>/?,1234 ++Southton,123000.0,PredicateWithSpace1,NonURICharacters1,DigitalLocalName1 ++Northville,654000,PredicateWithSpace2,NonURICharacters2,DigitalLocalName2 http://git-wip-us.apache.org/repos/asf/jena/blob/4b5cd267/jena-arq/testing/ARQ/Construct/results-construct-quad-data-2.ttl ---------------------------------------------------------------------- diff --cc jena-arq/testing/ARQ/Construct/results-construct-quad-data-2.ttl index 9a434a5,9a434a5..858a0bc --- 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 +1,2 @@@ --@prefix : <http://example.org/ns#> . ++@prefix : <http://example.org/ns#> . :s :p :o . http://git-wip-us.apache.org/repos/asf/jena/blob/4b5cd267/jena-arq/testing/ARQ/Construct/results-construct-quad-dataset.trig ---------------------------------------------------------------------- diff --cc jena-arq/testing/ARQ/Construct/results-construct-quad-dataset.trig index 2ca2b27,2ca2b27..2dd369a --- 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 +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 } http://git-wip-us.apache.org/repos/asf/jena/blob/4b5cd267/jena-arq/testing/ARQ/Construct/results-construct-quad-default-graph.ttl ---------------------------------------------------------------------- diff --cc jena-arq/testing/ARQ/Construct/results-construct-quad-default-graph.ttl index f07c90c,f07c90c..c39d57f --- 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 +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/4b5cd267/jena-arq/testing/ARQ/Construct/results-construct-quad-named-graph.trig ---------------------------------------------------------------------- diff --cc jena-arq/testing/ARQ/Construct/results-construct-quad-named-graph.trig index 876197f,876197f..d789da4 --- 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 +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 } http://git-wip-us.apache.org/repos/asf/jena/blob/4b5cd267/jena-arq/testing/ARQ/Construct/results-construct-quad-short-form-1.trig ---------------------------------------------------------------------- diff --cc jena-arq/testing/ARQ/Construct/results-construct-quad-short-form-1.trig index f95c57b,f95c57b..7ed6d7f --- 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 +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 } http://git-wip-us.apache.org/repos/asf/jena/blob/4b5cd267/jena-arq/testing/ARQ/Construct/results-construct-quad-short-form-2.ttl ---------------------------------------------------------------------- diff --cc jena-arq/testing/ARQ/Construct/results-construct-quad-short-form-2.ttl index 9a434a5,9a434a5..858a0bc --- 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 +1,2 @@@ --@prefix : <http://example.org/ns#> . ++@prefix : <http://example.org/ns#> . :s :p :o . http://git-wip-us.apache.org/repos/asf/jena/blob/4b5cd267/jena-arq/testing/ARQ/Construct/results-construct-quad-short-form-3.trig ---------------------------------------------------------------------- diff --cc jena-arq/testing/ARQ/Construct/results-construct-quad-short-form-3.trig index ab87333,ab87333..6b48ffd --- 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 +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 } http://git-wip-us.apache.org/repos/asf/jena/blob/4b5cd267/jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-1.trig ---------------------------------------------------------------------- diff --cc jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-1.trig index ee42de7,ee42de7..78c9d04 --- 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 +1,2 @@@ --@prefix : <http://example.org/ns#> . ++@prefix : <http://example.org/ns#> . :g {:s :p :o } http://git-wip-us.apache.org/repos/asf/jena/blob/4b5cd267/jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-3.ttl ---------------------------------------------------------------------- diff --cc jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-3.ttl index 8914bbe,8914bbe..0cb2bd7 --- 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 +1,2 @@@ --@prefix : <http://example.org/ns#> . ++@prefix : <http://example.org/ns#> . :s :p :o http://git-wip-us.apache.org/repos/asf/jena/blob/4b5cd267/jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-4.trig ---------------------------------------------------------------------- diff --cc jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-4.trig index eb40f00,eb40f00..7fdc75d --- 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 +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} http://git-wip-us.apache.org/repos/asf/jena/blob/4b5cd267/jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-5.trig ---------------------------------------------------------------------- diff --cc jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-5.trig index eb40f00,eb40f00..7fdc75d --- 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 +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} http://git-wip-us.apache.org/repos/asf/jena/blob/4b5cd267/jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-6.trig ---------------------------------------------------------------------- diff --cc jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-6.trig index 9ddbf74,9ddbf74..67d9665 --- 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 +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 .} http://git-wip-us.apache.org/repos/asf/jena/blob/4b5cd267/jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-7.ttl ---------------------------------------------------------------------- diff --cc jena-arq/testing/ARQ/Construct/results-construct-quad-syntax-7.ttl index 8914bbe,8914bbe..0cb2bd7 --- 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 +1,2 @@@ --@prefix : <http://example.org/ns#> . ++@prefix : <http://example.org/ns#> . :s :p :o http://git-wip-us.apache.org/repos/asf/jena/blob/4b5cd267/jena-arq/testing/RIOT/Lang/TrigStd/literal_with_CARRIAGE_RETURN.trig ---------------------------------------------------------------------- diff --cc jena-arq/testing/RIOT/Lang/TrigStd/literal_with_CARRIAGE_RETURN.trig index 18d6fe8,18d6fe8..0be04a9 --- 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 +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> ''' ''' .}
