Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.SetOntologyID


    public void handle(String id, String value) {
        // Set the base to be the default base + default prefix
        String uri = OBOVocabulary.ONTOLOGY_URI_BASE + "/" + value.toLowerCase();
        getConsumer().setDefaultNamespace(uri + "#");
        applyChange(new SetOntologyID(getOntology(), new OWLOntologyID(IRI.create(uri))));
    }
View Full Code Here


        // Versioning.
        OWLOntologyID id = o.getOntologyID();
        if (!id.isAnonymous() && id.getVersionIRI() == null) {
            IRI viri = IRI.create(requestUri);
            log.debug("Setting version IRI for export : {}", viri);
            changes.add(new SetOntologyID(o, new OWLOntologyID(id.getOntologyIRI(), viri)));
        }

        o.getOWLOntologyManager().applyChanges(changes);
        log.debug("Exported as Clerezza Graph in {} ms. Handing over to writer.", System.currentTimeMillis()
                - before);
View Full Code Here

        changes.addAll(imports);
        changes.addAll(ontologyAnnotations);
        for (OntologyAxiomPair pair : axioms) {
            changes.add(new AddAxiom(ont, pair.getAxiom()));
        }
        changes.add(new SetOntologyID(ont, ontologyID));
        ont.getOWLOntologyManager().applyChanges(changes);
        ManchesterOWLSyntaxOntologyFormat format = new ManchesterOWLSyntaxOntologyFormat();
        format.copyPrefixesFrom(pm);
        return format;
    }
View Full Code Here

        String stripped = unescaped.replace(" ", "-");
        if (!stripped.startsWith("http:")) {
            getConsumer().setDefaultNamespace(value.toUpperCase());
            IRI iri = getIdIRI(stripped);
            applyChange(new SetOntologyID(getOntology(), new OWLOntologyID(iri)));
        }
        else {
            if(stripped.endsWith("/")) {
                stripped = stripped.substring(0, stripped.length() - 1);
            }
            IRI iri = IRI.create(stripped);
            applyChange(new SetOntologyID(getOntology(), new OWLOntologyID(iri)));
        }

    }
View Full Code Here

    protected void applyChange(OWLOntologyChange change) {
        owlOntologyManager.applyChange(change);
    }

    protected void setOntologyID(OWLOntologyID ontologyID) {
        applyChange(new SetOntologyID(ontology, ontologyID));
    }
View Full Code Here

            // Do we need to change the ontology IRI?
            IRI ontologyIRIToSet = chooseOntologyIRI();
            if (ontologyIRIToSet != null) {
                IRI versionIRI = ontology.getOntologyID().getVersionIRI();
                applyChange(new SetOntologyID(ontology, new OWLOntologyID(ontologyIRIToSet, versionIRI)));
            }

            if (tripleProcessor.isLoggable(Level.FINE)) {
                tripleProcessor.fine("Loaded " + ontology.getOntologyID());
            }
View Full Code Here

    public void handle(String id, String value, String comment) {
        // The ontology name appears in lower case apparently
        IRI ontIRI = OBOVocabulary.ID2IRI(value);
        OWLOntologyID ontId = new OWLOntologyID(ontIRI);
        applyChange(new SetOntologyID(getOntology(), ontId));
    }
View Full Code Here

  public void handleTriple(IRI subject, IRI predicate, IRI object) throws UnloadableImportException {
        consumeTriple(subject, predicate, object);
        if(!isAnonymous(subject) && getConsumer().getOntologies().isEmpty()) {
            // Set IRI?
            OWLOntologyID id = new OWLOntologyID(subject);
            getConsumer().applyChange(new SetOntologyID(getConsumer().getOntology(), id));
        }
        getConsumer().addOntology(subject);
    }
View Full Code Here

    @Override
  public void attribute(String name, String value) throws OWLParserException {
        if (name.equals("ontologyIRI")) {
            OWLOntologyID newID = new OWLOntologyID(IRI.create(value), getOntology().getOntologyID().getVersionIRI());
            getOWLOntologyManager().applyChange(new SetOntologyID(getOntology(), newID));
        }
        if(name.equals("versionIRI")) {
            OWLOntologyID newID = new OWLOntologyID(getOntology().getOntologyID().getOntologyIRI(), IRI.create(value));
            getOWLOntologyManager().applyChange(new SetOntologyID(getOntology(), newID));
        }
    }
View Full Code Here

      }
    } else {
     
    }
                OWLOntologyID id = new OWLOntologyID(ontologyIRI, versionIRI);
                applyChange(new SetOntologyID(ontology, id));
    label_2:
    while (true) {
      if (jj_2_4(2)) {
       
      } else {
View Full Code Here

TOP

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

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.