Adding ability to have default new URI creation behavior in n3 custom forms. NIHVIVO-273

This commit is contained in:
bdc34 2010-04-01 21:34:22 +00:00
parent 53516cf140
commit c28519a98e
3 changed files with 39 additions and 18 deletions

View file

@ -141,7 +141,7 @@ public interface IndividualDao extends ObjectSourceIface {
/**
* Standard way to get a new URI that is not yet used.
* @param individual
* @param individual, may be null
* @return new URI that is not found in the subject, predicate or object position of any statement.
* @throws InsertException Could not create a URI
*/

View file

@ -1106,14 +1106,15 @@ public class IndividualDaoJena extends JenaBaseDao implements IndividualDao {
RDF.type ,
getOntModel().getResource(vclassURI));
}
public String getUnusedURI(Individual individual) throws InsertException {
String errMsg = null;
String namespace = null;
String uri = null;
boolean uriIsGood = false;
if ( (individual.getURI() != null && individual.getURI().startsWith( DEFAULT_NAMESPACE ) )
if ( individual == null ||
(individual.getURI() != null && individual.getURI().startsWith( DEFAULT_NAMESPACE ) )
|| individual.getNamespace() == null
|| individual.getNamespace().length() == 0
|| DEFAULT_NAMESPACE.equals(individual.getNamespace()) ){