Write quality annotations of a Dataset, Distribution... @param w XML writer @param con RDF triple store connection @param uri URI of the dataset / distribution @param pred RDF predicate @throws XMLStreamException
(XMLStreamWriter w, RepositoryConnection con, IRI uri, IRI pred, String property, String wrapper)
| 360 | * @throws XMLStreamException |
| 361 | */ |
| 362 | private static void writeAnnotations(XMLStreamWriter w, RepositoryConnection con, |
| 363 | IRI uri, IRI pred, String property, String wrapper) throws XMLStreamException { |
| 364 | try (RepositoryResult<Statement> res = con.getStatements(uri, pred, null)) { |
| 365 | while (res.hasNext()) { |
| 366 | w.writeStartElement(property); |
| 367 | w.writeStartElement(wrapper); |
| 368 | |
| 369 | Resource annotation = (Resource) res.next().getObject(); |
| 370 | writeLiterals(w, con, annotation, OA.HAS_BODY, "oa:hasBody"); |
| 371 | w.writeEndElement(); |
| 372 | w.writeEndElement(); |
| 373 | } |
| 374 | } |
| 375 | } |
| 376 | |
| 377 | /** |
| 378 | * Write bibliographic citation |
no test coverage detected