TemplateHelper { public static Set<OWLAnnotation> getAnnotations( String tableName, QuotedEntityChecker checker, String template, String value, int rowNum, int column) throws Exception { String split = getSplit(template); template = getTemplate(template); if (template.startsWith(">")) { template = template.substring(1); } if (template.startsWith("A ") || template.startsWith("C ")) { return getStringAnnotations(checker, template, split, value, column); } else if (template.startsWith("AT ") || template.startsWith("CT ")) { if (template.contains("^^")) { return getTypedAnnotations(tableName, checker, template, split, value, rowNum, column); } else { throw new ColumnException(String.format(typedFormatError, column, tableName, template)); } } else if (template.startsWith("AL ") || template.startsWith("CL ")) { if (template.contains("@")) { return getLanguageAnnotations(checker, template, split, value, column); } else { throw new ColumnException(String.format(languageFormatError, column, tableName, template)); } } else if (template.startsWith("AI ") || template.startsWith("CI ")) { Set<OWLAnnotation> annotations = new HashSet<>(); if (split != null) { String[] values = value.split(Pattern.quote(split)); for (String v : values) { annotations.add(maybeGetIRIAnnotation(checker, template, v, column)); } } else { annotations.add(maybeGetIRIAnnotation(checker, template, value, column)); } return annotations; } else if (template.equals("LABEL")) { return getStringAnnotations(checker, template, split, value, column); } else { return new HashSet<>(); } }  static Set<OWLAnnotationProperty> getAnnotationProperties(
      QuotedEntityChecker checker, String value, String split, int column); static OWLAnnotationProperty getAnnotationProperty(
      QuotedEntityChecker checker, String name, int column); static Set<OWLAnnotation> getAnnotations(
      String tableName,
      QuotedEntityChecker checker,
      String template,
      String value,
      int rowNum,
      int column); static Set<OWLClassExpression> getClassExpressions(
      String tableName,
      ManchesterOWLSyntaxClassExpressionParser parser,
      String template,
      String value,
      int rowNum,
      int col); static Set<OWLDataPropertyExpression> getDataPropertyExpressions(
      String tableName,
      QuotedEntityChecker checker,
      String template,
      String value,
      int rowNum,
      int column); static OWLDatatype getDatatype(
      String tableName, QuotedEntityChecker checker, String name, int rowNum, int column); static OWLDatatype getDatatype(QuotedEntityChecker checker, String name); static Set<OWLDatatype> getDatatypes(
      String tableName,
      QuotedEntityChecker checker,
      String value,
      String split,
      int rowNum,
      int column); static Set<OWLIndividual> getIndividuals(
      QuotedEntityChecker checker, String value, String split); static OWLAnnotation getIRIAnnotation(
      QuotedEntityChecker checker, String template, String value, int column); static OWLAnnotation getIRIAnnotation(
      QuotedEntityChecker checker, String template, IRI value, int column); static List<IRI> getIRIs(Map<String, List<List<String>>> tables, IOHelper ioHelper); static List<IRI> getIRIs(String tableName, List<List<String>> rows, IOHelper ioHelper); static Set<OWLAnnotation> getLanguageAnnotations(
      QuotedEntityChecker checker, String template, String split, String value, int column); static Set<OWLLiteral> getLiterals(
      String tableName,
      QuotedEntityChecker checker,
      String value,
      String split,
      int rowNum,
      int column); static Set<OWLObjectPropertyExpression> getObjectPropertyExpressions(
      String tableName,
      QuotedEntityChecker checker,
      String template,
      String value,
      int rowNum,
      int column); static Set<OWLAnnotation> getStringAnnotations(
      QuotedEntityChecker checker, String template, String split, String value, int column); static Set<OWLAnnotation> getTypedAnnotations(
      String tableName,
      QuotedEntityChecker checker,
      String template,
      String split,
      String value,
      int rowNum,
      int column); static Set<IRI> getValueIRIs(QuotedEntityChecker checker, String value, String split); static List<List<String>> readCSV(String path); static List<List<String>> readCSV(InputStream stream); static List<List<String>> readCSV(Reader reader); static List<List<String>> readTable(String path); static List<List<String>> readTSV(String path); static List<List<String>> readTSV(InputStream stream); static List<List<String>> readTSV(Reader reader); static boolean validateTemplateString(String template); @Deprecated static OWLAnnotation getAnnotation(
      String tableName,
      QuotedEntityChecker checker,
      IOHelper ioHelper,
      String template,
      String value); @Deprecated static OWLAnnotation getAnnotation(
      QuotedEntityChecker checker, String template, String value); @Deprecated static OWLAnnotation getAnnotation(
      QuotedEntityChecker checker, IOHelper ioHelper, String template, String value); @Deprecated static Set<OWLAnnotationAssertionAxiom> getAnnotationAxioms(
      OWLEntity entity,
      Set<OWLAnnotation> annotations,
      Map<OWLAnnotation, Map<OWLAnnotation, Set<OWLAnnotation>>> nested); @Deprecated static Set<OWLAnnotationProperty> getAnnotationProperties(
      QuotedEntityChecker checker, String value, String split); @Deprecated static OWLAnnotationProperty getAnnotationProperty(
      QuotedEntityChecker checker, String name); @Deprecated static String getCellContent(List<List<String>> rows, int row, Integer column); @Deprecated static OWLEntity getEntity(
      QuotedEntityChecker checker, IRI type, String id, String label); @Deprecated static OWLAnnotation getIRIAnnotation(
      QuotedEntityChecker checker, String template, String value); @Deprecated static OWLAnnotation getIRIAnnotation(
      QuotedEntityChecker checker, String template, IRI value); @Deprecated static OWLAnnotation getLanguageAnnotation(
      QuotedEntityChecker checker, String template, String value); @Deprecated static Set<OWLAnnotation> getLanguageAnnotations(
      QuotedEntityChecker checker, String template, String split, String value); @Deprecated static Set<OWLAxiom> getLogicalAxioms(
      OWLClass cls,
      String classType,
      Set<OWLClassExpression> classExpressions,
      Map<OWLClassExpression, Set<OWLAnnotation>> annotatedExpressions); @Deprecated static OWLAnnotation getStringAnnotation(
      QuotedEntityChecker checker, String template, String value); @Deprecated static Set<OWLAnnotation> getStringAnnotations(
      QuotedEntityChecker checker, String template, String split, String value); @Deprecated static OWLAnnotation getTypedAnnotation(
      QuotedEntityChecker checker, String template, String value); @Deprecated static String processSplit(String template, String cell, List<String> values);  }
@Test public void testGetAnnotations() throws Exception { String template = "A rdfs:label"; String value = "anatomical cluster"; Set<OWLAnnotation> annotations = TemplateHelper.getAnnotations("", checker, template, value, 0, 0); OWLAnnotationProperty p = checker.getOWLAnnotationProperty("rdfs:label"); OWLLiteral lit = dataFactory.getOWLLiteral(value); OWLAnnotation annMatch = dataFactory.getOWLAnnotation(p, lit); for (OWLAnnotation a : annotations) { assertEquals(annMatch, a); } template = "AL rdfs:label@en"; annotations = TemplateHelper.getAnnotations("", checker, template, value, 0, 0); lit = dataFactory.getOWLLiteral(value, "en"); annMatch = dataFactory.getOWLAnnotation(p, lit); for (OWLAnnotation a : annotations) { assertEquals(annMatch, a); } template = "AT rdfs:label^^xsd:string"; annotations = TemplateHelper.getAnnotations("", checker, template, value, 0, 0); OWLDatatype dt = checker.getOWLDatatype("xsd:string"); lit = dataFactory.getOWLLiteral(value, dt); annMatch = dataFactory.getOWLAnnotation(p, lit); for (OWLAnnotation a : annotations) { assertEquals(annMatch, a); } template = "AI rdfs:seeAlso"; value = "http: annotations = TemplateHelper.getAnnotations("", checker, template, value, 0, 0); p = checker.getOWLAnnotationProperty("rdfs:seeAlso"); IRI iri = IRI.create(value); annMatch = dataFactory.getOWLAnnotation(p, iri); for (OWLAnnotation a : annotations) { assertEquals(annMatch, a); } }