/** * Gets an {@link OWLAnnotation} for a tag value pair. * @param tagName The tag name. * @param value The tag value. Note that the tag value is un-escaped and stripped of double quotes if they exist. * @return An {@link OWLAnnotation} that is formed by converting the tagName to an IRI and then to an * {@link OWLAnnotationProperty} and the value to an {@link OWLLiteral}. */ public OWLAnnotation getAnnotationForTagValuePair(String tagName, String value) { IRI tagIRI = getTagIRI(tagName); OWLDataFactory df = getDataFactory(); OWLAnnotationProperty annotationProperty = df.getOWLAnnotationProperty(tagIRI); String unescapedString = getUnquotedString(value); OWLLiteral annotationValue = df.getOWLLiteral(unescapedString); return df.getOWLAnnotation(annotationProperty, annotationValue); }
/** Gets an {@link OWLAnnotation} for a tag value pair. * * @param tagName * The tag name. * @param value * The tag value. Note that the tag value is un-escaped and * stripped of double quotes if they exist. * @return An {@link OWLAnnotation} that is formed by converting the tagName * to an IRI and then to an {@link OWLAnnotationProperty} and the * value to an {@link OWLLiteral}. */ public OWLAnnotation getAnnotationForTagValuePair(String tagName, String value) { IRI tagIRI = getTagIRI(tagName); OWLDataFactory df = getDataFactory(); OWLAnnotationProperty annotationProperty = df.getOWLAnnotationProperty(tagIRI); String unescapedString = getUnquotedString(value); OWLLiteral annotationValue = df.getOWLLiteral(unescapedString); return df.getOWLAnnotation(annotationProperty, annotationValue); }