Examples of BELDocument


Examples of org.openbel.bel.model.BELDocument

        } catch (RecognitionException e) {}
        List<BELParseErrorException> syntaxErrors = parser.getSyntaxErrors();
        List<BELParseWarningException> syntaxWarnings =
                new ArrayList<BELParseWarningException>();

        BELDocument doc = null;
        if (result != null) {
            // walk and extract semantic errors
            CommonTreeNodeStream nodeStream =
                    new CommonTreeNodeStream(result.tree);
            BELScriptWalker walker = new BELScriptWalker(nodeStream);
View Full Code Here

Examples of org.openbel.bel.model.BELDocument

        BELParseResults parse = BELParser.parse(belscript);
        assertTrue(parse.getSyntaxWarnings().isEmpty());
        assertTrue(parse.getSyntaxErrors().isEmpty());

        BELDocument doc = parse.getDocument();
        assertNotNull(doc);

        Set<BELAnnotationDefinition> annodefs = doc.getAnnotationDefinitions();
        assertNotNull(annodefs);
        assertTrue(annodefs.size() == 1);

        String value = annodefs.iterator().next().getValue();
        assertTrue(value.equals("0|1|0?\\.[\\d]+|1\\.[0]+"));
View Full Code Here

Examples of org.openbel.bel.model.BELDocument

        BELParseResults parse = BELParser.parse(belscript);
        assertTrue(parse.getSyntaxWarnings().isEmpty());
        assertTrue(parse.getSyntaxErrors().isEmpty());

        BELDocument doc = parse.getDocument();
        assertNotNull(doc);

        BELDocumentHeader header = doc.getDocumentHeader();
        assertNotNull(header);

        String name = header.getName();
        assertNotNull(name);
        assertTrue(name.equals("Tabbed\tname\\t"));
View Full Code Here

Examples of org.openbel.bel.model.BELDocument

        BELParseResults parse = BELParser.parse(belscript);
        assertTrue(parse.getSyntaxWarnings().isEmpty());
        assertTrue(parse.getSyntaxErrors().isEmpty());

        BELDocument doc = parse.getDocument();
        assertNotNull(doc);

        List<BELStatementGroup> groups = doc.getBelStatementGroups();
        assertTrue(groups.size() == 1);
        BELStatementGroup group = groups.get(0);

        assertTrue(group.getName().equals("\"β-cell study\""));
    }
View Full Code Here

Examples of org.openbel.bel.model.BELDocument

        nsset.add(new BELNamespaceDefinition("EGID", NS, false));
        final List<BELStatementGroup> sglist = sizedArrayList(1);
        final BELStatementGroup sg = new BELStatementGroup("Example");
        sg.getStatements().add(new BELStatement("p(AKT1) => g(EGID:1024)"));
        sglist.add(sg);
        final BELDocument beldoc = new BELDocument(dh, null, nsset, sglist);

        // convert to common model
        final BELDocumentConverter converter = new BELDocumentConverter();
        final Document doc = converter.convert(beldoc);
View Full Code Here

Examples of org.openbel.bel.model.BELDocument

        BELParseResults parse = BELParser.parse(belscript);
        assertTrue(parse.getSyntaxWarnings().isEmpty());
        assertTrue(parse.getSyntaxErrors().isEmpty());

        BELDocument doc = parse.getDocument();
        assertNotNull(doc);

        List<BELStatementGroup> groups = doc.getBelStatementGroups();
        BELStatementGroup group = groups.get(0);
        List<BELStatement> stmts = group.getStatements();
        assertTrue(stmts.size() == 1);

        BELStatement stmt = stmts.get(0);
View Full Code Here

Examples of org.openbel.bel.model.BELDocument

                    } else if (!docprop.containsKey(BELDocumentProperty.VERSION)) {
                        addError(new DocumentVersionException(lastDocumentPropertyLocation, 0));
                    } else {
                        if (documentStatementGroup.getStatements().isEmpty()) {
                            // statements are only contained in explicitly-defined statement groups
                            retval.doc = new BELDocument(BELDocumentHeader.create(docprop), adlist, nslist, statementGroups);
                        } else {
                            // statements are defined in the implicit document statement group and possibly child statement groups
                            documentStatementGroup.setChildStatementGroups(statementGroups);
                            retval.doc = new BELDocument(BELDocumentHeader.create(docprop), adlist, nslist, Arrays.asList(documentStatementGroup));
                        }
                    }
               

            }
View Full Code Here

Examples of org.openbel.bel.model.BELDocument

            System.out.println(o);
        }
        assertTrue(parse.getSyntaxWarnings().isEmpty());
        assertTrue(parse.getSyntaxErrors().isEmpty());

        BELDocument doc = parse.getDocument();
        assertNotNull(doc);

        List<BELStatementGroup> groups = doc.getBelStatementGroups();
        BELStatementGroup group = groups.get(0);
        List<BELStatement> stmts = group.getStatements();
        assertTrue(stmts.size() == 1);

        BELStatement stmt = stmts.get(0);
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.