// Path: strategy/src/main/java/com/msd/gin/halyard/vocab/HALYARD.java
// public final class HALYARD {
// 
//     HALYARD() {}
// 
//     private static final SimpleValueFactory SVF = SimpleValueFactory.getInstance();
// 
//     public static final String PREFIX = "halyard";
// 
//     public static final String NAMESPACE = "http://merck.github.io/Halyard/ns#";
// 
//     public static final IRI STATS_ROOT_NODE = SVF.createIRI(NAMESPACE, "statsRoot");
// 
//     public static final IRI STATS_GRAPH_CONTEXT = SVF.createIRI(NAMESPACE, "statsContext");
// 
//     public static final IRI SYSTEM_GRAPH_CONTEXT = SVF.createIRI(NAMESPACE, "system");
// 
//     public static final IRI NAMESPACE_PREFIX_PROPERTY = HALYARD.SVF.createIRI(NAMESPACE, "namespacePrefix");
// 
//     public final static IRI TABLE_NAME_PROPERTY = SVF.createIRI(NAMESPACE, "tableName");
// 
//     public final static IRI SPLITBITS_PROPERTY = SVF.createIRI(NAMESPACE, "splitBits");
// 
//     public final static IRI CREATE_TABLE_PROPERTY = SVF.createIRI(NAMESPACE, "createTable");
// 
//     public final static IRI PUSH_STRATEGY_PROPERTY = SVF.createIRI(NAMESPACE, "pushStrategy");
// 
//     public final static IRI EVALUATION_TIMEOUT_PROPERTY = SVF.createIRI(NAMESPACE, "evaluationTimeout");
// 
//     public final static IRI ELASTIC_INDEX_URL_PROPERTY = SVF.createIRI(NAMESPACE, "elasticIndexURL");
// 
//     public final static IRI SEARCH_TYPE = SVF.createIRI(NAMESPACE, "search");
// 
//     public final static IRI PARALLEL_SPLIT_FUNCTION = SVF.createIRI(NAMESPACE, "forkAndFilterBy");
// 
// }


import com.msd.gin.halyard.vocab.HALYARD;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
/*
 * Copyright 2018 Merck Sharp & Dohme Corp. a subsidiary of Merck & Co.,
 * Inc., Kenilworth, NJ, USA.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.msd.gin.halyard.optimizers;


/**
 *
 * @author Adam Sotona (MSD)
 */
@RunWith(Parameterized.class)
public class HalyardEvaluationStatisticsTest {

    @Parameterized.Parameters
    public static Collection<Object[]> data() {
        return Arrays.asList(new Object[][] {
            {"select * where {?s a ?o}",            1.0E2, null, null},
            {"select * where {?s ?p ?o}",           1.0E3, null, null},
            {"select * where {?s a \"1\"}",         1.0E1, null, null},
            {"select * where {?a ?b ?c; ?d ?e}",    1.0E8, null, null},
            {"select * where {?a a ?c; ?d ?e}",     1.0E6, null, null},
            {"select * where {?a ?b ?c; a ?e}",     1.0E7, null, null},
            {"select * where {?s a ?o}",            1.0E1, new String[]{"o"}, null},
            {"select * where {?s ?p ?o}",           1.0E1, new String[]{"s", "o"}, null},
            {"select * where {?s a \"1\"}",         1.0,   new String[]{"s"}, null},
            {"select * where {?a ?b ?c; ?d ?e}",    1.0E4, new String[]{"b", "c"}, null},
            {"select * where {?a a ?c; ?d ?e}",     1.0E3, new String[]{"d", "c"}, null},
            {"select * where {?a ?b ?c; a ?e}",     1.0E2, new String[]{"b", "e", "c"}, null},
            {"select * where {{?a a \"1\". optional {?a a ?b}} union {?a a \"2\"}}", 1010.0, null, null},
// Path: strategy/src/main/java/com/msd/gin/halyard/vocab/HALYARD.java
// public final class HALYARD {
// 
//     HALYARD() {}
// 
//     private static final SimpleValueFactory SVF = SimpleValueFactory.getInstance();
// 
//     public static final String PREFIX = "halyard";
// 
//     public static final String NAMESPACE = "http://merck.github.io/Halyard/ns#";
// 
//     public static final IRI STATS_ROOT_NODE = SVF.createIRI(NAMESPACE, "statsRoot");
// 
//     public static final IRI STATS_GRAPH_CONTEXT = SVF.createIRI(NAMESPACE, "statsContext");
// 
//     public static final IRI SYSTEM_GRAPH_CONTEXT = SVF.createIRI(NAMESPACE, "system");
// 
//     public static final IRI NAMESPACE_PREFIX_PROPERTY = HALYARD.SVF.createIRI(NAMESPACE, "namespacePrefix");
// 
//     public final static IRI TABLE_NAME_PROPERTY = SVF.createIRI(NAMESPACE, "tableName");
// 
//     public final static IRI SPLITBITS_PROPERTY = SVF.createIRI(NAMESPACE, "splitBits");
// 
//     public final static IRI CREATE_TABLE_PROPERTY = SVF.createIRI(NAMESPACE, "createTable");
// 
//     public final static IRI PUSH_STRATEGY_PROPERTY = SVF.createIRI(NAMESPACE, "pushStrategy");
// 
//     public final static IRI EVALUATION_TIMEOUT_PROPERTY = SVF.createIRI(NAMESPACE, "evaluationTimeout");
// 
//     public final static IRI ELASTIC_INDEX_URL_PROPERTY = SVF.createIRI(NAMESPACE, "elasticIndexURL");
// 
//     public final static IRI SEARCH_TYPE = SVF.createIRI(NAMESPACE, "search");
// 
//     public final static IRI PARALLEL_SPLIT_FUNCTION = SVF.createIRI(NAMESPACE, "forkAndFilterBy");
// 
// }


// Path: strategy/src/test/java/com/msd/gin/halyard/optimizers/HalyardEvaluationStatisticsTest.java
import com.msd.gin.halyard.vocab.HALYARD;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;
import org.eclipse.rdf4j.query.parser.sparql.SPARQLParser;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

/*
 * Copyright 2018 Merck Sharp & Dohme Corp. a subsidiary of Merck & Co.,
 * Inc., Kenilworth, NJ, USA.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.msd.gin.halyard.optimizers;


/**
 *
 * @author Adam Sotona (MSD)
 */
@RunWith(Parameterized.class)
public class HalyardEvaluationStatisticsTest {

    @Parameterized.Parameters
    public static Collection<Object[]> data() {
        return Arrays.asList(new Object[][] {
            {"select * where {?s a ?o}",            1.0E2, null, null},
            {"select * where {?s ?p ?o}",           1.0E3, null, null},
            {"select * where {?s a \"1\"}",         1.0E1, null, null},
            {"select * where {?a ?b ?c; ?d ?e}",    1.0E8, null, null},
            {"select * where {?a a ?c; ?d ?e}",     1.0E6, null, null},
            {"select * where {?a ?b ?c; a ?e}",     1.0E7, null, null},
            {"select * where {?s a ?o}",            1.0E1, new String[]{"o"}, null},
            {"select * where {?s ?p ?o}",           1.0E1, new String[]{"s", "o"}, null},
            {"select * where {?s a \"1\"}",         1.0,   new String[]{"s"}, null},
            {"select * where {?a ?b ?c; ?d ?e}",    1.0E4, new String[]{"b", "c"}, null},
            {"select * where {?a a ?c; ?d ?e}",     1.0E3, new String[]{"d", "c"}, null},
            {"select * where {?a ?b ?c; a ?e}",     1.0E2, new String[]{"b", "e", "c"}, null},
            {"select * where {{?a a \"1\". optional {?a a ?b}} union {?a a \"2\"}}", 1010.0, null, null},
            {"select * where {?s a \"1\"^^<" + HALYARD.SEARCH_TYPE + ">}",           1.0E-4,   new String[]{"s"}, null},