Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.AddOntologyAnnotation


                        manager.applyChange(new RemoveOntologyAnnotation(
                                ontology, annotation));
                    }
                    for (OWLAnnotation annotation : changed) {
                        assert annotation != null;
                        manager.applyChange(new AddOntologyAnnotation(ontology,
                                annotation));
                    }
                }
            }
        }
View Full Code Here


                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 {
                LOG.error("Cannot translate: {}", clause);
                // TODO
View Full Code Here

     */
    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

                    man.makeLoadImportRequest(decl, configuration);
                    break;
                }
                case ANNOTATION: {
                    anno = Annotation();
                    applyChange(new AddOntologyAnnotation(ontology, anno));
                    currentAnnotations.clear();
                    break;
                }
                default:
                    jj_la1[4] = jj_gen;
View Full Code Here

                    }
                }
                for (OWLAnnotation anno : header.getAnnotations()) {
                    assert anno != null;
                    ontologyAnnotations
                            .add(new AddOntologyAnnotation(ont, anno));
                }
                ontologyID = header.getOntologyID();
            } else if (DISJOINT_CLASSES.matches(section)) {
                axioms.addAll(parseDisjointClasses());
            } else if (EQUIVALENT_CLASSES.matches(section)) {
View Full Code Here

        OWLOntology o = m.createOntology();
        OWLLiteral l = m.getOWLDataFactory().getOWLLiteral("test",
                OWL2Datatype.RDF_PLAIN_LITERAL);
        OWLAnnotation a = m.getOWLDataFactory().getOWLAnnotation(
                m.getOWLDataFactory().getRDFSComment(), l);
        m.applyChange(new AddOntologyAnnotation(o, a));
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        m.saveOntology(o, out);
        String expected = "<rdfs:comment>test</rdfs:comment>";
        assertTrue(out.toString(), out.toString().contains(expected));
    }
View Full Code Here

                assert type != null;
                addAxioms(toReturn, toCopy.getAxioms(type));
            }
            for (OWLAnnotation a : toCopy.getAnnotations()) {
                assert a != null;
                applyChange(new AddOntologyAnnotation(toReturn, a));
            }
        }
        // toReturn now initialized
        assert toReturn != null;
        OWLOntologyManager m = toCopy.getOWLOntologyManager();
View Full Code Here

        OWLOntology ont = getOWLOntology("AnnotationOntology");
        OWLAnnotationProperty prop = AnnotationProperty(IRI("http://www.semanticweb.org/ontologies/test/annotationont#prop"));
        OWLLiteral value = Literal(33);
        OWLAnnotation annotation = Annotation(prop, value);
        ont.getOWLOntologyManager().applyChange(
                new AddOntologyAnnotation(ont, annotation));
        ont.getOWLOntologyManager().addAxiom(ont, Declaration(prop));
        return ont;
    }
View Full Code Here

                    df.getOWLAnnotationAssertionAxiom(df.getRDFSLabel(),
                            annotationPropertyIRI, nameLiteral)));
        } else {
            OWLAnnotation annotation = getAnnotationForTagValuePair(
                    OBOVocabulary.SYNONYM_TYPE_DEF.getName(), value);
            applyChange(new AddOntologyAnnotation(getOntology(), annotation));
        }
        // ID QuotedString [Scope]
        // 18th April 2012
        // AnnotationProperty(T(ID))
        // SubAnnotationPropertyOf(T(ID) T(subsetdef))
View Full Code Here

    }

    @Nonnull
    @Override
    public AddOntologyAnnotation createOntologyChange(OWLOntology ontology) {
        return new AddOntologyAnnotation(ontology, getAnnotation());
    }
View Full Code Here

TOP

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

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.