QuotedEntityChecker implements OWLEntityChecker { public static String wrap(String content) { if (content == null) { return null; } if (content.trim().startsWith("'") || content.trim().startsWith("\"") || content.trim().startsWith("(")) { return content; } if (content.trim().matches(".*\\s.*")) { return "'" + escape(content) + "'"; } return escape(content); }  void setIOHelper(IOHelper ioHelper); IOHelper getIOHelper(); void addProvider(ShortFormProvider provider); void addProperty(OWLAnnotationProperty property); static String escape(String content); static String wrap(String content); void addAll(OWLOntology ontology); void add(OWLEntity entity); void add(OWLOntology parentOntology, OWLEntity entity); void add(OWLEntity entity, String name); IRI getIRI(String name, boolean create); String getLabel(IRI iri); @Override OWLAnnotationProperty getOWLAnnotationProperty(@Nonnull String name); OWLAnnotationProperty getOWLAnnotationProperty(@Nonnull String name, boolean create); @Override OWLClass getOWLClass(@Nonnull String name); @Override OWLDataProperty getOWLDataProperty(@Nonnull String name); @Override OWLDatatype getOWLDatatype(@Nonnull String name); OWLDatatype getOWLDatatype(@Nonnull String name, boolean create); @Override OWLNamedIndividual getOWLIndividual(@Nonnull String name); @Override OWLObjectProperty getOWLObjectProperty(@Nonnull String name); OWLEntity getOWLEntity(String name);  }
@Test public void testEscaping() { Assert.assertEquals("testone", QuotedEntityChecker.wrap("testone")); Assert.assertEquals("'test one'", QuotedEntityChecker.wrap("test one")); Assert.assertEquals( "5-bromo-2\\'-deoxyuridine", QuotedEntityChecker.wrap("5-bromo-2'-deoxyuridine")); }