Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLAnnotation


            } else if (values.size() == 2) {
                // property_value(Rel-ID Entity-ID Qualifiers)
                OWLAnnotationProperty prop = trAnnotationProp((String) v);
                OWLAnnotationValue value = trAnnotationProp(v2.toString())
                        .getIRI();
                OWLAnnotation ontAnn = fac.getOWLAnnotation(prop, value,
                        annotations);
                AddOntologyAnnotation addAnn = new AddOntologyAnnotation(
                        getOwlOntology(), ontAnn);
                apply(addAnn);
            } else if (values.size() == 3) {
                // property_value(Rel-ID Value XSD-Type Qualifiers)
                Iterator<Object> it = clause.getValues().iterator();
                it.next();
                it.next();
                String v3String = (String) it.next();
                IRI valueIRI;
                if (v3String.startsWith("xsd:")) {
                    valueIRI = IRI.create(Namespaces.XSD
                            + v3String.substring(4));
                } else {
                    valueIRI = IRI.create(v3String);
                }
                OWLAnnotationValue value = fac.getOWLLiteral((String) v2,
                        OWL2Datatype.getDatatype(valueIRI));
                OWLAnnotationProperty prop = trAnnotationProp((String) v);
                OWLAnnotation ontAnn = fac.getOWLAnnotation(prop, value,
                        annotations);
                AddOntologyAnnotation addAnn = new AddOntologyAnnotation(
                        getOwlOntology(), ontAnn);
                apply(addAnn);
            } else {
View Full Code Here


     *        the annotations
     */
    protected void addOntologyAnnotation(@Nonnull OWLAnnotationProperty ap,
            @Nonnull OWLAnnotationValue v,
            @Nonnull Set<OWLAnnotation> annotations) {
        OWLAnnotation ontAnn = fac.getOWLAnnotation(ap, v, annotations);
        AddOntologyAnnotation addAnn = new AddOntologyAnnotation(
                getOwlOntology(), ontAnn);
        apply(addAnn);
    }
View Full Code Here

            chain.add(trObjectProp(v));
            ax = fac.getOWLSubPropertyChainOfAxiom(chain, p, annotations);
        } else if (tagConstant == OboFormatTag.TAG_HOLDS_OVER_CHAIN
                || tagConstant == OboFormatTag.TAG_EQUIVALENT_TO_CHAIN) {
            if (tagConstant == OboFormatTag.TAG_EQUIVALENT_TO_CHAIN) {
                OWLAnnotation ann = fac.getOWLAnnotation(
                        trAnnotationProp(IRI_PROP_ISREVERSIBLEPROPERTYCHAIN),
                        trLiteral("true"));
                annotations.add(ann);
                // isReversiblePropertyChain
            }
View Full Code Here

            Object[] values = clause.getValues().toArray();
            String synType;
            if (values.length > 1) {
                synType = values[1].toString();
                if (values.length > 2) {
                    OWLAnnotation ann = fac
                            .getOWLAnnotation(
                                    trTagToAnnotationProp(OboFormatTag.TAG_HAS_SYNONYM_TYPE
                                            .getTag()),
                                    trAnnotationProp(values[2].toString())
                                            .getIRI());
                    annotations.add(ann);
                }
            } else {
                LOG.warn(
                        "Assume 'RELATED'for missing scope in synonym clause: {}",
                        clause);
                // we make allowances for obof1.0, where the synonym scope is
                // optional
                synType = OboFormatTag.TAG_RELATED.getTag();
            }
            ax = fac.getOWLAnnotationAssertionAxiom(trSynonymType(synType),
                    sub, trLiteral(clause.getValue()), annotations);
        } else if (tagConstant == OboFormatTag.TAG_XREF) {
            Xref xref = (Xref) clause.getValue();
            String xrefAnnotation = xref.getAnnotation();
            if (xrefAnnotation != null) {
                OWLAnnotation owlAnnotation = fac.getOWLAnnotation(
                        fac.getRDFSLabel(), fac.getOWLLiteral(xrefAnnotation));
                annotations.add(owlAnnotation);
            }
            ax = fac.getOWLAnnotationAssertionAxiom(trTagToAnnotationProp(tag),
                    sub, trLiteral(clause.getValue()), annotations);
View Full Code Here

        Collection<Xref> xrefs = clause.getXrefs();
        for (Xref x : xrefs) {
            if (x.getIdref() != null && !x.getIdref().isEmpty()) {
                OWLAnnotationProperty ap = trTagToAnnotationProp(OboFormatTag.TAG_XREF
                        .getTag());
                OWLAnnotation ann = fac.getOWLAnnotation(ap, trLiteral(x));
                anns.add(ann);
            }
        }
        Collection<QualifierValue> qvs = clause.getQualifierValues();
        for (QualifierValue qv : qvs) {
            String qTag = qv.getQualifier();
            if (SKIPPED_QUALIFIERS.contains(qTag)) {
                continue;
            }
            OWLAnnotationProperty ap = trTagToAnnotationProp(qTag);
            OWLAnnotation ann = fac.getOWLAnnotation(ap,
                    trLiteral(qv.getValue()));
            anns.add(ann);
        }
    }
View Full Code Here

        String sep = COMMA.keyword();
        Set<OWLAnnotation> annos = new HashSet<>();
        while (COMMA.matches(sep)) {
            potentialKeywords.clear();
            Set<OWLAnnotation> annotations = parseAnnotations();
            OWLAnnotation anno = parseAnnotation();
            anno = anno.getAnnotatedAnnotation(annotations);
            annos.add(anno);
            sep = peekToken();
            if (COMMA.matches(sep)) {
                consumeToken();
            }
View Full Code Here

    @Nonnull
    protected OWLAnnotation parseAnnotation() {
        OWLAnnotationProperty annoProp = parseAnnotationProperty();
        String obj = peekToken();
        OWLAnnotation anno = null;
        if (isIndividualName(obj) || isClassName(obj)
                || isObjectPropertyName(obj) || isDataPropertyName(obj)) {
            consumeToken();
            OWLAnnotationValue value;
            if (obj.startsWith("_:")) {
View Full Code Here

        throw new Error("Missing return statement in function");
    }

    final public void Ontology() throws ParseException, OWLParserException,
            UnloadableImportException {
        OWLAnnotation anno;
        OWLAxiom ax;
        OWLImportsDeclaration decl;
        int count = 0;
        IRI versionIRI = null;
        jj_consume_token(ONTOLOGY);
View Full Code Here

    final public OWLAnnotation Annotation() throws ParseException {
        OWLAnnotationProperty prop;
        OWLAnnotationValue val;
        Set<OWLAnnotation> annos = null;
        OWLAnnotation anno = null;
        jj_consume_token(ANNOTATION);
        annos = new HashSet<OWLAnnotation>();
        jj_consume_token(OPENPAR);
        label_14: while (true) {
            switch (jj_ntk == -1 ? jj_ntk_f() : jj_ntk) {
View Full Code Here

        throw new Error("Missing return statement in function");
    }

    final public Set<OWLAnnotation> AxiomAnnotationSet() throws ParseException {
        Set<OWLAnnotation> annos = null;
        OWLAnnotation anno;
        label_15: while (true) {
            switch (jj_ntk == -1 ? jj_ntk_f() : jj_ntk) {
                case ANNOTATION: {
                    ;
                    break;
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.model.OWLAnnotation

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.