Examples of Constant


Examples of org.semanticweb.HermiT.model.Constant

                    node=createNewNINode(dependencySet);
                else
                    node=createNewNamedNode(dependencySet);
            }
            else {
                Constant constant=(Constant)term;
                node=createNewRootConstantNode(dependencySet);
                // Anonymous constant values are not assigned a particular value.
                // See the hack in OWLClausification for an explanation.
                if (!constant.isAnonymous())
                    m_extensionManager.addAssertion(ConstantEnumeration.create(new Constant[] { constant }),node,dependencySet,true);
            }
            termsToNodes.put(term,node);
        }
        return node.getCanonicalNode();
View Full Code Here

Examples of org.teiid.query.sql.symbol.Constant

        ElementSymbol es1 = new ElementSymbol("e1"); //$NON-NLS-1$
        es1.setType(DataTypeManager.DefaultDataClasses.STRING);      
        List elements = new ArrayList();
        elements.add(es1);
       
        Function func = new Function("concat", new Expression[] { es1, new Constant("abc")}); //$NON-NLS-1$ //$NON-NLS-2$
        FunctionDescriptor fd = FakeMetadataFactory.SFM.getSystemFunctionLibrary().findFunction("concat", new Class[] { DataTypeManager.DefaultDataClasses.STRING, DataTypeManager.DefaultDataClasses.STRING }); //$NON-NLS-1$
        func.setFunctionDescriptor(fd);
        func.setType(DataTypeManager.DefaultDataClasses.STRING);
        ExpressionSymbol expr = new ExpressionSymbol("expr", func); //$NON-NLS-1$
        List projectElements = new ArrayList();
View Full Code Here

Examples of org.teiid.query.sql.symbol.Constant

        ElementSymbol es1 = new ElementSymbol("e1"); //$NON-NLS-1$
        es1.setType(DataTypeManager.DefaultDataClasses.STRING);      
        List elements = new ArrayList();
        elements.add(es1);
       
        Function func = new Function("convert", new Expression[] { es1, new Constant("integer")}); //$NON-NLS-1$ //$NON-NLS-2$
        FunctionDescriptor fd = FakeMetadataFactory.SFM.getSystemFunctionLibrary().findFunction("convert", new Class[] { DataTypeManager.DefaultDataClasses.STRING, DataTypeManager.DefaultDataClasses.STRING }); //$NON-NLS-1$
        func.setFunctionDescriptor(fd);
        func.setType(DataTypeManager.DefaultDataClasses.INTEGER);
        ExpressionSymbol expr = new ExpressionSymbol("expr", func); //$NON-NLS-1$
        List projectElements = new ArrayList();
View Full Code Here

Examples of org.teiid.query.sql.symbol.Constant

        ElementSymbol es1 = new ElementSymbol("e1"); //$NON-NLS-1$
        es1.setType(DataTypeManager.DefaultDataClasses.STRING);      
        List elements = new ArrayList();
        elements.add(es1);

        Function func = new Function("lookup", new Expression[] { new Constant("pm1.g1"), new Constant("e2"), new Constant("e1"), es1 }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
        FunctionDescriptor desc = FakeMetadataFactory.SFM.getSystemFunctionLibrary().findFunction("lookup", new Class[] { String.class, String.class, String.class, String.class } ); //$NON-NLS-1$
        func.setFunctionDescriptor(desc);
        func.setType(DataTypeManager.DefaultDataClasses.STRING);
       
        ExpressionSymbol expr = new ExpressionSymbol("expr", func); //$NON-NLS-1$
View Full Code Here

Examples of org.teiid.query.sql.symbol.Constant

public class TestDependentCriteriaProcessor {

  @Test public void testNegatedSetCriteria() throws Exception {
    DependentAccessNode dan = new DependentAccessNode(0);
    SetCriteria sc = new SetCriteria(new ElementSymbol("e1"), Arrays.asList(new Constant(1), new Constant(2))); //$NON-NLS-1$
    DependentCriteriaProcessor dcp = new DependentCriteriaProcessor(1, -1, dan, sc);
    Criteria result = dcp.prepareCriteria();
    assertEquals(new CompareCriteria(new ElementSymbol("e1"), CompareCriteria.EQ, new Constant(1)), result); //$NON-NLS-1$
    assertTrue(dcp.hasNextCommand());
  }
View Full Code Here

Examples of org.teiid.query.sql.symbol.Constant

      cc.getVariableContext().setGlobalValue(reference.getContextSymbol(), 1);
    }
    SetCriteria sc = new SetCriteria(new ElementSymbol("e1"), references); //$NON-NLS-1$
    DependentCriteriaProcessor dcp = new DependentCriteriaProcessor(1, -1, dan, sc);
    Criteria result = dcp.prepareCriteria();
    assertEquals(new CompareCriteria(new ElementSymbol("e1"), CompareCriteria.EQ, new Constant(1)), result); //$NON-NLS-1$
    assertFalse(dcp.hasNextCommand());
  }
View Full Code Here

Examples of org.teiid.query.sql.symbol.Constant

     * Supports functions in group by is misleading.  It should actually
     * be called supports expression in group by.  Thus the example below
     * is not supported.
     */
    public void testSupportsFunctionInGroupBy() throws Exception {
        Function f = new Function("concat", new Expression[] { new Constant("a"), new Constant("b") }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
        ExpressionSymbol expr = new ExpressionSymbol("e", f); //$NON-NLS-1$
        List cols = new ArrayList();
        cols.add(expr);
        helpTestSupportsAggregates(false, false, cols);
    }
View Full Code Here

Examples of org.teiid.query.sql.symbol.Constant

    // Test where capabilities don't support scalar functions
    public void testSupportsScalar1() throws Exception {       
        BasicSourceCapabilities caps = new BasicSourceCapabilities();

        Function func = new Function("+", new Expression[] { new Constant(1), new Constant(2) }); //$NON-NLS-1$
        helpTestSupportsScalar(caps, func, false);       
    }   
View Full Code Here

Examples of org.teiid.query.sql.symbol.Constant

          if (pushdown) {
            projectedViewSymbols.add(agg);
          } else {
            if (agg.getAggregateFunction() == Type.COUNT) {
              if (agg.getExpression() == null) {
              projectedViewSymbols.add(new ExpressionSymbol("stagedAgg", new Constant(1))); //$NON-NLS-1$
              } else {
                SearchedCaseExpression count = new SearchedCaseExpression(Arrays.asList(new IsNullCriteria(agg.getExpression())), Arrays.asList(new Constant(Integer.valueOf(0))));
                count.setElseExpression(new Constant(Integer.valueOf(1)));
                count.setType(DataTypeManager.DefaultDataClasses.INTEGER);
              projectedViewSymbols.add(new ExpressionSymbol("stagedAgg", count)); //$NON-NLS-1$
              }
            } else { //min, max, sum
              Expression ex = agg.getExpression();
View Full Code Here

Examples of org.teiid.query.sql.symbol.Constant

        // if the source has no rows we need to insert a select node with criteria count(*)>0
        PlanNode selectNode = NodeFactory.getNewNode(NodeConstants.Types.SELECT);
        AggregateSymbol count = new AggregateSymbol("stagedAgg", NonReserved.COUNT, false, null); //$NON-NLS-1$
        aggregates.add(count); //consider the count aggregate for the push down call below
        selectNode.setProperty(NodeConstants.Info.SELECT_CRITERIA, new CompareCriteria(count, CompareCriteria.GT,
                                                                                       new Constant(new Integer(0))));
        selectNode.setProperty(NodeConstants.Info.IS_HAVING, Boolean.TRUE);
        stageGroup.addAsParent(selectNode);
    }
    return stageGroup;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.