return project;
}
private IProject findOrCreateProject(Element sourceProjectRoot, String uri)
throws SimalRepositoryException {
IProject project = SimalRepositoryFactory.getProjectService()
.findProjectBySeeAlso(uri);
if (project == null) {
// simal:Project entity for doap:Project does not currently exist
// look to see if we have data about the same entity but with a different
// URI
project = findExistingProjectByHomepage(sourceProjectRoot);
}
if (project == null) {
project = findExistingProjectBySeeAlso(sourceProjectRoot);
}
if (uri == null || uri.equals("")) {
// we don't allow blank project nodes
uri = RDFUtils.getDefaultProjectURI(getNewProjectID());
sourceProjectRoot.setAttributeNS(RDFUtils.RDF_NS, "about", uri);
}
if (project == null) {
project = createSimalProject(uri);
} else {
LOGGER.debug("Updating an existing simal:Project instance with URI "
+ project.getURI());
try {
project.addSeeAlso(new URI(uri));
} catch (URISyntaxException e) {
throw new SimalRepositoryException(
"Unable to add a seeAlso attribute to an existing object", e);
}
}