Package org.openbel.framework.common.model

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


     * @param n {@link NamespaceGroup}; namespace group
     * @param statements {@link Statement}; bel statements
     * @return {@link Document}
     */
    private Document make_document(Header h, NamespaceGroup n, Statement... statements) {
        StatementGroup g = new StatementGroup();
        g.setStatements(Arrays.asList(statements));
        return new Document(h, Arrays.asList(g), n, null);
    }
View Full Code Here


    public StatementGroup convert(BELStatementGroup bsg) {
        if (bsg == null) {
            return null;
        }

        final StatementGroup sg = new StatementGroup();

        if (bsg.getName() != null) {
            sg.setName(bsg.getName());
        }

        final List<Statement> statements = new ArrayList<Statement>();
        final BELStatementConverter bsc =
                new BELStatementConverter(ndefs, adefs);
        if (hasItems(bsg.getStatements())) {
            for (BELStatement statement : bsg.getStatements()) {
                statements.add(bsc.convert(statement));
            }

            sg.setStatements(statements);
        }

        List<StatementGroup> childStatementGroups =
                new ArrayList<StatementGroup>();
        if (hasItems(bsg.getChildStatementGroups())) {
            for (BELStatementGroup childGroup : bsg.getChildStatementGroups()) {
                childStatementGroups.add(convert(childGroup));
            }

            sg.setStatementGroups(childStatementGroups);
        }

        return sg;
    }
View Full Code Here

    @Override
    public StatementGroup convert(XBELStatementGroup source) {
        if (source == null) return null;

        // Destination type
        StatementGroup dest = new StatementGroup();

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

        String name = source.getName();
        dest.setName(name);

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

        List<XBELStatement> xstatements = source.getStatement();
        int size = xstatements.size();
        List<Statement> statements = new ArrayList<Statement>(size);
        StatementConverter sConverter = new StatementConverter();
        for (final XBELStatement xstmt : xstatements) {
            // Defer to StatementConverter
            statements.add(sConverter.convert(xstmt));
        }
        dest.setStatements(statements);

        List<XBELStatementGroup> xstmtGroup = source.getStatementGroup();
        size = xstmtGroup.size();
        List<StatementGroup> stmtGroup = new ArrayList<StatementGroup>(size);
        for (final XBELStatementGroup xsg : xstmtGroup) {
            stmtGroup.add(convert(xsg));
        }
        dest.setStatementGroups(stmtGroup);

        return dest;
    }
View Full Code Here

            // Failed to match both either family or family member.
            // Prune the statement.
            Set<Entry<StatementGroup, Set<Statement>>> entries =
                    groupMap.entrySet();
            for (final Entry<StatementGroup, Set<Statement>> entry : entries) {
                StatementGroup group = entry.getKey();
                Set<Statement> stmts = entry.getValue();
                if (stmts.contains(stmt)) {
                    group.getStatements().remove(stmt);
                    pruned++;
                    break;
                }
            }
        }
View Full Code Here

            }
        }

        // add isA relationships to protein family document, if necessary
        if (!isaStmts.isEmpty()) {
            final StatementGroup isaStmtGroup = new StatementGroup();
            isaStmtGroup.setStatements(isaStmts);
            d.addStatementGroup(isaStmtGroup);
        }

        pr.setDeltaStatements(inferred);
        pr.setTotalStatements(d.getStatementCount());
View Full Code Here

            // Failed to match both either complex or component.
            // Prune the statement.
            Set<Entry<StatementGroup, Set<Statement>>> entries =
                    groupMap.entrySet();
            for (final Entry<StatementGroup, Set<Statement>> entry : entries) {
                StatementGroup group = entry.getKey();
                Set<Statement> stmts = entry.getValue();
                if (entry.getValue().contains(stmt)) {
                    stmts.remove(stmt);
                    group.getStatements().remove(stmt);
                    pruned++;
                    break;
                }
            }
        }
View Full Code Here

                // proto network does not contain either equivalent term so prune
                // from its parent statement group
                Set<Entry<StatementGroup, Set<Statement>>> entries = orthomap
                        .entrySet();
                for (final Entry<StatementGroup, Set<Statement>> e : entries) {
                    StatementGroup group = e.getKey();
                    Set<Statement> stmts = e.getValue();
                    if (stmts.contains(orthoStmt)) {
                        group.getStatements().remove(orthoStmt);
                        pruned++;
                        break;
                    }
                }
            }
View Full Code Here

TOP

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

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.