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

Method writeAgents

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

Write FOAF organizations @param w XML writer @param con RDF triple store connection @throws XMLStreamException

(XMLStreamWriter w, RepositoryConnection con)

Source from the content-addressed store, hash-verified

971 * @throws XMLStreamException
972 */
973 private static void writeAgents(XMLStreamWriter w, RepositoryConnection con)
974 throws XMLStreamException {
975 int nr = 0;
976
977 try (RepositoryResult<Statement> res = con.getStatements(null, RDF.TYPE, FOAF.AGENT)) {
978 while (res.hasNext()) {
979 IRI agent = (IRI) res.next().getSubject();
980 if (con.hasStatement(null, null, agent, false)) {
981 nr++;
982 writeAgent(w, con, agent);
983 }
984 }
985 }
986 LOG.info("Wrote {} organizations", nr);
987 }
988
989
990 /**

Callers 1

writeCatalogMethod · 0.95

Calls 1

writeAgentMethod · 0.95

Tested by

no test coverage detected