if (client != null) client.close();
}
}
private Map<String, Person> loadUsingClient(HttpClientService client) throws Exception {
Map<String, Person> persons = new HashMap<String, Person>();
URIBuilder uri = new URIBuilder(config.get("TriplestoreURL") + "/search)")
.addParameter("predicate", "rdf:type")
.addParameter("object", "MA.person");
Document doc = client.contentAsDocument(new HttpGet(uri.getURI()));
for (Node node : doc.getRootNode().getChildNodes()) {
String id = node.getAttribute("rdf:about").replace("http://id.luomus.fi/", "");
String fullname = null;
if (node.hasChildNodes("MA.fullName")) {
fullname = node.getNode("MA.fullName").getContents();