TemplateHelper { public static Set<OWLClassExpression> getClassExpressions( String tableName, ManchesterOWLSyntaxClassExpressionParser parser, String template, String value, int rowNum, int col) throws RowParseException { String split = getSplit(template); template = getTemplate(template); Set<OWLClassExpression> expressions = new HashSet<>(); if (template.startsWith("CI")) { if (split != null) { String[] values = value.split(Pattern.quote(split)); for (String v : values) { String content = QuotedEntityChecker.wrap(v); expressions.add(tryParse(tableName, parser, content, rowNum, col)); } } else { String content = QuotedEntityChecker.wrap(value); expressions.add(tryParse(tableName, parser, content, rowNum, col)); } } else { if (split != null) { String[] values = value.split(Pattern.quote(split)); for (String v : values) { expressions.add(getClassExpression(tableName, template, v, parser, rowNum, col)); } } else { expressions.add(getClassExpression(tableName, template, value, parser, rowNum, col)); } } return expressions; }  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 testGetClassExpressions() throws Exception { ManchesterOWLSyntaxClassExpressionParser parser = new ManchesterOWLSyntaxClassExpressionParser(dataFactory, checker); String template = "C part_of some %"; String value = "obo:UBERON_0000467"; Set<OWLClassExpression> expressions = TemplateHelper.getClassExpressions("", parser, template, value, 0, 0); OWLObjectProperty p = checker.getOWLObjectProperty("part_of"); if (p == null) { fail("'part_of' property not found by checker"); } OWLClass c = checker.getOWLClass("anatomical system"); if (c == null) { fail("'anatomical system' class not found by checker"); } OWLClassExpression exprMatch = dataFactory.getOWLObjectSomeValuesFrom(p, c); if (expressions.size() != 1) { fail(String.format("Expected exactly 1 expression, got %d", expressions.size())); } for (OWLClassExpression expr : expressions) { assertEquals(exprMatch.toString(), expr.toString()); } }