public void internalise(AbsObject absObj, Ontology onto) throws UngroundedException, OntologyException { try { AbsConcept abs = (AbsConcept) absObj; apliesTo = (List) onto.toObject(abs.getAbsObject(CBRTerminologyOntology.ATTRIBUTE_APLIESTO)); describedBy = (List) onto.toObject(abs.getAbsObject(CBRTerminologyOntology.ATTRIBUTE_DESCRIBEDBY)); definition = (String) onto.toObject(abs.getAbsObject(CBRTerminologyOntology.ATTRIBUTE_DEFINITION)); term = (String) onto.toObject(abs.getAbsObject(CBRTerminologyOntology.ATTRIBUTE_TERM)); } catch (ClassCastException cce) { throw new OntologyException("Error internalising Attribute"); } }
public void externalise(AbsObject absObj, Ontology onto) throws OntologyException { try { AbsConcept abs = (AbsConcept) absObj; abs.set(CBRTerminologyOntology.ATTRIBUTE_APLIESTO, (AbsTerm) onto.fromObject(getApliesTo())); abs.set( CBRTerminologyOntology.ATTRIBUTE_DESCRIBEDBY, (AbsTerm) onto.fromObject(getDescribedBy())); abs.set( CBRTerminologyOntology.ATTRIBUTE_DEFINITION, (AbsTerm) onto.fromObject(getDefinition())); abs.set(CBRTerminologyOntology.ATTRIBUTE_TERM, (AbsTerm) onto.fromObject(getTerm())); } catch (ClassCastException cce) { throw new OntologyException("Error externalising Attribute"); } }