Search in sources :

Example 1 with Formalism

use of eu.esdihumboldt.hale.io.oml.internal.goml.align.Formalism in project hale by halestudio.

the class OmlRdfReader method getFormalism.

/**
 * converts from JAXB FromalismType {@link FormalismType} to OML
 * {@link Formalism}
 *
 * @param jaxbFormalism
 * @return Formalism
 */
private Formalism getFormalism(eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.OntologyType.Formalism jaxbFormalism) {
    if (LOG.isTraceEnabled()) {
        LOG.trace("getFormalism(eu.esdihumboldt.generated.oml.OntologyType.Formalism) - start");
    }
    Formalism formalism = null;
    if (jaxbFormalism != null) {
        FormalismType fType = jaxbFormalism.getFormalism();
        URI uri = null;
        try {
            uri = new URI(fType.getUri());
        } catch (URISyntaxException e) {
            LOG.error("getFormalism(eu.esdihumboldt.generated.oml.OntologyType.Formalism)", e);
        // throw new RuntimeException(e);
        }
        formalism = new Formalism(fType.getName(), uri);
    }
    if (LOG.isTraceEnabled()) {
        LOG.trace("getFormalism(eu.esdihumboldt.generated.oml.OntologyType.Formalism) - end");
    }
    return formalism;
}
Also used : FormalismType(eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.FormalismType) URISyntaxException(java.net.URISyntaxException) Formalism(eu.esdihumboldt.hale.io.oml.internal.goml.align.Formalism) URI(java.net.URI)

Example 2 with Formalism

use of eu.esdihumboldt.hale.io.oml.internal.goml.align.Formalism in project hale by halestudio.

the class OmlRdfReader method getSchema.

/**
 * converts from JAXB Ontology {@link OntologyType} to OML schema
 * {@link ISchema}
 *
 * @param onto Ontology
 * @return schema
 */
private ISchema getSchema(OntologyType onto) {
    // creates formalism
    // create Formalism
    Formalism formalism = null;
    if (onto.getFormalism() != null) {
        formalism = getFormalism(onto.getFormalism());
    }
    ISchema schema = new Schema(onto.getLocation(), formalism);
    // set about
    IAbout about = new About(UUID.randomUUID());
    if (onto.getAbout() != null) {
        ((About) about).setAbout(onto.getAbout());
    }
    ((Schema) schema).setAbout(about);
    // set labels
    if (onto.getLabel() != null) {
        ((Schema) schema).getLabels().addAll(onto.getLabel());
    }
    return schema;
}
Also used : ISchema(eu.esdihumboldt.hale.io.oml.internal.model.align.ISchema) Schema(eu.esdihumboldt.hale.io.oml.internal.goml.align.Schema) ISchema(eu.esdihumboldt.hale.io.oml.internal.model.align.ISchema) IAbout(eu.esdihumboldt.hale.io.oml.internal.model.rdf.IAbout) Formalism(eu.esdihumboldt.hale.io.oml.internal.goml.align.Formalism) About(eu.esdihumboldt.hale.io.oml.internal.goml.rdf.About) IAbout(eu.esdihumboldt.hale.io.oml.internal.model.rdf.IAbout)

Aggregations

Formalism (eu.esdihumboldt.hale.io.oml.internal.goml.align.Formalism)2 Schema (eu.esdihumboldt.hale.io.oml.internal.goml.align.Schema)1 About (eu.esdihumboldt.hale.io.oml.internal.goml.rdf.About)1 ISchema (eu.esdihumboldt.hale.io.oml.internal.model.align.ISchema)1 FormalismType (eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.FormalismType)1 IAbout (eu.esdihumboldt.hale.io.oml.internal.model.rdf.IAbout)1 URI (java.net.URI)1 URISyntaxException (java.net.URISyntaxException)1