01: /*
02: * LICENSE INFORMATION
03: * Copyright 2005-2007 by FZI (http://www.fzi.de).
04: * Licensed under a BSD license (http://www.opensource.org/licenses/bsd-license.php)
05: * <OWNER> = Max Völkel
06: * <ORGANIZATION> = FZI Forschungszentrum Informatik Karlsruhe, Karlsruhe, Germany
07: * <YEAR> = 2007
08: *
09: * Project information at http://semweb4j.org/rdf2go
10: */
11: package org.ontoware.rdf2go.model.impl;
12:
13: import java.rmi.server.UID;
14:
15: import org.ontoware.rdf2go.model.node.URI;
16: import org.ontoware.rdf2go.model.node.impl.URIImpl;
17: import org.slf4j.Logger;
18: import org.slf4j.LoggerFactory;
19:
20: /**
21: * Uses UUIDs.
22: *
23: * @author voelkel
24: *
25: */
26: public class URIGenerator {
27:
28: @SuppressWarnings("unused")
29: private static final Logger log = LoggerFactory
30: .getLogger(URIGenerator.class);
31:
32: public static URI createNewRandomUniqueURI() {
33: return new URIImpl("urn:rnd:" + new UID().toString());
34: }
35:
36: /**
37: * @param uriPrefix - must include schema information
38: * @return a new, random unique URI starting with uriPrefix
39: */
40: public static URI createNewRandomUniqueURI(String uriPrefix) {
41: return new URIImpl(uriPrefix + new UID().toString());
42: }
43: }
|