MCPcopy Create free account
hub / github.com/Fedict/dcattools / writeAnnotations

Method writeAnnotations

tools/src/main/java/be/gov/data/tools/EDP.java:362–375  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 1

writeResourceMethod · 0.95

Calls 1

writeLiteralsMethod · 0.95

Tested by

no test coverage detected