Search in sources :

Example 1 with ImportChange

use of org.semanticweb.owlapi.model.ImportChange in project goci by EBISPOT.

the class DefaultGWASOWLConverter method createConversionOntology.

public OWLOntology createConversionOntology() throws OWLConversionException {
    try {
        // create a new graph to represent our data dump
        OWLOntology conversion = getManager().createOntology(IRI.create(OntologyConstants.GWAS_ONTOLOGY_BASE_IRI + "/" + new SimpleDateFormat("yyyy/MM/dd").format(new Date())));
        // import the gwas ontology schema and efo
        OWLImportsDeclaration gwasImportDecl = getDataFactory().getOWLImportsDeclaration(IRI.create(OntologyConstants.GWAS_ONTOLOGY_SCHEMA_IRI));
        ImportChange gwasImport = new AddImport(conversion, gwasImportDecl);
        getManager().applyChange(gwasImport);
        OWLImportsDeclaration efoImportDecl = getDataFactory().getOWLImportsDeclaration(IRI.create(OntologyConstants.EFO_ONTOLOGY_SCHEMA_IRI));
        ImportChange efoImport = new AddImport(conversion, efoImportDecl);
        getManager().applyChange(efoImport);
        return conversion;
    } catch (OWLOntologyCreationException e) {
        throw new OWLConversionException("Failed to create new ontology", e);
    }
}
Also used : OWLConversionException(uk.ac.ebi.spot.goci.exception.OWLConversionException) OWLOntologyCreationException(org.semanticweb.owlapi.model.OWLOntologyCreationException) OWLOntology(org.semanticweb.owlapi.model.OWLOntology) OWLImportsDeclaration(org.semanticweb.owlapi.model.OWLImportsDeclaration) SimpleDateFormat(java.text.SimpleDateFormat) AddImport(org.semanticweb.owlapi.model.AddImport) Date(java.util.Date) ImportChange(org.semanticweb.owlapi.model.ImportChange)

Aggregations

SimpleDateFormat (java.text.SimpleDateFormat)1 Date (java.util.Date)1 AddImport (org.semanticweb.owlapi.model.AddImport)1 ImportChange (org.semanticweb.owlapi.model.ImportChange)1 OWLImportsDeclaration (org.semanticweb.owlapi.model.OWLImportsDeclaration)1 OWLOntology (org.semanticweb.owlapi.model.OWLOntology)1 OWLOntologyCreationException (org.semanticweb.owlapi.model.OWLOntologyCreationException)1 OWLConversionException (uk.ac.ebi.spot.goci.exception.OWLConversionException)1