Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLAnnotation


                }
                else {
                    // Ontology annotations
                    OWLLiteral con = getDataFactory().getOWLLiteral(value);
                    OWLAnnotationProperty property = getDataFactory().getOWLAnnotationProperty(getIRI(tag));
                    OWLAnnotation anno = getDataFactory().getOWLAnnotation(property, con);
                    owlOntologyManager.applyChange(new AddOntologyAnnotation(ontology, anno));
                }
            }
            else if (currentId != null) {
                // Add as annotation
                if (configuration.isLoadAnnotationAxioms()) {
                    IRI subject = getIRI(currentId);
                    OWLLiteral con = getDataFactory().getOWLLiteral(value, "");
                    OWLAnnotationProperty property = getDataFactory().getOWLAnnotationProperty(getIRI(tag));
                    OWLAnnotation anno = getDataFactory().getOWLAnnotation(property, con);
                    OWLAnnotationAssertionAxiom ax = getDataFactory().getOWLAnnotationAssertionAxiom(subject, anno);
                    owlOntologyManager.addAxiom(ontology, ax);
                    OWLDeclarationAxiom annotationPropertyDeclaration = getDataFactory().getOWLDeclarationAxiom(property);
                    owlOntologyManager.addAxiom(ontology, annotationPropertyDeclaration);
                }
View Full Code Here


        }
        return format;
  }

  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) {
View Full Code Here

   
  }

  final public Set<OWLAnnotation> AxiomAnnotationSet() throws ParseException {
    Set<OWLAnnotation> annos = null;
    OWLAnnotation anno;
    label_15:
    while (true) {
      if (jj_2_105(2)) {
       
      } else {
View Full Code Here

            for (OWLOntology ont : ontologies) {
                for (OWLDataPropertyAssertionAxiom ax : ont.getDataPropertyAssertionAxioms(ind)) {
                    if (!ax.getProperty().isAnonymous()) {
                        changes.add(new RemoveAxiom(ont, ax));
                        OWLDataFactory df = getDataFactory();
                        OWLAnnotation anno = df.getOWLAnnotation(df.getOWLAnnotationProperty(ax.getProperty().asOWLDataProperty().getIRI()),
                                ax.getObject());
                        OWLAnnotationAssertionAxiom annoAx = df.getOWLAnnotationAssertionAxiom(ind.getIRI(), anno);
                        changes.add(new AddAxiom(ont, annoAx));
                        convertedDataProperties.add((OWLDataProperty) ax.getProperty());
                    }
View Full Code Here

        }
        else {
            value = object;
        }
        OWLAnnotationProperty prop = getDataFactory().getOWLAnnotationProperty(predicate);
        OWLAnnotation anno = getDataFactory().getOWLAnnotation(prop, value);
        OWLAnnotationSubject annoSubject;
        if(isAnonymous(subject)) {
            annoSubject = getDataFactory().getOWLAnonymousIndividual(subject.toString());
        }
        else {
View Full Code Here

        if(matcher.matches()) {
            IRI synonymIRI = getTagIRI(TAG_NAME);
            OWLDataFactory df = getDataFactory();
            OWLAnnotationProperty property = df.getOWLAnnotationProperty(synonymIRI);
            Set<OWLAnnotation> annotations = new HashSet<OWLAnnotation>();
            OWLAnnotation typeAnnotation = getSynonymTypeAnnotation(matcher);
            annotations.add(typeAnnotation);
            annotations.addAll(getXRefAnnotations(matcher, df));

            OWLEntity subject = getConsumer().getCurrentEntity();
            String synonym = matcher.group(VALUE_GROUP);
View Full Code Here

            StringTokenizer tokenizer = new StringTokenizer(xrefs, ",");
            while(tokenizer.hasMoreTokens()) {
                String xref = tokenizer.nextToken();
                IRI xrefIRI = getTagIRI(xref);
                OWLAnnotationProperty xrefProperty = df.getOWLAnnotationProperty(XREF_IRI);
                OWLAnnotation xrefAnnotation = df.getOWLAnnotation(xrefProperty, xrefIRI);
                annotations.add(xrefAnnotation);
            }
        }
        return annotations;
    }
View Full Code Here

            }
        }

        if (tvpList.getValues(OBOVocabulary.NAME).isEmpty()) { // one name required!!
            if (!potentialNames.isEmpty()) {
                OWLAnnotation firstLabel = potentialNames.iterator().next();
                tvpList.addPair(OBOVocabulary.NAME, ((OWLLiteral) firstLabel.getValue()).getLiteral());
                potentialNames.remove(firstLabel);
            }
            else {
                tvpList.addPair(OBOVocabulary.NAME, getID(entity));
            }
View Full Code Here

    @Override
  public boolean equals(Object obj) {
        if (super.equals(obj)) {
            if (obj instanceof OWLAnnotation) {
                OWLAnnotation other = (OWLAnnotation) obj;
                return other.getProperty().equals(property) && other.getValue().equals(value) && other.getAnnotations().equals(annotations);
            }
        }
        return false;
    }
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.