org.openrdf.repository.EquivalentTest Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sesame-store-testsuite Show documentation
Show all versions of sesame-store-testsuite Show documentation
Test suite for SAIL and Repository API
/*
* Licensed to Aduna under one or more contributor license agreements.
* See the NOTICE.txt file distributed with this work for additional
* information regarding copyright ownership.
*
* Aduna licenses this file to you under the terms of the Aduna BSD
* License (the "License"); you may not use this file except in compliance
* with the License. See the LICENSE.txt file distributed with this work
* for the full License.
*
* 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.openrdf.repository;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.util.Collection;
import java.util.LinkedList;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import org.openrdf.model.Literal;
import org.openrdf.model.IRI;
import org.openrdf.model.Value;
import org.openrdf.model.ValueFactory;
import org.openrdf.model.impl.SimpleValueFactory;
import org.openrdf.model.vocabulary.RDF;
import org.openrdf.model.vocabulary.XMLSchema;
import org.openrdf.query.MalformedQueryException;
import org.openrdf.query.QueryEvaluationException;
import org.openrdf.query.QueryLanguage;
import org.openrdf.query.TupleQuery;
import org.openrdf.query.TupleQueryResult;
@RunWith(Parameterized.class)
public abstract class EquivalentTest {
private static ValueFactory vf = SimpleValueFactory.getInstance();
private static Literal xyz_simple = vf.createLiteral("xyz");
private static Literal xyz_en = vf.createLiteral("xyz", "en");
private static Literal xyz_EN = vf.createLiteral("xyz", "EN");
private static Literal xyz_string = vf.createLiteral("xyz", XMLSchema.STRING);
private static Literal xyz_integer = vf.createLiteral("xyz", XMLSchema.INTEGER);
private static Literal xyz_unknown = vf.createLiteral("xyz", vf.createIRI("http://example/unknown"));
private static IRI xyz_uri = vf.createIRI("http://example/xyz");
private static Literal abc_simple = vf.createLiteral("abc");
private static Literal abc_en = vf.createLiteral("abc", "en");
private static Literal abc_EN = vf.createLiteral("abc", "EN");
private static Literal abc_string = vf.createLiteral("abc", XMLSchema.STRING);
private static Literal abc_integer = vf.createLiteral("abc", XMLSchema.INTEGER);
private static Literal abc_unknown = vf.createLiteral("abc", vf.createIRI("http://example/unknown"));
private static IRI abc_uri = vf.createIRI("http://example/abc");
private static IRI t1 = vf.createIRI("http://example/t1");
private static IRI t2 = vf.createIRI("http://example/t2");
private static final String IND = "?";
private static final String EQ = "=";
private static final String NEQ = "!=";
private static final String PREFIX = "PREFIX xsd:\n"
+ "PREFIX rdf:" + "PREFIX ex: ";
private static String matrix = "\"xyz\" \"xyz\" eq\n" + "\"xyz\" \"xyz\"@en neq\n"
+ "\"xyz\" \"xyz\"@EN neq\n" + "\"xyz\" \"xyz\"^^xsd:string eq\n"
+ "\"xyz\" \"xyz\"^^xsd:integer ind\n" + "\"xyz\" \"xyz\"^^ex:unknown ind\n" + "\"xyz\" _:xyz neq\n"
+ "\"xyz\" :xyz neq\n" + "\"xyz\"@en \"xyz\" neq\n" + "\"xyz\"@en \"xyz\"@en eq\n"
+ "\"xyz\"@en \"xyz\"@EN eq\n" + "\"xyz\"@en \"xyz\"^^xsd:string neq\n"
+ "\"xyz\"@en \"xyz\"^^xsd:integer neq\n" + "\"xyz\"@en \"xyz\"^^ex:unknown neq\n"
+ "\"xyz\"@en _:xyz neq\n" + "\"xyz\"@en :xyz neq\n" + "\"xyz\"@EN \"xyz\" neq\n"
+ "\"xyz\"@EN \"xyz\"@en eq\n" + "\"xyz\"@EN \"xyz\"@EN eq\n"
+ "\"xyz\"@EN \"xyz\"^^xsd:string neq\n" + "\"xyz\"@EN \"xyz\"^^xsd:integer neq\n"
+ "\"xyz\"@EN \"xyz\"^^ex:unknown neq\n" + "\"xyz\"@EN _:xyz neq\n" + "\"xyz\"@EN :xyz neq\n"
+ "\"xyz\"^^xsd:string \"xyz\" eq\n" + "\"xyz\"^^xsd:string \"xyz\"@en neq\n"
+ "\"xyz\"^^xsd:string \"xyz\"@EN neq\n" + "\"xyz\"^^xsd:string \"xyz\"^^xsd:string eq\n"
+ "\"xyz\"^^xsd:string \"xyz\"^^xsd:integer ind\n" + "\"xyz\"^^xsd:string \"xyz\"^^ex:unknown ind\n"
+ "\"xyz\"^^xsd:string _:xyz neq\n" + "\"xyz\"^^xsd:string :xyz neq\n"
+ "\"xyz\"^^xsd:integer \"xyz\" ind\n" + "\"xyz\"^^xsd:integer \"xyz\"@en neq\n"
+ "\"xyz\"^^xsd:integer \"xyz\"@EN neq\n" + "\"xyz\"^^xsd:integer \"xyz\"^^xsd:string ind\n"
+ "\"xyz\"^^xsd:integer \"xyz\"^^xsd:integer eq\n"
+ "\"xyz\"^^xsd:integer \"xyz\"^^ex:unknown ind\n" + "\"xyz\"^^xsd:integer _:xyz neq\n"
+ "\"xyz\"^^xsd:integer :xyz neq\n" + "\"xyz\"^^ex:unknown \"xyz\" ind\n"
+ "\"xyz\"^^ex:unknown \"xyz\"@en neq\n" + "\"xyz\"^^ex:unknown \"xyz\"@EN neq\n"
+ "\"xyz\"^^ex:unknown \"xyz\"^^xsd:string ind\n" + "\"xyz\"^^ex:unknown \"xyz\"^^xsd:integer ind\n"
+ "\"xyz\"^^ex:unknown \"xyz\"^^ex:unknown eq\n" + "\"xyz\"^^ex:unknown _:xyz neq\n"
+ "\"xyz\"^^ex:unknown :xyz neq\n" + "_:xyz \"xyz\" neq\n" + "_:xyz \"xyz\"@en neq\n"
+ "_:xyz \"xyz\"@EN neq\n" + "_:xyz \"xyz\"^^xsd:string neq\n" + "_:xyz \"xyz\"^^xsd:integer neq\n"
+ "_:xyz \"xyz\"^^ex:unknown neq\n" + "_:xyz _:xyz eq\n" + "_:xyz :xyz neq\n" + ":xyz \"xyz\" neq\n"
+ ":xyz \"xyz\"@en neq\n" + ":xyz \"xyz\"@EN neq\n" + ":xyz \"xyz\"^^xsd:string neq\n"
+ ":xyz \"xyz\"^^xsd:integer neq\n" + ":xyz \"xyz\"^^ex:unknown neq\n" + ":xyz _:xyz neq\n"
+ ":xyz :xyz eq\n" + "\"xyz\" \"abc\" neq \n" + "\"xyz\" \"abc\"@en neq \n"
+ "\"xyz\" \"abc\"@EN neq \n" + "\"xyz\" \"abc\"^^xsd:string neq \n"
+ "\"xyz\" \"abc\"^^xsd:integer ind\n" + "\"xyz\" \"abc\"^^:unknown ind\n"
+ "\"xyz\" _:abc neq \n" + "\"xyz\" :abc neq \n" + "\"xyz\"@en \"abc\" neq \n"
+ "\"xyz\"@en \"abc\"@en neq \n" + "\"xyz\"@en \"abc\"@EN neq \n"
+ "\"xyz\"@en \"abc\"^^xsd:string neq \n" + "\"xyz\"@en \"abc\"^^xsd:integer neq \n"
+ "\"xyz\"@en \"abc\"^^:unknown neq \n" + "\"xyz\"@en _:abc neq \n" + "\"xyz\"@en :abc neq \n"
+ "\"xyz\"@EN \"abc\" neq \n" + "\"xyz\"@EN \"abc\"@en neq \n" + "\"xyz\"@EN \"abc\"@EN neq \n"
+ "\"xyz\"@EN \"abc\"^^xsd:string neq \n" + "\"xyz\"@EN \"abc\"^^xsd:integer neq \n"
+ "\"xyz\"@EN \"abc\"^^:unknown neq \n" + "\"xyz\"@EN _:abc neq \n" + "\"xyz\"@EN :abc neq \n"
+ "\"xyz\"^^xsd:string \"abc\" neq \n" + "\"xyz\"^^xsd:string \"abc\"@en neq \n"
+ "\"xyz\"^^xsd:string \"abc\"@EN neq \n" + "\"xyz\"^^xsd:string \"abc\"^^xsd:string neq \n"
+ "\"xyz\"^^xsd:string \"abc\"^^xsd:integer ind\n"
+ "\"xyz\"^^xsd:string \"abc\"^^:unknown ind\n" + "\"xyz\"^^xsd:string _:abc neq \n"
+ "\"xyz\"^^xsd:string :abc neq \n" + "\"xyz\"^^xsd:integer \"abc\" ind\n"
+ "\"xyz\"^^xsd:integer \"abc\"@en neq \n" + "\"xyz\"^^xsd:integer \"abc\"@EN neq \n"
+ "\"xyz\"^^xsd:integer \"abc\"^^xsd:string ind\n"
+ "\"xyz\"^^xsd:integer \"abc\"^^xsd:integer ind\n"
+ "\"xyz\"^^xsd:integer \"abc\"^^:unknown ind\n" + "\"xyz\"^^xsd:integer _:abc neq \n"
+ "\"xyz\"^^xsd:integer :abc neq \n" + "\"xyz\"^^:unknown \"abc\" ind\n"
+ "\"xyz\"^^:unknown \"abc\"@en neq \n" + "\"xyz\"^^:unknown \"abc\"@EN neq \n"
+ "\"xyz\"^^:unknown \"abc\"^^xsd:string ind\n" + "\"xyz\"^^:unknown \"abc\"^^xsd:integer ind\n"
+ "\"xyz\"^^:unknown \"abc\"^^:unknown ind\n" + "\"xyz\"^^:unknown _:abc neq \n"
+ "\"xyz\"^^:unknown :abc neq \n" + "_:xyz \"abc\" neq \n" + "_:xyz \"abc\"@en neq \n"
+ "_:xyz \"abc\"@EN neq \n" + "_:xyz \"abc\"^^xsd:string neq \n"
+ "_:xyz \"abc\"^^xsd:integer neq \n" + "_:xyz \"abc\"^^:unknown neq \n" + "_:xyz _:abc neq \n"
+ "_:xyz :abc neq \n" + ":xyz \"abc\" neq \n" + ":xyz \"abc\"@en neq \n"
+ ":xyz \"abc\"@EN neq \n" + ":xyz \"abc\"^^xsd:string neq \n"
+ ":xyz \"abc\"^^xsd:integer neq \n" + ":xyz \"abc\"^^:unknown neq \n" + ":xyz _:abc neq \n"
+ ":xyz :abc neq ";
@Parameters(name = "{1} {0} {2}")
public static Collection
© 2015 - 2024 Weber Informatics LLC | Privacy Policy