Write temporal date info for a dcat:Dataset @param w XML writer @param con RDF triple store connection @param uri dataset URI @throws XMLStreamException
(XMLStreamWriter w, RepositoryConnection con, IRI uri)
| 238 | * @throws XMLStreamException |
| 239 | */ |
| 240 | private static void writeDates(XMLStreamWriter w, RepositoryConnection con, IRI uri) |
| 241 | throws XMLStreamException { |
| 242 | try (RepositoryResult<Statement> res = con.getStatements(uri, DCTERMS.TEMPORAL, null)) { |
| 243 | while (res.hasNext()) { |
| 244 | Value v = res.next().getObject(); |
| 245 | if (v instanceof IRI date) { |
| 246 | w.writeStartElement("dct:temporal"); |
| 247 | w.writeStartElement("dct:PeriodOfTime"); |
| 248 | writeLiterals(w, con, date, DCAT.START_DATE, "dcat:startDate"); |
| 249 | writeLiterals(w, con, date, DCAT.END_DATE, "dcat:endDate"); |
| 250 | w.writeEndElement(); |
| 251 | w.writeEndElement(); |
| 252 | } else { |
| 253 | LOG.error("Not a date IRI {}", v.stringValue()); |
| 254 | } |
| 255 | } |
| 256 | } |
| 257 | } |
| 258 | |
| 259 | |
| 260 | /** |
no test coverage detected