Examples of XBELStatement


Examples of org.openbel.bel.xbel.model.XBELStatement

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

Examples of org.openbel.bel.xbel.model.XBELStatement

     */
    @Override
    public XBELStatement convert(Statement source) {
        if (source == null) return null;

        XBELStatement xstmt = new XBELStatement();

        Term subject = source.getSubject();
        TermConverter tConverter = new TermConverter();
        XBELSubject xs = new XBELSubject();
        // Defer to TermConverter
        xs.setTerm(tConverter.convert(subject));
        xstmt.setSubject(xs);

        AnnotationGroup ag = source.getAnnotationGroup();
        AnnotationGroupConverter agConverter = new AnnotationGroupConverter();
        // Defer to AnnotationGroupConverter
        xstmt.setAnnotationGroup(agConverter.convert(ag));

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

        // Set statement relationship, if present on source
        org.openbel.framework.common.enums.RelationshipType r =
                source.getRelationshipType();
        if (r != null)
            xstmt.setRelationship(Relationship.fromValue(r.getDisplayValue()));

        Object object = source.getObject();
        if (object != null) {
            if (object.getStatement() != null) {
                XBELObject xo = new XBELObject();
                StatementConverter sConverter = new StatementConverter();
                // Defer to StatementConverter
                xo.setStatement(sConverter.convert(object.getStatement()));
                xstmt.setObject(xo);
            } else if (object.getTerm() != null) {
                XBELObject xo = new XBELObject();
                // Defer to TermConverter
                xo.setTerm(tConverter.convert(object.getTerm()));
                xstmt.setObject(xo);
            }
        }

        return xstmt;
    }
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.