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;
}
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;
}
Aggregations