/** * Checks the archetype concept specialisation depth * * @param archetype * @param errors */ public void checkConceptSpecializationDepth(Archetype archetype, List<ValidationError> errors) { String concept = archetype.getConcept(); List<String> specialization = archetype.getArchetypeId().specialisation(); StringTokenizer tokens = new StringTokenizer(concept, "."); if (specialization.size() != tokens.countTokens() - 1) { ValidationError error = new ValidationError(ErrorType.VACSD, null, specialization.size(), tokens.countTokens() - 1); errors.add(error); } }
/** * Checks ontology code specialisation level validity. No archetype code * (at-code or ac-code) defined in the ontology can be of a greater * specialisation depth than the archetype. * * @param archetype * @param errors */ public void checkOntologyCodeSpecialisationLevelValidity( Archetype archetype, List<ValidationError> errors) { log.debug("validating ontology code specialisation of archetype: " + archetype.getArchetypeId()); List<String> specialisation = archetype.getArchetypeId().specialisation(); log.debug("specialisation list: " + specialisation); int level = specialisation == null ? 0 : specialisation.size(); log.debug("specialisation level: " + level); List<OntologyDefinitions> list = null; list = archetype.getOntology().getTermDefinitionsList(); checkOntologyDefinitions(list, errors, level); list = archetype.getOntology().getConstraintDefinitionsList(); checkOntologyDefinitions(list, errors, level); }