for (RDFNode n : list) {
if (n.isAnonymous()) {
render((RDFResourceBlankNode) n);
} else {
if (n.isLiteral()) {
RDFLiteral litNode = (RDFLiteral) n;
writer.writeStartElement(RDFS_LITERAL
.getIRI());
if (!litNode.isPlainLiteral()) {
writer.writeDatatypeAttribute(litNode
.getDatatype());
} else if (litNode.hasLang()) {
writer.writeLangAttribute(litNode
.getLang());
}
writer.writeTextContent(litNode
.getLexicalValue());
writer.writeEndElement();
} else {
writer.writeStartElement(RDF_DESCRIPTION
.getIRI());
writer.writeAboutAttribute(n.getIRI());
writer.writeEndElement();
}
}
}
} else {
render(objectRes);
}
} else {
writer.writeResourceAttribute(objectRes.getIRI());
}
} else {
RDFLiteral rdfLiteralNode = (RDFLiteral) objectNode;
if (!rdfLiteralNode.isPlainLiteral()) {
writer.writeDatatypeAttribute(rdfLiteralNode.getDatatype());
} else if (rdfLiteralNode.hasLang()) {
writer.writeLangAttribute(rdfLiteralNode.getLang());
}
writer.writeTextContent(rdfLiteralNode.getLexicalValue());
}
writer.writeEndElement();
}
writer.writeEndElement();
pending.remove(node);