@Override protected String sanitizeID(String id) { // TODO use engine service return super.sanitizeID(id).replaceAll("\\(", "op").replaceAll("\\)", "cp").replaceAll("\\,", "cm"); }
@Override public IConcept getIdentity(String id, String authorityId) { /* * check and if necessary, create the trait in our ontology. TODO we should cache * all the info related to the ID so that online search is minimized. For now we * don't do anything online anyway. */ String cId = getAuthorityId() + "_" + sanitizeID(id); IOntology o = getOntology(); IConcept ret = o.getConcept(cId); if (ret == null) { ArrayList<IAxiom> ax = new ArrayList<IAxiom>(); ax.add(Axiom.ClassAssertion(cId)); ax.add(Axiom.SubClass(getBaseTrait(id).toString(), cId)); ax.add(Axiom .AnnotationAssertion(cId, NS.AUTHORITY_ID_PROPERTY, getAuthorityId())); /* * TODO get descriptor, add label and other metadata to identify the * authority. */ o.define(ax); ret = o.getConcept(cId); } return ret; }