Java 类org.semanticweb.owlapi.model.AddOntologyAnnotation 实例源码

项目:OntoBench    文件:DcIdentifierFeature.java   
@Override
public void addToOntology() {
  OWLAnnotationProperty property = factory.getOWLAnnotationProperty(IRI.create(Namespaces.DC + "identifier"));

  Optional<IRI> optionalIri = ontology.getOntologyID().getOntologyIRI();
  if (optionalIri.isPresent()) {
    String iri = optionalIri.get().toString();
    OWLAnnotation identifier = factory.getOWLAnnotation(property, factory.getOWLLiteral(iri));

    addChangeToOntology(new AddOntologyAnnotation(ontology, identifier));
  }
}
项目:OntoBench    文件:DcContributorFeature.java   
@Override
public void addToOntology() {
  OWLAnnotationProperty property = factory.getOWLAnnotationProperty(IRI.create(Namespaces.DC + "contributor"));
  OWLAnnotation contributor = factory.getOWLAnnotation(property, factory.getOWLLiteral(ontologyConstants.getContributor()));

  addChangeToOntology(new AddOntologyAnnotation(ontology, contributor));
}
项目:OntoBench    文件:DcDescriptionFeature.java   
@Override
public void addToOntology() {
  OWLAnnotationProperty property = factory.getOWLAnnotationProperty(IRI.create(Namespaces.DC + "description"));
  OWLAnnotation description = factory.getOWLAnnotation(property, factory.getOWLLiteral(ontologyConstants.getDescription()));

  addChangeToOntology(new AddOntologyAnnotation(ontology, description));
}
项目:OntoBench    文件:DcDateFeature.java   
@Override
public void addToOntology() {
  OWLAnnotationProperty property = factory.getOWLAnnotationProperty(IRI.create(Namespaces.DC + "date"));
  OWLAnnotation date = factory.getOWLAnnotation(property, factory.getOWLLiteral(ontologyConstants.getGenerationDate()));

  addChangeToOntology(new AddOntologyAnnotation(ontology, date));
}
项目:OntoBench    文件:DcTitleFeature.java   
@Override
public void addToOntology() {
  OWLAnnotationProperty property = factory.getOWLAnnotationProperty(IRI.create(Namespaces.DC + "title"));
  OWLAnnotation title = factory.getOWLAnnotation(property, factory.getOWLLiteral(ontologyConstants.getTitle()));

  addChangeToOntology(new AddOntologyAnnotation(ontology, title));
}
项目:OntoBench    文件:DcPublisherFeature.java   
@Override
public void addToOntology() {
  OWLAnnotationProperty property = factory.getOWLAnnotationProperty(IRI.create(Namespaces.DC + "publisher"));
  OWLAnnotation publisher = factory.getOWLAnnotation(property, factory.getOWLLiteral(ontologyConstants.getCreator()));

  addChangeToOntology(new AddOntologyAnnotation(ontology, publisher));
}
项目:OntoBench    文件:DcCreatorFeature.java   
@Override
public void addToOntology() {
  OWLAnnotationProperty property = factory.getOWLAnnotationProperty(IRI.create(Namespaces.DC + "creator"));
  OWLAnnotation creator = factory.getOWLAnnotation(property, factory.getOWLLiteral(ontologyConstants.getCreator()));

  addChangeToOntology(new AddOntologyAnnotation(ontology, creator));
}
项目:OntoBench    文件:RdfsSeeAlsoFeature.java   
@Override
public void addToOntology() {
  OWLAnnotationProperty annotationProperty = factory.getOWLAnnotationProperty(RDFS_SEE_ALSO, pm);
  OWLAnnotation annotation = factory.getOWLAnnotation(annotationProperty, IRI.create(requestInformation.getGeneratorIri()));

  addChangeToOntology(new AddOntologyAnnotation(ontology, annotation));
}
项目:OntoBench    文件:RdfsLabelOnOntologyFeature.java   
@Override
public void addToOntology() {
  OWLLiteral titleLiteral = factory.getOWLLiteral(ontologyConstants.getTitle());
  OWLAnnotation title = factory.getOWLAnnotation(factory.getRDFSLabel(), titleLiteral);

  addChangeToOntology(new AddOntologyAnnotation(ontology, title));
}
项目:OntoBench    文件:RdfsCommentOnOntologyFeature.java   
@Override
public void addToOntology() {
  OWLLiteral descriptionLiteral = factory.getOWLLiteral(ontologyConstants.getDescription());
  OWLAnnotation comment = factory.getOWLAnnotation(factory.getRDFSComment(), descriptionLiteral);

  addChangeToOntology(new AddOntologyAnnotation(ontology, comment));
}
项目:OntoBench    文件:RdfsIsDefinedByFeature.java   
@Override
public void addToOntology() {
  OWLAnnotationProperty annotationProperty = factory.getOWLAnnotationProperty(RDFS_IS_DEFINED_BY, pm);
  OWLAnnotation annotation = factory.getOWLAnnotation(annotationProperty, IRI.create(requestInformation.getGeneratorIri()));

  addChangeToOntology(new AddOntologyAnnotation(ontology, annotation));
}
项目:OntoBench    文件:OwlIncompatibleWithFeature.java   
@Override
public void addToOntology() {
  OWLAnnotationProperty annotationProperty = factory.getOWLAnnotationProperty(OWL_INCOMPATIBLE_WITH, pm);
  IRI value = OntologyConstants.ONTOVIBE_CORE_IRI;
  OWLAnnotation annotation = factory.getOWLAnnotation(annotationProperty, value);

  addChangeToOntology(new AddOntologyAnnotation(ontology, annotation));
}
项目:OntoBench    文件:OwlVersionInfoFeature.java   
@Override
public void addToOntology() {
  OWLLiteral version = factory.getOWLLiteral(ontologyConstants.getVersion());
  OWLAnnotation owlVersionInfo = factory.getOWLAnnotation(factory.getOWLVersionInfo(), version);

  addChangeToOntology(new AddOntologyAnnotation(ontology, owlVersionInfo));
}
项目:OntoBench    文件:OwlBackwardCompatibleWithFeature.java   
@Override
public void addToOntology() {
  OWLAnnotationProperty annotationProperty = factory.getOWLAnnotationProperty(OWL_BACKWARD_COMPATIBLE_WITH, pm);
  IRI value = OntologyConstants.ONTOVIBE_MINIMAL_IRI;
  OWLAnnotation annotation = factory.getOWLAnnotation(annotationProperty, value);

  addChangeToOntology(new AddOntologyAnnotation(ontology, annotation));
}
项目:OntoBench    文件:OwlPriorVersionFeature.java   
@Override
public void addToOntology() {
  OWLAnnotationProperty annotationProperty = factory.getOWLAnnotationProperty(OWL_PRIOR_VERSION, pm);
  IRI value = OntologyConstants.ONTOVIBE_CORE_IRI;
  OWLAnnotation annotation = factory.getOWLAnnotation(annotationProperty, value);

  addChangeToOntology(new AddOntologyAnnotation(ontology, annotation));
}
项目:OntoBench    文件:OwlImportsFeature.java   
@Override
public void addToOntology() {
  OWLAnnotationProperty annotationProperty = factory.getOWLAnnotationProperty(OWL_IMPORTS, pm);
  IRI value = OntologyConstants.ONTOVIBE_MINIMAL_IRI;
  OWLAnnotation annotation = factory.getOWLAnnotation(annotationProperty, value);

  addChangeToOntology(new AddOntologyAnnotation(ontology, annotation));
}
项目:OntoBench    文件:DcTermsContributorFeature.java   
@Override
public void addToOntology() {
  OWLAnnotationProperty property = factory.getOWLAnnotationProperty(IRI.create(Namespaces.DCTERMS + "contributor"));
  OWLAnnotation contributor = factory.getOWLAnnotation(property, factory.getOWLLiteral(ontologyConstants.getContributor()));

  addChangeToOntology(new AddOntologyAnnotation(ontology, contributor));
}
项目:OntoBench    文件:DcTermsDescriptionFeature.java   
@Override
public void addToOntology() {
  OWLAnnotationProperty property = factory.getOWLAnnotationProperty(IRI.create(Namespaces.DCTERMS + "description"));
  OWLAnnotation description = factory.getOWLAnnotation(property, factory.getOWLLiteral(ontologyConstants.getDescription()));

  addChangeToOntology(new AddOntologyAnnotation(ontology, description));
}
项目:OntoBench    文件:DcTermsIdentifierFeature.java   
@Override
public void addToOntology() {
  OWLAnnotationProperty property = factory.getOWLAnnotationProperty(IRI.create(Namespaces.DCTERMS + "identifier"));

  Optional<IRI> optionalIri = ontology.getOntologyID().getOntologyIRI();
  if (optionalIri.isPresent()) {
    String iri = optionalIri.get().toString();
    OWLAnnotation identifier = factory.getOWLAnnotation(property, factory.getOWLLiteral(iri));

    addChangeToOntology(new AddOntologyAnnotation(ontology, identifier));
  }
}
项目:OntoBench    文件:DcTermsTitleFeature.java   
@Override
public void addToOntology() {
  OWLAnnotationProperty property = factory.getOWLAnnotationProperty(IRI.create(Namespaces.DCTERMS + "title"));
  OWLAnnotation title = factory.getOWLAnnotation(property, factory.getOWLLiteral(ontologyConstants.getTitle()));

  addChangeToOntology(new AddOntologyAnnotation(ontology, title));
}
项目:OntoBench    文件:DcTermsDateFeature.java   
@Override
public void addToOntology() {
  OWLAnnotationProperty property = factory.getOWLAnnotationProperty(IRI.create(Namespaces.DCTERMS + "date"));
  OWLAnnotation date = factory.getOWLAnnotation(property, factory.getOWLLiteral(ontologyConstants.getGenerationDate()));

  addChangeToOntology(new AddOntologyAnnotation(ontology, date));
}
项目:OntoBench    文件:DcTermsPublisherFeature.java   
@Override
public void addToOntology() {
  OWLAnnotationProperty property = factory.getOWLAnnotationProperty(IRI.create(Namespaces.DCTERMS + "publisher"));
  OWLAnnotation publisher = factory.getOWLAnnotation(property, factory.getOWLLiteral(ontologyConstants.getCreator()));

  addChangeToOntology(new AddOntologyAnnotation(ontology, publisher));
}
项目:OntoBench    文件:DcTermsCreatorFeature.java   
@Override
public void addToOntology() {
  OWLAnnotationProperty property = factory.getOWLAnnotationProperty(IRI.create(Namespaces.DCTERMS + "creator"));
  OWLAnnotation creator = factory.getOWLAnnotation(property, factory.getOWLLiteral(ontologyConstants.getCreator()));

  addChangeToOntology(new AddOntologyAnnotation(ontology, creator));
}
项目:minerva    文件:CoreMolecularModelManager.java   
public void addModelAnnotations(ModelContainer model, Collection<OWLAnnotation> annotations, METADATA metadata) {
    OWLOntology aBox = model.getAboxOntology();
    List<OWLOntologyChange> changes = new ArrayList<OWLOntologyChange>();
    for (OWLAnnotation annotation : annotations) {
        changes.add(new AddOntologyAnnotation(aBox, annotation));
    }
    applyChanges(model, changes, metadata);
}
项目:minerva    文件:CoreMolecularModelManager.java   
public void updateAnnotation(ModelContainer model, OWLAnnotation update, METADATA metadata) {
    OWLOntology aBox = model.getAboxOntology();
    List<OWLOntologyChange> changes = new ArrayList<OWLOntologyChange>();
    Set<OWLAnnotation> existing = model.getAboxOntology().getAnnotations();
    OWLAnnotationProperty target = update.getProperty();
    for (OWLAnnotation annotation : existing) {
        if (target.equals(annotation.getProperty())) {
            changes.add(new RemoveOntologyAnnotation(aBox, annotation));
        }
    }
    changes.add(new AddOntologyAnnotation(aBox, update));
    applyChanges(model, changes, metadata);
}
项目:owltools    文件:OWLGraphWrapperBasic.java   
private void addCommentToOntology(OWLOntology ont, String cmt) {
    OWLDataFactory df = getDataFactory();
    OWLAnnotationProperty p = 
            df.getOWLAnnotationProperty(OWLRDFVocabulary.RDFS_COMMENT.getIRI());
    OWLLiteral v = df.getOWLLiteral(cmt);
    OWLAnnotation ann = df.getOWLAnnotation(p, v);
    AddOntologyAnnotation addAnn = 
            new AddOntologyAnnotation(ont, ann);
    getManager().applyChange(addAnn);
}
项目:owltools    文件:OWLConverter.java   
/**
 * Convenience method for adding an annotation assertion to the
 * ontology itself, taking a CURIE for the property and an Boolean literal.
 *
 * @param ontology the current ontology
 * @param propertyCURIE will be expanded to the full annotation
 *  property IRI
 * @param value the literal value of the annotation
 * @return the annotation axiom
 */
protected static OWLAnnotation annotate(OWLOntology ontology,
        String propertyCURIE, IRI value) {
    OWLOntologyManager manager = ontology.getOWLOntologyManager();
    OWLDataFactory dataFactory = manager.getOWLDataFactory();
    IRI iri = format.getIRI(propertyCURIE);
    OWLAnnotationProperty property =
        dataFactory.getOWLAnnotationProperty(iri);
    OWLAnnotation annotation = dataFactory.getOWLAnnotation(
            property, value);
    manager.applyChange(
        new AddOntologyAnnotation(ontology, annotation));
    return annotation;
}
项目:owltools    文件:OWLConverter.java   
/**
 * Convenience method for adding an annotation assertion to the
 * ontology itself, taking a CURIE for the property and an Boolean literal.
 *
 * @param ontology the current ontology
 * @param propertyCURIE will be expanded to the full annotation
 *  property IRI
 * @param value the literal value of the annotation
 * @return the annotation axiom
 */
protected static OWLAnnotation annotate(OWLOntology ontology,
        String propertyCURIE, String value) {
    OWLOntologyManager manager = ontology.getOWLOntologyManager();
    OWLDataFactory dataFactory = manager.getOWLDataFactory();
    IRI iri = format.getIRI(propertyCURIE);
    OWLAnnotationProperty property =
        dataFactory.getOWLAnnotationProperty(iri);
    OWLLiteral literal = dataFactory.getOWLLiteral(value);
    OWLAnnotation annotation = dataFactory.getOWLAnnotation(
            property, literal);
    manager.applyChange(
        new AddOntologyAnnotation(ontology, annotation));
    return annotation;
}
项目:ISAAC    文件:OWLExporter.java   
/**
 * Instantiates a {@link OWLExporter} from the specified parameters.
 *
 * @param fileOutputStream the file output stream
 * @throws Exception if something goes wrong in constructor
 */
public OWLExporter(OutputStream fileOutputStream) throws Exception {
  dos = new DataOutputStream(new BufferedOutputStream(fileOutputStream));
  if (snomed == null) {
    // Create a new ontology
    snomed =
        manager
            .createOntology(new OWLOntologyID(snomedIRI, snomedVersionIRI));
    format.setParameter("xml:base", snomedNamespace);

    // Obtain SNOMED root concept
    // TODO: this needs to be generalized
    UUID snomedRootUUID = Taxonomies.SNOMED.getUuids()[0];
    ConceptVersionBI snomedRootConcept =
        OTFUtility.getConceptVersion(snomedRootUUID);

    // Add annotation based on root concept
    for (DescriptionVersionBI<?> desc : snomedRootConcept
        .getDescriptionsActive()) {
      if (desc.getText().contains("Release")) {
        manager.applyChange(new AddOntologyAnnotation(snomed, factory
            .getOWLAnnotation(factory
                .getOWLAnnotationProperty(OWLRDFVocabulary.OWL_VERSION_INFO
                    .getIRI()), factory.getOWLLiteral(desc.getText()))));
      }
      if (desc.getText().contains("IHTSDO")) {
        manager.applyChange(new AddOntologyAnnotation(snomed, factory
            .getOWLAnnotation(factory
                .getOWLAnnotationProperty(OWLRDFVocabulary.RDFS_COMMENT
                    .getIRI()), factory.getOWLLiteral(desc.getText()))));
      }
    }
    manager.applyChange(new AddOntologyAnnotation(snomed, factory
        .getOWLAnnotation(factory
            .getOWLAnnotationProperty(OWLRDFVocabulary.RDFS_LABEL.getIRI()),
            factory.getOWLLiteral(snomedOntologyName))));
  }
}
项目:minerva    文件:ReverseChangeGenerator.java   
public OWLOntologyChange visit(AddOntologyAnnotation addOntologyAnnotation) {
    return new RemoveOntologyAnnotation(addOntologyAnnotation.getOntology(), addOntologyAnnotation.getAnnotation());
}
项目:minerva    文件:ReverseChangeGenerator.java   
public OWLOntologyChange visit(RemoveOntologyAnnotation removeOntologyAnnotation) {
    return new AddOntologyAnnotation(removeOntologyAnnotation.getOntology(), removeOntologyAnnotation.getAnnotation());
}
项目:HermiT-android    文件:Reasoner.java   
public void ontologiesChanged(List<? extends OWLOntologyChange> changes)
        throws OWLException {
    for (OWLOntologyChange change : changes)
        if (!(change instanceof RemoveOntologyAnnotation || change instanceof AddOntologyAnnotation))
            m_pendingChanges.add(change);
}
项目:elk-reasoner    文件:OwlOntologyChangeProcessorVisitor.java   
@Override
public void visit(AddOntologyAnnotation change) {
    defaultVisit(change);
}
项目:Hermit_1.3.8_android    文件:Reasoner.java   
public void ontologiesChanged(List<? extends OWLOntologyChange> changes)
        throws OWLException {
    for (OWLOntologyChange change : changes)
        if (!(change instanceof RemoveOntologyAnnotation || change instanceof AddOntologyAnnotation))
            m_pendingChanges.add(change);
}
项目:owltools    文件:BioChebiGenerator.java   
private void addComment(String comment, OWLOntology ontology) {
    final OWLOntologyManager manager = ontology.getOWLOntologyManager();
    final OWLDataFactory factory = manager.getOWLDataFactory();
    OWLAnnotation ontAnn = factory.getOWLAnnotation(factory.getRDFSComment(), factory.getOWLLiteral(comment));
    manager.applyChange(new AddOntologyAnnotation(ontology, ontAnn));
}
项目:jcel    文件:JcelOntologyChangeVisitorEx.java   
@Override
public Boolean visit(AddOntologyAnnotation change) {
    Objects.requireNonNull(change);
    return false;
}
项目:Pellet4Android    文件:OntologyManager.java   
public void addAnnotationToOntology(String annotation, String value) {

        OWLDataFactory factory = manager.getOWLDataFactory();

        final OWLAnnotationProperty owlAnnotationProperty = factory
                .getOWLAnnotationProperty(IRI.create(annotation));

        final OWLAnnotationValue supportOntologyAnnValue = factory
                .getOWLLiteral(value, OWL2Datatype.RDF_PLAIN_LITERAL);

        final OWLAnnotation owlAnnotation = factory.getOWLAnnotation(
                owlAnnotationProperty, supportOntologyAnnValue);

        manager.applyChange(new AddOntologyAnnotation(getOntology(),
                owlAnnotation));
    }