Examples of Statement


Examples of org.openbel.framework.common.model.Statement

        FunctionEnum fx = mt.getFunctionEnum();

        Term proteinTrm = new Term(PROTEIN_ABUNDANCE);
        proteinTrm.addFunctionArgument(pp);

        Statement stmt = null;
        final Object obj = new Object(term);
        if (isMutation(fx)) {
            // mutation
            // protein term connects to its mutation with HAS_VARIANT
            // relationship
            stmt = new Statement(proteinTrm, null, null, obj, HAS_VARIANT);
        } else {
            // modified protein
            // protein term connects to its modification with HAS_MODIFICATION
            // relationship
            stmt = new Statement(proteinTrm, null, null, obj, HAS_MODIFICATION);
        }

        attachExpansionRuleCitation(stmt);
        statements.add(stmt);
View Full Code Here

Examples of org.openbel.framework.ws.model.Statement

     * @param statement
     * @return
     */
    public static Statement
    convert(org.openbel.framework.common.model.Statement statement) {
        Statement wsStmt = OBJECT_FACTORY.createStatement();
        wsStmt.setStatement(statement.toBELShortForm());

        AnnotationGroup group = statement.getAnnotationGroup();
        if (group != null) {
            wsStmt.setCitation(convert(group.getCitation()));
            List<org.openbel.framework.common.model.Annotation> annotations = group.getAnnotations();
            if (hasItems(annotations)) {
                for (org.openbel.framework.common.model.Annotation annotation : annotations) {
                    wsStmt.getAnnotations().add(convert(annotation));
                }
            }
        }
        return wsStmt;
    }
View Full Code Here

Examples of org.openrdf.model.Statement

      logger.debug("Inserting axiom statements");
      addAxiomStatements(this);

      newStatements = new LinkedHashModel();
      Cursor<? extends Statement> cursor = getDelegate().getStatements(null, null, null, true);
      Statement st;
      while ((st = cursor.next()) != null) {
        newStatements.add(st);
      }

      statementsRemoved = false;
View Full Code Here

Examples of org.rascalmpl.ast.Statement

    Name dummy = ASTBuilder.make("Name","Lexical",loc, "_");
    Expression var = ASTBuilder.make("Expression","QualifiedName",loc, ASTBuilder.make("QualifiedName", loc, Arrays.asList(dummy)));
    Expression truth = ASTBuilder.make("Expression","Literal",loc, ASTBuilder.make("Literal","Boolean",loc, ASTBuilder.make("BooleanLiteral","Lexical",loc, "true")));
    Expression list = ASTBuilder.make("Expression","List", loc, Arrays.asList(truth));
    Expression enumerator = ASTBuilder.make("Expression","Enumerator",loc, var, list);
    Statement stat = ASTBuilder.make("Statement","For",loc, ASTBuilder.make("Label","Default", loc, label), Arrays.asList(enumerator), body);
    return stat;
  }
View Full Code Here

Examples of org.rendersnake.js.Statement

    public void testSimple2(){       
        Function f = new Function("arg");
        f.name = "test";
        f.add($("this").addClass("hide"));
        f.add(new Statement("alert('hello')"));
        f.returns = "1+2";
       
        System.out.println(f);
    }
View Full Code Here

Examples of org.renjin.compiler.ir.tac.statements.Statement

  }

  private void addBasicBlocks() {
    BasicBlock current = null;
    for(int i=0;i<parent.getStatements().size();++i) {
      Statement stmt = parent.getStatements().get(i);
     
      if(current == null || parent.isLabeled(i)) {
        current = addNewBasicBlock(parent, i);
      } else {
        current.addStatement(stmt);
View Full Code Here

Examples of org.sonar.duplications.statement.Statement

  public List<Block> chunk(String resourceId, List<Statement> statements) {
    List<Statement> filtered = Lists.newArrayList();
    int i = 0;
    while (i < statements.size()) {
      Statement first = statements.get(i);
      int j = i + 1;
      while (j < statements.size() && statements.get(j).getValue().equals(first.getValue())) {
        j++;
      }
      filtered.add(statements.get(i));
      if (i < j - 1) {
        filtered.add(statements.get(j - 1));
      }
      i = j;
    }
    statements = filtered;

    if (statements.size() < blockSize) {
      return Collections.emptyList();
    }
    Statement[] statementsArr = statements.toArray(new Statement[statements.size()]);
    List<Block> blocks = Lists.newArrayListWithCapacity(statementsArr.length - blockSize + 1);
    long hash = 0;
    int first = 0;
    int last = 0;
    for (; last < blockSize - 1; last++) {
      hash = hash * PRIME_BASE + statementsArr[last].getValue().hashCode();
    }
    Block.Builder blockBuilder = Block.builder().setResourceId(resourceId);
    for (; last < statementsArr.length; last++, first++) {
      Statement firstStatement = statementsArr[first];
      Statement lastStatement = statementsArr[last];
      // add last statement to hash
      hash = hash * PRIME_BASE + lastStatement.getValue().hashCode();
      // create block
      Block block = blockBuilder.setBlockHash(new ByteArray(hash))
          .setIndexInFile(first)
          .setLines(firstStatement.getStartLine(), lastStatement.getEndLine())
          .build();
      blocks.add(block);
      // remove first statement from hash
      hash -= power * firstStatement.getValue().hashCode();
    }
View Full Code Here

Examples of org.swordapp.server.Statement

    String author = this.stringMetadata(item, authorField);
    String title = this.stringMetadata(item, titleField);
    String updated = this.stringMetadata(item, updatedField);

    Statement s = new AtomStatement(feedUri, author, title, updated);
    this.populateStatement(context, item, s);
    return s;
  }
View Full Code Here

Examples of org.teiid.query.sql.proc.Statement

   
    @Test public void testOptionalFromClause10(){
        //declare var1
        ElementSymbol var1 = new ElementSymbol("var1"); //$NON-NLS-1$
        String shortType = new String("short"); //$NON-NLS-1$
        Statement declStmt = new DeclareStatement(var1, shortType);
       
        //ifblock
        List symbols = new ArrayList();
        symbols.add(new ElementSymbol("a1"))//$NON-NLS-1$
        Select select = new Select(symbols);      
       
        From from = new From();
        from.addGroup(new GroupSymbol("g")); //$NON-NLS-1$
       
        Criteria criteria = new CompareCriteria(new ElementSymbol("a2"), CompareCriteria.EQ,  //$NON-NLS-1$
            new Constant(new Integer(5)));
       
        Query query = new Query();
        query.setSelect(select);
        query.setFrom(from);
        query.setCriteria(criteria);
       
        AssignmentStatement queryStmt = new AssignmentStatement(var1, query);
             
        Block ifBlock = new Block();     
        ifBlock.addStatement(queryStmt);
       
        //else block
        ElementSymbol var2 = new ElementSymbol("var2"); //$NON-NLS-1$
        Statement elseDeclStmt = new DeclareStatement(var2, shortType);    
       
        List elseSymbols = new ArrayList();
        elseSymbols.add(new ElementSymbol("b1"))//$NON-NLS-1$
        Select elseSelect = new Select(elseSymbols);
   
View Full Code Here

Examples of org.voltdb.catalog.Statement

        // Update EstimatorState.prefetch any time we transition to a MarkovVertex where the
        // underlying Statement catalog object was marked as prefetchable
        // Do we want to put this traversal above?
        if (hstore_conf.site.exec_prefetch_queries) {
            for (MarkovVertex vertex : initialEst.getMarkovPath()) {
                Statement statement = (Statement) vertex.getCatalogItem();
                if (statement.getPrefetchable()) {
                    if (debug.val)
                        LOG.debug(String.format("%s - Checking whether we can prefetch %s on partitions %s",
                                 TransactionUtil.formatTxnName(catalog_proc, txn_id),
                                 statement.fullName(), vertex.getPartitions()));
                    if (vertex.getPartitions().isEmpty() == false && vertex.getPartitions().get() != base_partition) {
                        state.addPrefetchableStatement(vertex.getCountedStatement());
                    }
                }
            } // FOR
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.