RDFUtils.FOAF_NS, "mbox_sha1sum");
for (int i = 0; i < sha1sums.getLength(); i = i + 1) {
Element sha1sumNode = (Element) sha1sums.item(i);
if (sha1sumNode.getParentNode().equals(sourcePersonRoot)) {
String sha1Sum = sha1sumNode.getFirstChild().getNodeValue().trim();
IPerson person = SimalRepositoryFactory.getPersonService().findBySha1Sum(sha1Sum);
if (person != null) {
LOGGER
.debug("Simal already has a Person record with the foaf:mbox_sha1: "
+ sha1Sum + " called " + person);
person = SimalRepositoryFactory.getPersonService().findBySeeAlso(person.getURI());
simalPersonURI = person.getURI();
}
}
}
// handle duplicate people identified by their rdf:about
String uri = sourcePersonRoot.getAttributeNS(RDFUtils.RDF_NS, "about");
IPerson person = SimalRepositoryFactory.getPersonService().findBySeeAlso(uri);
if (person != null) {
LOGGER
.debug("Simal already has a Person record about "
+ uri + " called " + person);
simalPersonURI = person.getURI();
}
// handle duplicate people identified by their rdfs:seeAlso
NodeList seeAlsos = sourcePersonRoot.getElementsByTagNameNS(
RDFUtils.RDFS_NS, "seeAlso");
Element seeAlso;
for (int i = 0; i < seeAlsos.getLength(); i = i + 1) {
seeAlso = (Element) seeAlsos.item(i);
if (seeAlso.getParentNode().equals(sourcePersonRoot)) {
uri = seeAlso.getAttributeNS(RDFUtils.RDF_NS, "resource").trim();
person = SimalRepositoryFactory.getPersonService().findBySeeAlso(uri);
if (person != null) {
LOGGER
.debug("Simal already has a Person record with the rdfs:seeAlso "
+ uri + " called " + person);
simalPersonURI = person.getURI();
} else {
seeAlso = simalPersonDoc.createElementNS(RDFUtils.RDFS_NS, "seeAlso");
seeAlso.setAttributeNS(RDFUtils.RDF_NS, "resource", uri);
simalPersonElement.appendChild(seeAlso);
}