Package org.openbel.framework.common.model

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


    @Test
    public void testMatchDefinitionalStatement() {
        Term a = new Term(PROTEIN_ABUNDANCE,
                Arrays.asList((BELObject) CommonModelFactory.getInstance()
                        .createParameter(null, "A")));
        Statement defStmt = new Statement(a);

        assertFalse(new DistributeStatementExpansionRule().match(defStmt));
    }
View Full Code Here


                Arrays.asList((BELObject) CommonModelFactory.getInstance()
                        .createParameter(null, "A")));
        Term b = new Term(PROTEIN_ABUNDANCE,
                Arrays.asList((BELObject) CommonModelFactory.getInstance()
                        .createParameter(null, "B")));
        Statement simpleStmt = new Statement(a, null, null,
                new Statement.Object(b), INCREASES);

        assertFalse(new DistributeStatementExpansionRule().match(simpleStmt));
    }
View Full Code Here

                        .createParameter(null, "B")));
        Term c = new Term(RNA_ABUNDANCE,
                Arrays.asList((BELObject) CommonModelFactory.getInstance()
                        .createParameter(null, "C")));

        Statement bc = new Statement(b, null, null, new Statement.Object(c),
                INCREASES);
        Statement abc = new Statement(a, null, null, new Statement.Object(bc),
                INCREASES);

        assertTrue(new DistributeStatementExpansionRule().match(abc));
    }
View Full Code Here

                        .createParameter(null, "D")));
        Term e = new Term(CATALYTIC_ACTIVITY,
                Arrays.asList((BELObject) CommonModelFactory.getInstance()
                        .createParameter(null, "E")));

        Statement de = new Statement(d, null, null, new Statement.Object(e),
                INCREASES);
        Statement cde = new Statement(c, null, null, new Statement.Object(de),
                INCREASES);
        Statement bcde = new Statement(b, null, null,
                new Statement.Object(cde), INCREASES);
        Statement abcde = new Statement(a, null, null, new Statement.Object(
                bcde), INCREASES);

        assertFalse(new DistributeStatementExpansionRule().match(abcde));
    }
View Full Code Here

                        .createParameter(null, "B")));
        Term c = new Term(RNA_ABUNDANCE,
                Arrays.asList((BELObject) CommonModelFactory.getInstance()
                        .createParameter(null, "C")));

        Statement bc = new Statement(b, null, null, new Statement.Object(c),
                INCREASES);
        Statement abc = new Statement(a, null, null, new Statement.Object(bc),
                INCREASES);

        List<Statement> expansion = null;
        expansion = new DistributeStatementExpansionRule().expand(abc);
View Full Code Here

                // XXX offset
                sps.setInt(8, stmt.getNestedObject() + 1);
            }

            // set bel statement text
            Statement s = _stmts.get(i);
            sps.setString(9, s.toBELShortForm());

            sps.addBatch();
        }

        sps.executeBatch();
View Full Code Here

        }

        String comment = bs.getComment();
        String belSyntax = bs.getStatementSyntax();

        Statement s = BELParser.parseStatement(belSyntax);
        repopulateNamespaces(s);

        s.setComment(comment);

        final BELAnnotationConverter bac =
                new BELAnnotationConverter(adefs);
        List<BELAnnotation> annotations = bs.getAnnotations();
        List<Annotation> alist = null;
        if (hasItems(annotations)) {
            alist = sizedArrayList(annotations.size());
            for (BELAnnotation annotation : annotations) {
                alist.addAll(bac.convert(annotation));
            }
        }

        BELCitation bc = bs.getCitation();
        BELEvidence be = bs.getEvidence();

        AnnotationGroup ag = new AnnotationGroup();
        boolean hasAnnotation = false;
        if (hasItems(alist)) {
            ag.setAnnotations(alist);
            hasAnnotation = true;
        }

        if (bc != null) {
            ag.setCitation(bcc.convert(bc));
            hasAnnotation = true;
        }

        if (be != null) {
            ag.setEvidence(bec.convert(be));
            hasAnnotation = true;
        }

        if (hasAnnotation) {
            s.setAnnotationGroup(ag);
        }

        return s;
    }
View Full Code Here

        if (source == null) return null;

        XBELTerm subject = source.getSubject().getTerm();
        TermConverter tConverter = new TermConverter();
        // Defer to TermConverter for statement construction
        Statement dest = new Statement(tConverter.convert(subject));

        XBELAnnotationGroup annotationGroup = source.getAnnotationGroup();
        AnnotationGroupConverter agConverter = new AnnotationGroupConverter();
        // Defer to AnnotationGroupConverter
        dest.setAnnotationGroup(agConverter.convert(annotationGroup));

        String comment = source.getComment();
        dest.setComment(comment);

        // Set statement relationship, if present on source
        Relationship r = source.getRelationship();
        if (r != null)
            dest.setRelationshipType(fromString(r.value()));

        XBELObject object = source.getObject();
        if (object != null) {
            if (object.isSetStatement()) {
                XBELStatement statement = object.getStatement();
                StatementConverter sConverter = new StatementConverter();
                // Defer to StatementConverter
                dest.setObject(new Object(sConverter.convert(statement)));
            } else if (object.isSetTerm()) {
                XBELTerm term = object.getTerm();
                // Defer to TermConverter
                dest.setObject(new Object(tConverter.convert(term)));
            }
        }

        return dest;
    }
View Full Code Here

                                mpt.addFunctionArgument(new Parameter(mns, mval));
                                final Term mat = new Term(f);
                                mat.addFunctionArgument(mpt);

                                // construct isA statement between member and family
                                isaStmts.add(new Statement(mat, null,
                                        null, new Object(fat), IS_A));
                                inferred++;
                            }
                        }
                    }
View Full Code Here

TOP

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

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.