All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.bigdata.rdf.sparql.ast.eval.TestUnions Maven / Gradle / Ivy

There is a newer version: 2.1.4
Show newest version
/**

Copyright (C) SYSTAP, LLC DBA Blazegraph 2006-2016.  All rights reserved.

Contact:
     SYSTAP, LLC DBA Blazegraph
     2501 Calvert ST NW #106
     Washington, DC 20008
     [email protected]

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
/*
 * Created on Oct 24, 2011
 */

package com.bigdata.rdf.sparql.ast.eval;

/**
 * Test suite for UNION.
 * 
 * @author Bryan Thompson
 * @version $Id$
 */
public class TestUnions extends AbstractDataDrivenSPARQLTestCase {

    /**
     * 
     */
    public TestUnions() {
    }

    /**
     * @param name
     */
    public TestUnions(String name) {
        super(name);
    }

    /**
     * 
     * SELECT ?p ?o
     * WHERE { 
     *     {
     *          ?p ?o . 
     *     } UNION { 
     *          ?p ?o . 
     *     } UNION { 
     *          ?p ?o . 
     *     }
     * }
     * 
*/ public void test_union_01() throws Exception { new TestHelper("test_union_01").runTest(); } /** *
     * select distinct ?s
     * where { {
     *   ?s a foaf:Person .
     *   ?s rdfs:label ?label .
     *   FILTER (?label = "Mike")
     * } union { 
     *   ?s a foaf:Person . 
     *   ?s rdfs:label ?label .
     *   FILTER (?label = "Jane")
     * } }
     * 
* * Note: This is a port of TestBigdataEvaluationStrategyImpl#test_union(). * * @throws Exception */ public void test_union_02() throws Exception { new TestHelper("union_02").runTest(); } /** *
     * select distinct ?s
     * where { {
     *   ?s a foaf:Person .
     *   ?s rdfs:label ?label .
     *   FILTER (?label = "Mike")
     * } union { 
     *   ?s a foaf:Person . 
     *   ?s rdfs:label ?label .
     * } }
     * 
* * @throws Exception */ public void test_union_03() throws Exception { new TestHelper("union_03").runTest(); } /** *
     * select distinct ?s
     * where { {
     *   ?s a foaf:Person .
     *   ?s rdfs:label ?label .
     * } union { 
     *   ?s a foaf:Person . 
     *   ?s rdfs:label ?label .
     *   FILTER (?label = "Jane")
     * } }
     * 
* * @throws Exception */ public void test_union_04() throws Exception { new TestHelper("union_04").runTest(); } /** *
     *  SELECT ?p ?o ?s
     *  WHERE { 
     *      {
     *           ?p ?o . 
     *      } UNION { 
     *          ?s ?p  . 
     *      }
     *  }
     * 
*/ public void test_union_05() throws Exception { new TestHelper("union_05").runTest(); } /* * ported from com.bigdata.rdf.sail.TestNestedUnions */ // Note: was testSimplestNestedUnion(). public void test_union_06() throws Exception { new TestHelper("union_06").runTest(); } // Note: was testNestedUnionWithOptionals(). public void test_union_07() throws Exception { new TestHelper("union_07").runTest(); } // Note: was testForumBug() which used union.ttl for its data. public void test_union_08() throws Exception { new TestHelper( "union_08", // testURI, "union_08.rq",// queryFileURL "union_08.ttl",// dataFileURL "union_08.srx"// resultFileURL ).runTest(); } /** *
     * PREFIX dc:    
     * PREFIX :      
     * PREFIX ns:    
     * 
     * SELECT ?book
     * {
     *    {}
     *    UNION
     *    { ?book dc:title ?title }
     * }
     * 
* * @see * UNION with Empty Group Pattern */ public void test_union_with_empty() throws Exception { new TestHelper( "union_with_empty", // testURI, "union_with_empty.rq",// queryFileURL "union_with_empty.ttl",// dataFileURL "union_with_empty.srx"// resultFileURL ).runTest(); } /** * * @see Union with FILTER * issue */ public void test_union_ticket_831() throws Exception { new TestHelper( "ticket_831", // testURI, "ticket_831.rq",// queryFileURL "ticket_831.ttl",// dataFileURL "ticket_831.srx"// resultFileURL ).runTest(); } /** * The original query. * @see FILTER not applied when * there is UNION in the same join group */ public void test_union_ticket_874() throws Exception { new TestHelper( "ticket_874", // testURI, "ticket_874.rq",// queryFileURL "ticket_874.ttl",// dataFileURL "ticket_874.srx"// resultFileURL ).runTest(); } /** * A rewrite of the original query that works. * * @see FILTER not applied when * there is UNION in the same join group */ public void test_union_ticket_874b() throws Exception { new TestHelper( "ticket_874b", // testURI, "ticket_874b.rq",// queryFileURL "ticket_874.ttl",// dataFileURL "ticket_874.srx"// resultFileURL ).runTest(); } /** * This is DAWG sparql11-subquery-05. It fails in scale-out. * *
     * SELECT * 
     * WHERE { 
     *     {
     *       SELECT ?s 
     *       WHERE {?s ?p ?o}
     *       LIMIT 1 
     *     }
     *     {?s ?p ?o} 
     *     UNION 
     *     {} 
     * }
     * 
* * @throws Exception */ public void test_union_ticket_944() throws Exception { new TestHelper( "ticket_944", // testURI, "ticket_944.rq",// queryFileURL "ticket_944.trig",// dataFileURL "ticket_944.srx"// resultFileURL ).runTest(); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy