Package org.openbel.framework.common.model

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


    public List<Statement> expand(Term term) {
        List<Statement> statements = new ArrayList<Statement>();

        // 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);
        }
View Full Code Here


        TermTable termTable = protoNetwork2.getTermTable();
        TermParameterMapTable mapTable =
                protoNetwork2.getTermParameterMapTable();
        ParameterTable parameterTable = protoNetwork2.getParameterTable();

        Term termToMerge = termTable.getIndexedTerms().get(termId);

        // tables for proto network we're merging into (1)
        final TermTable mtt = protoNetwork1.getTermTable();
        final ParameterTable mpt = protoNetwork1.getParameterTable();
        final TermParameterMapTable mtpmt =
View Full Code Here

                if (stmt.getObject().getTerm() != null) {
                    // expand the rest of simple statement
                    expandTerm(stmt.getObject().getTerm(), expansions);
                } else {
                    // expand the rest of nested statement
                    final Term nsub = stmt.getObject().getStatement()
                            .getSubject();
                    final Term nobj = stmt.getObject().getStatement()
                            .getObject().getTerm();

                    expandTerm(nsub, expansions);
                    expandTerm(nobj, expansions);
                }
View Full Code Here

     * {@code pnb} is {@code null}
     */
    private void createEdge(final Statement stmt, final int supporting,
            final ProtoNetwork pn, final ProtoNetworkBuilder pnb) {
        // add subject as term and proto node
        final Term subject = stmt.getSubject();
        final Integer sourceIndex = createNode(subject, supporting, pn, pnb);

        // add object as term and proto node
        final Term object = stmt.getObject().getTerm();
        final Integer objectIndex = createNode(object, supporting, pn, pnb);

        final ProtoEdgeTable pet = pn.getProtoEdgeTable();
        pet.addEdges(supporting, new ProtoEdgeTable.TableProtoEdge(sourceIndex,
                stmt.getRelationshipType().getDisplayValue(), objectIndex));
View Full Code Here

    @Override
    public List<Statement> expand(Term activity) {
        List<Statement> statements = new ArrayList<Statement>();

        BELObject firstArgument = activity.getFunctionArguments().get(0);
        Term abundance = (Term) firstArgument; // only argument of a moleculary
                                               // activity term is the abundance
        // Molecular activities connect to its abundance term with ACTS_IN
        // relationship
        final Object obj = new Object(activity);
        Statement statement =
View Full Code Here

        if (!(y instanceof Term)) {
            // Second argument must be a term
            return false;
        }

        Term xtrm = (Term) x;
        if (xtrm.getFunctionEnum() != REACTANTS) {
            // First argument must be a reactants function
            return false;
        }

        Term ytrm = (Term) y;
        if (ytrm.getFunctionEnum() != PRODUCTS) {
            // Second argument must be a products function
            return false;
        }

        List<BELObject> xtrmArgs = xtrm.getFunctionArguments();
        if (noItems(xtrmArgs)) {
            // At least one argument to the reactants function is necessary
            return false;
        }

        List<BELObject> ytrmArgs = ytrm.getFunctionArguments();
        if (noItems(ytrmArgs)) {
            // At least one argument to the products function is necessary
            return false;
        }
View Full Code Here

        List<Statement> statements = new ArrayList<Statement>();

        BELObject firstArgument = reaction.getFunctionArguments().get(0);
        BELObject secondArgument = reaction.getFunctionArguments().get(1);
        // first argument of a reaction is the reactants
        Term reactants = (Term) firstArgument;
        // second argument of a reaction is the products
        Term products = (Term) secondArgument;

        // all reactants connect to reaction with REACTANT_IN relationship
        for (BELObject reactant : reactants.getFunctionArguments()) {
            Term sub = (Term) reactant;
            Object obj = new Object(reaction);
            Statement stmt = new Statement(sub, null, null, obj, REACTANT_IN);
            attachExpansionRuleCitation(stmt);
            statements.add(stmt);
        }

        // a reaction connects to its products with HAS_PRODUCT relationship
        for (BELObject product : products.getFunctionArguments()) {
            Term sub = (Term) product;
            Object obj = new Object(sub);
            Statement stmt =
                    new Statement(reaction, null, null, obj, HAS_PRODUCT);
            attachExpansionRuleCitation(stmt);
            statements.add(stmt);
View Full Code Here

    @Override
    public List<Statement> expand(Term degradation) {
        List<Statement> statements = new ArrayList<Statement>();

        BELObject firstArgument = degradation.getFunctionArguments().get(0);
        Term protein = (Term) firstArgument; // only argument of a protein
                                             // degradation term is the protein

        // Protein degradation term connects to its protein with
        // DIRECTLY_DECREASES relationship
        final Object obj = new Object(protein);
View Full Code Here

        List<Statement> statements = new ArrayList<Statement>();

        // compositeAbundance connects to its abundance terms with INCLUDES
        // relationship
        for (BELObject o : term.getFunctionArguments()) {
            Term t = (Term) o; // component of the composite term
            final Object obj = new Object(t);
            Statement s = new Statement(term, null, null, obj, INCLUDES);
            attachExpansionRuleCitation(s);
            statements.add(s);
        }
View Full Code Here

    @Test(expected = SemanticWarning.class)
    public void testNoArgumentFailure() throws SemanticWarning {
        err.println("testNoArgumentFailure");
        FunctionEnum funcEnum = FunctionEnum.COMPLEX_ABUNDANCE;
        List<BELObject> args = new ArrayList<BELObject>();
        Term t = new Term(funcEnum, args);

        subject.checkParameterizedTerm(t);
        fail("expected semantic failure");
    }
View Full Code Here

TOP

Related Classes of org.openbel.framework.common.model.Term

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.