Write FOAF organizations @param w XML writer @param con RDF triple store connection @throws XMLStreamException
(XMLStreamWriter w, RepositoryConnection con)
| 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 | /** |
no test coverage detected