for (RDFNode n : list) {
if (n.isAnonymous()) {
render((RDFResourceNode) n);
} else {
if (n.isLiteral()) {
RDFLiteralNode litNode = (RDFLiteralNode) n;
writer.writeStartElement(OWLRDFVocabulary.RDFS_LITERAL.getIRI());
if (litNode.getDatatype() != null) {
writer.writeDatatypeAttribute(litNode.getDatatype());
} else if (litNode.getLang() != null) {
writer.writeLangAttribute(litNode.getLang());
}
writer.writeTextContent((litNode.getLiteral()));
writer.writeEndElement();
} else {
writer.writeStartElement(RDF_DESCRIPTION.getIRI());
writer.writeAboutAttribute(n.getIRI());
writer.writeEndElement();
}
}
}
} else {
render(objectRes);
}
} else {
writer.writeResourceAttribute(objectRes.getIRI());
}
} else {
RDFLiteralNode rdfLiteralNode = ((RDFLiteralNode) objectNode);
if (rdfLiteralNode.getDatatype() != null) {
writer.writeDatatypeAttribute(rdfLiteralNode.getDatatype());
} else if (rdfLiteralNode.getLang() != null) {
writer.writeLangAttribute(rdfLiteralNode.getLang());
}
writer.writeTextContent(rdfLiteralNode.getLiteral());
}
writer.writeEndElement();
}
writer.writeEndElement();
pending.remove(node);