Package org.openbel.framework.common.enums

Examples of org.openbel.framework.common.enums.RelationshipType


     * {@inheritDoc}
     */
    @Override
    public void checkRelationship(final Statement statement)
            throws SemanticWarning {
        RelationshipType r = statement.getRelationshipType();
        Object o = statement.getObject();

        if (o != null) {

            // Relationship must be present.
View Full Code Here


        // Ignore non-nested statements
        if (!statement.hasNestedStatement()) {
            return;
        }

        final RelationshipType relationship = statement.getRelationshipType();
        // No relationship? Ignore it, this is a different semantic check
        if (relationship == null) {
            return;
        }

        // Nested statement is causal, gold star for you
        if (relationship.isCausal()) {
            return;
        }

        // Try to provide context for where the warning is
        final StringBuilder bldr = new StringBuilder();
View Full Code Here

         */
        public static boolean isMacroStatement(Statement statement) {
            if (statement == null) {
                return false;
            }
            RelationshipType rel = statement.getRelationshipType();
            return HAS_MEMBERS == rel || HAS_COMPONENTS == rel;
        }
View Full Code Here

            return false;
        }
        if (s.getObject().getTerm() == null) {
            return false;
        }
        final RelationshipType r = s.getRelationshipType();
        if (!r.isDirected()) {
            return true;
        }
        return false;
    }
View Full Code Here

     */
    @Override
    public List<Statement> expand(Statement s) {
        Term sub = s.getSubject();
        Term obj = s.getObject().getTerm();
        final RelationshipType rel = s.getRelationshipType();

        final Statement stmt = new Statement(obj);
        stmt.setObject(new Object(sub));
        stmt.setRelationshipType(rel);

View Full Code Here

                // hang on to collapsed node
                ortho.put(opnode, node);
            } else {
                // handle all other edges by relationship type
                final RelationshipType rel = e.getRelationshipType();

                // lookup first seen relationship type
                KamNode node = rels.get(rel);

                // if not yet seen mark opposite node and edge as species collapse
View Full Code Here

        }
    }

    static RelationshipType readRelationship(ObjectInput in)
            throws IOException {
        RelationshipType ret = null;
        byte obyte = in.readByte();
        if (obyte == 1) {
            int relOrdinal = in.readInt();
            ret = RelationshipType.values()[relOrdinal];
        }
View Full Code Here

        } else {
            object = null;
        }

        // 5: relationship type
        RelationshipType rel = readRelationship(in);
        return new Statement(subject, comment, ag, object, rel);
    }
View Full Code Here

                ClassNotFoundException {
            // subject term is guaranteed non-null
            subjectTerm = in.readInt();

            relationship = null;
            RelationshipType rel = readRelationship(in);
            if (rel != null) {
                relationship = rel.getDisplayValue();
            }

            objectTerm = readInteger(in);
            nestedSubject = readInteger(in);
            nestedRelationship = readString(in);
View Full Code Here

         */
        @Override
        protected void _to(ObjectOutput out) throws IOException {
            // subject term is guaranteed non-null
            out.writeInt(subjectTerm);
            RelationshipType rel = RelationshipType.fromString(relationship);
            writeRelationship(out, rel);
            writeInteger(out, objectTerm);
            writeInteger(out, nestedSubject);
            out.writeObject(nestedRelationship);
            writeInteger(out, nestedObject);
View Full Code Here

TOP

Related Classes of org.openbel.framework.common.enums.RelationshipType

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.