Write qualified roles of a dcat:Dataset @param w XML writer @param con RDF triple store connection @param uri URI of the dataset @param pred RDF predicate @throws XMLStreamException
(XMLStreamWriter w, RepositoryConnection con, IRI uri, IRI pred)
| 300 | * @throws XMLStreamException |
| 301 | */ |
| 302 | private static void writeProvenances(XMLStreamWriter w, RepositoryConnection con, |
| 303 | IRI uri, IRI pred) throws XMLStreamException { |
| 304 | try (RepositoryResult<Statement> res = con.getStatements(uri, pred, null)) { |
| 305 | while (res.hasNext()) { |
| 306 | w.writeStartElement("prov:qualifiedAttribution"); |
| 307 | w.writeStartElement("prov:Attribution"); |
| 308 | |
| 309 | Resource attrib = (Resource) res.next().getObject(); |
| 310 | try (RepositoryResult<Statement> res2 = con.getStatements(attrib, PROV.AGENT_PROP, null)) { |
| 311 | while(res2.hasNext()) { |
| 312 | w.writeStartElement("prov:agent"); |
| 313 | Resource agent = (Resource) res2.next().getObject(); |
| 314 | writeAgent(w, con, agent); |
| 315 | w.writeEndElement(); |
| 316 | } |
| 317 | writeReferences(w, con, attrib, DCAT.HAD_ROLE, "dcat:hadRole", "dcat:Role", false); |
| 318 | } |
| 319 | |
| 320 | w.writeEndElement(); |
| 321 | w.writeEndElement(); |
| 322 | } |
| 323 | } |
| 324 | } |
| 325 | |
| 326 | /** |
| 327 | * Write quality measurements of a Dataset, Distribution... |
no test coverage detected