Package org.openbel.framework.common.model

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


        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


            // not nested
            return;
        }

        // does it contain more than one nested statement?
        Statement objstmt = stmt.getObject().getStatement();
        if (objstmt.getObject().getStatement() == null) {
            // object term in nested statement
            return;
        }

        // Multi-nested statement, prune stmt then throw semantic warning
View Full Code Here

        final List<StatementGroup> stmtgroups = doc.getAllStatementGroups();
        for (final StatementGroup stmtgroup : stmtgroups) {
            final Iterator<Statement> sgi = stmtgroup.getStatements()
                    .iterator();
            while (sgi.hasNext()) {
                final Statement sgs = sgi.next();
                if (stmt.equals(sgs)) {
                    // prune
                    sgi.remove();
                    return;
                }
View Full Code Here

    public List<Statement> expand(Statement s) {
        Term sub = s.getSubject();
        Term obj = s.getObject().getTerm();
        final RelationshipType rel = s.getRelationshipType();

        final Statement stmt = new Statement(obj);
        stmt.setObject(new Object(sub));
        stmt.setRelationshipType(rel);

        return asList(new Statement[] { stmt });
    }
View Full Code Here

            // 1: read each table statement
            ts.readExternal(in);
            // 2: read the relevant document index
            final int did = in.readInt();
            // 3: read the statement
            final Statement statement = readStatement(in);
            addStatement(ts, statement, did);
        }
    }
View Full Code Here

            object = null;
        }

        // 5: relationship type
        RelationshipType rel = readRelationship(in);
        return new Statement(subject, comment, ag, object, rel);
    }
View Full Code Here

            state._fsp--;

            adaptor.addChild(root_0, st.getTree());

                    final Statement s = new Statement((st!=null?st.r:null));
                    retval.r = s;
               
            // BELStatement.g:69:5: (rel= relationship ( ( OPEN_PAREN nst= outer_term nrel= relationship not= outer_term CLOSE_PAREN ) | ot= outer_term ) )?
            int alt2=2;
            int LA2_0 = input.LA(1);

            if ( ((LA2_0>=76 && LA2_0<=103)) ) {
                alt2=1;
            }
            switch (alt2) {
                case 1 :
                    // BELStatement.g:70:9: rel= relationship ( ( OPEN_PAREN nst= outer_term nrel= relationship not= outer_term CLOSE_PAREN ) | ot= outer_term )
                    {
                    pushFollow(FOLLOW_relationship_in_statement101);
                    rel=relationship();

                    state._fsp--;

                    adaptor.addChild(root_0, rel.getTree());

                                s.setRelationshipType((rel!=null?rel.r:null));
                           
                    // BELStatement.g:73:9: ( ( OPEN_PAREN nst= outer_term nrel= relationship not= outer_term CLOSE_PAREN ) | ot= outer_term )
                    int alt1=2;
                    int LA1_0 = input.LA(1);

                    if ( (LA1_0==OPEN_PAREN) ) {
                        alt1=1;
                    }
                    else if ( ((LA1_0>=17 && LA1_0<=75)) ) {
                        alt1=2;
                    }
                    else {
                        NoViableAltException nvae =
                            new NoViableAltException("", 1, 0, input);

                        throw nvae;
                    }
                    switch (alt1) {
                        case 1 :
                            // BELStatement.g:74:13: ( OPEN_PAREN nst= outer_term nrel= relationship not= outer_term CLOSE_PAREN )
                            {
                            // BELStatement.g:74:13: ( OPEN_PAREN nst= outer_term nrel= relationship not= outer_term CLOSE_PAREN )
                            // BELStatement.g:75:17: OPEN_PAREN nst= outer_term nrel= relationship not= outer_term CLOSE_PAREN
                            {
                            OPEN_PAREN1=(Token)match(input,OPEN_PAREN,FOLLOW_OPEN_PAREN_in_statement145);
                            OPEN_PAREN1_tree = (Object)adaptor.create(OPEN_PAREN1);
                            adaptor.addChild(root_0, OPEN_PAREN1_tree);

                            pushFollow(FOLLOW_outer_term_in_statement166);
                            nst=outer_term();

                            state._fsp--;

                            adaptor.addChild(root_0, nst.getTree());

                                                final Statement ns = new Statement((nst!=null?nst.r:null));
                                           
                            pushFollow(FOLLOW_relationship_in_statement188);
                            nrel=relationship();

                            state._fsp--;

                            adaptor.addChild(root_0, nrel.getTree());

                                                ns.setRelationshipType((nrel!=null?nrel.r:null));
                                           
                            pushFollow(FOLLOW_outer_term_in_statement211);
                            not=outer_term();

                            state._fsp--;

                            adaptor.addChild(root_0, not.getTree());

                                                ns.setObject(new Statement.Object((not!=null?not.r:null)));
                                                s.setObject(new Statement.Object(ns));
                                                retval.r = s;
                                           
                            CLOSE_PAREN2=(Token)match(input,CLOSE_PAREN,FOLLOW_CLOSE_PAREN_in_statement231);
                            CLOSE_PAREN2_tree = (Object)adaptor.create(CLOSE_PAREN2);
View Full Code Here

        Term abundance = (Term) firstArgument; // first argument of a
                                               // translocation term is the
                                               // abundance
        // tranlocation connects the abundance term with TRANSLOCATES
        // relationship
        Statement statement =
                new Statement(translocation, null, null, new Object(abundance),
                        TRANSLOCATES);
        attachExpansionRuleCitation(statement);
        statements.add(statement);

        return statements;
View Full Code Here

        // Complex connects to its components with HAS_COMPONENT relationship
        for (BELObject o : term.getFunctionArguments()) {
            Term t = (Term) o;
            Object obj = new Object(t);
            Statement s = new Statement(term, null, null, obj, HAS_COMPONENT);
            attachExpansionRuleCitation(s);
            statements.add(s);
        }
        return statements;
    }
View Full Code Here

        Integer newSubjectTermId = mergeTerm(statement.getSubjectTermId(),
                protoNetwork1, protoNetwork2,
                documentId, termMap);

        int newStatementIndex = 0;
        Statement stmtToMerge =
                protoNetwork2.getStatementTable().getIndexedStatements()
                        .get(statementIndex);
        if (statement.getRelationshipName() == null) {
            // merge definitional statement, no create of proto edge
            newStatementIndex =
View Full Code Here

TOP

Related Classes of org.openbel.framework.common.model.Statement$Object

Copyright © 2018 www.massapicom. 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.