int indent) throws XMLStreamException {
String rdfPrefix = rdfNamespaces.get(Annotation.URI_RDF_SYNTAX_NS);
String whiteSpace = createIndentationString(indent);
if (listOfCVTerms.size() > 0) {
for (int i = 0; i < listOfCVTerms.size(); i++) {
CVTerm cvTerm = listOfCVTerms.get(i);
String namespaceURI = null;
String prefix = null;
String elementName = null;
if (cvTerm.getQualifierType().equals(
CVTerm.Type.BIOLOGICAL_QUALIFIER)) {
namespaceURI = CVTerm.Type.BIOLOGICAL_QUALIFIER
.getNamespaceURI();
prefix = rdfNamespaces.get(namespaceURI);
elementName = cvTerm.getBiologicalQualifierType()
.getElementNameEquivalent();
} else if (cvTerm.getQualifierType().equals(
CVTerm.Type.MODEL_QUALIFIER)) {
namespaceURI = cvTerm.getQualifierType().getNamespaceURI();
prefix = rdfNamespaces.get(namespaceURI);
elementName = Annotation
.getElementNameEquivalentToQualifier(cvTerm
.getModelQualifierType());
}
if ((namespaceURI != null) && (elementName != null)
&& (prefix != null)) {
writer.writeCharacters(whiteSpace + createIndentationString(indentCount));
writer.writeStartElement(prefix, elementName, namespaceURI);
writer.writeCharacters("\n");
if (cvTerm.getNumResources() > 0) {
writer.writeCharacters(whiteSpace + createIndentationString(2 * indentCount));
writer.writeStartElement(rdfPrefix, "Bag",
Annotation.URI_RDF_SYNTAX_NS);
writer.writeCharacters("\n");
for (int j = 0; j < cvTerm.getNumResources(); j++) {
writer.writeCharacters(whiteSpace + createIndentationString(3 * indentCount));
writer.writeStartElement(rdfPrefix, "li",
Annotation.URI_RDF_SYNTAX_NS);
writer.writeAttribute(rdfPrefix,
Annotation.URI_RDF_SYNTAX_NS, "resource",
cvTerm.getResourceURI(j));
writer.writeEndElement();
writer.writeCharacters("\n");
}
writer.writeCharacters(whiteSpace + createIndentationString(2 * indentCount));
writer.writeEndElement();