Examples of Clause


Examples of org.obolibrary.oboformat.model.Clause

            error(ax, false);
            return;
        }
        OWLClass cls1 = ce1.asOWLClass();
        Frame f = getTermFrame(cls1);
        Clause c = new Clause(OboFormatTag.TAG_DISJOINT_FROM.getTag());
        c.setValue(cls2);
        f.addClause(c);
        addQualifiers(c, ax.getAnnotations());
    }
View Full Code Here

Examples of org.obolibrary.oboformat.model.Clause

    private static void addOboNamespace(@Nullable Collection<Frame> frames,
            String defaultOboNamespace) {
        if (frames != null && !frames.isEmpty()) {
            for (Frame termFrame : frames) {
                Clause clause = termFrame.getClause(OboFormatTag.TAG_NAMESPACE);
                if (clause == null) {
                    clause = new Clause(OboFormatTag.TAG_NAMESPACE,
                            defaultOboNamespace);
                    termFrame.addClause(clause);
                }
            }
        }
View Full Code Here

Examples of org.obolibrary.oboformat.model.Clause

        List<String> danglingReferences = new ArrayList<>();
        // check term frames
        for (Frame f : doc.getTermFrames()) {
            for (String tag : f.getTags()) {
                OboFormatTag tagconstant = OBOFormatConstants.getTag(tag);
                Clause c = f.getClause(tag);
                if (tagconstant == OboFormatTag.TAG_INTERSECTION_OF
                        || tagconstant == OboFormatTag.TAG_UNION_OF
                        || tagconstant == OboFormatTag.TAG_EQUIVALENT_TO
                        || tagconstant == OboFormatTag.TAG_DISJOINT_FROM
                        || tagconstant == OboFormatTag.TAG_RELATIONSHIP
                        || tagconstant == OboFormatTag.TAG_IS_A) {
                    if (c.getValues().size() > 1) {
                        String error = checkRelation(c.getValue(String.class),
                                tag, f.getId(), doc);
                        if (error != null) {
                            danglingReferences.add(error);
                        }
                        error = checkClassReference(c.getValue2(String.class),
                                tag, f.getId(), doc);
                        if (error != null) {
                            danglingReferences.add(error);
                        }
                    } else {
                        String error = checkClassReference(
                                c.getValue(String.class), tag, f.getId(), doc);
                        if (error != null) {
                            danglingReferences.add(error);
                        }
                    }
                }
            }
        }
        // check typedef frames
        for (Frame f : doc.getTypedefFrames()) {
            for (String tag : f.getTags()) {
                OboFormatTag tagConstant = OBOFormatConstants.getTag(tag);
                Clause c = f.getClause(tag);
                assert c != null;
                if (tagConstant == OboFormatTag.TAG_IS_A
                        || tagConstant == OboFormatTag.TAG_INTERSECTION_OF
                        || tagConstant == OboFormatTag.TAG_UNION_OF
                        || tagConstant == OboFormatTag.TAG_EQUIVALENT_TO
                        || tagConstant == OboFormatTag.TAG_DISJOINT_FROM
                        || tagConstant == OboFormatTag.TAG_INVERSE_OF
                        || tagConstant == OboFormatTag.TAG_TRANSITIVE_OVER
                        || tagConstant == OboFormatTag.TAG_DISJOINT_OVER) {
                    String error = checkRelation(c.getValue(String.class), tag,
                            f.getId(), doc);
                    if (error != null) {
                        danglingReferences.add(error);
                    }
                } else if (tagConstant == OboFormatTag.TAG_HOLDS_OVER_CHAIN
                        || tagConstant == OboFormatTag.TAG_EQUIVALENT_TO_CHAIN
                        || tagConstant == OboFormatTag.TAG_RELATIONSHIP) {
                    String error = checkRelation(c.getValue().toString(), tag,
                            f.getId(), doc);
                    if (error != null) {
                        danglingReferences.add(error);
                    }
                    error = checkRelation(c.getValue2().toString(), tag,
                            f.getId(), doc);
                    if (error != null) {
                        danglingReferences.add(error);
                    }
                } else if (tagConstant == OboFormatTag.TAG_DOMAIN
                        || tagConstant == OboFormatTag.TAG_RANGE) {
                    String error = checkClassReference(c.getValue().toString(),
                            tag, f.getId(), doc);
                    if (error != null) {
                        danglingReferences.add(error);
                    }
                }
View Full Code Here

Examples of org.obolibrary.oboformat.model.Clause

        String id = getIdentifier(entity.getIRI());
        Frame f = getObodoc().getTermFrame(id);
        if (f == null) {
            f = new Frame(FrameType.TERM);
            f.setId(id);
            f.addClause(new Clause(OboFormatTag.TAG_ID, id));
            add(f);
        }
        return f;
    }
View Full Code Here

Examples of org.obolibrary.oboformat.model.Clause

        String id = getIdentifier(entity);
        Frame f = getObodoc().getTypedefFrame(id);
        if (f == null) {
            f = new Frame(FrameType.TYPEDEF);
            f.setId(id);
            f.addClause(new Clause(OboFormatTag.TAG_ID, id));
            add(f);
        }
        return f;
    }
View Full Code Here

Examples of org.obolibrary.oboformat.model.Clause

            return;
        }
        String clsIRI = ((OWLClass) cls).getIRI().toString();
        if (IRI_CLASS_SYNONYMTYPEDEF.equals(clsIRI)) {
            Frame f = getObodoc().getHeaderFrame();
            Clause c = new Clause(OboFormatTag.TAG_SYNONYMTYPEDEF.getTag());
            OWLNamedIndividual indv = (OWLNamedIndividual) ax.getIndividual();
            String indvId = getIdentifier(indv);
            // TODO: full specify this in the spec document.
            // we may want to allow full IDs for subsets in future.
            // here we would have a convention that an unprefixed
            // subsetdef/synonymtypedef
            // gets placed in a temp ID space, and only this id space is
            // stripped
            indvId = indvId.replaceFirst(".*:", "");
            c.addValue(indvId);
            c.addValue(indvId);
            String nameValue = "";
            String scopeValue = null;
            for (OWLAnnotation ann : annotations(getOWLOntology()
                    .getAnnotationAssertionAxioms(indv.getIRI()))) {
                String propId = ann.getProperty().getIRI().toString();
                String value = ((OWLLiteral) ann.getValue()).getLiteral();
                if (OWLRDFVocabulary.RDFS_LABEL.getIRI().toString()
                        .equals(propId)) {
                    nameValue = '"' + value + '"';
                } else {
                    scopeValue = value;
                }
            }
            c.addValue(nameValue);
            if (scopeValue != null) {
                c.addValue(scopeValue);
            }
            f.addClause(c);
        } else if (IRI_CLASS_SUBSETDEF.equals(clsIRI)) {
            Frame f = getObodoc().getHeaderFrame();
            Clause c = new Clause(OboFormatTag.TAG_SUBSETDEF.getTag());
            OWLNamedIndividual indv = (OWLNamedIndividual) ax.getIndividual();
            String indvId = getIdentifier(indv);
            // TODO: full specify this in the spec document.
            // we may want to allow full IDs for subsets in future.
            // here we would have a convention that an unprefixed
            // subsetdef/synonymtypedef
            // gets placed in a temp ID space, and only this id space is
            // stripped
            indvId = indvId.replaceFirst(".*:", "");
            c.addValue(indvId);
            String nameValue = "";
            for (OWLAnnotation ann : annotations(getOWLOntology()
                    .getAnnotationAssertionAxioms(indv.getIRI()))) {
                String propId = ann.getProperty().getIRI().toString();
                String value = ((OWLLiteral) ann.getValue()).getLiteral();
                if (OWLRDFVocabulary.RDFS_LABEL.getIRI().toString()
                        .equals(propId)) {
                    nameValue = '"' + value + '"';
                }
            }
            c.addValue(nameValue);
            f.addClause(c);
        } else {
            // TODO: individual
        }
    }
View Full Code Here

Examples of org.obolibrary.oboformat.model.Clause

        return true;
    }

    protected void parseHeaderClause(@Nonnull Frame h) {
        String t = getParseTag();
        Clause cl = new Clause(t);
        OboFormatTag tag = OBOFormatConstants.getTag(t);
        h.addClause(cl);
        if (tag == OboFormatTag.TAG_DATA_VERSION) {
            parseUnquotedString(cl);
        } else if (tag == OboFormatTag.TAG_FORMAT_VERSION) {
View Full Code Here

Examples of org.obolibrary.oboformat.model.Clause

        // comment line:
        if (stream.peekCharIs('!')) {
            parseHiddenComment();
            forceParseNlOrEof();
        } else {
            Clause cl = parseTermFrameClause();
            parseEOL(cl);
            f.addClause(cl);
        }
    }
View Full Code Here

Examples of org.obolibrary.oboformat.model.Clause

     * @return parsed clause
     */
    @Nonnull
    public Clause parseTermFrameClause() {
        String t = getParseTag();
        Clause cl = new Clause(t);
        if (parseDeprecatedSynonym(t, cl)) {
            return cl;
        }
        OboFormatTag tag = OBOFormatConstants.getTag(t);
        if (tag == null) {
View Full Code Here

Examples of org.obolibrary.oboformat.model.Clause

        // comment line:
        if (stream.peekCharIs('!')) {
            parseHiddenComment();
            forceParseNlOrEof();
        } else {
            Clause cl = parseTypedefFrameClause();
            parseEOL(cl);
            f.addClause(cl);
        }
    }
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.