01: /*
02: * Created on 06.09.2005
03: *
04: */
05: package org.ontoware.semversion.impl;
06:
07: import org.ontoware.rdf2go.model.Model;
08: import org.ontoware.rdf2go.model.impl.DelegatingModel;
09: import org.ontoware.rdf2go.model.node.BlankNode;
10: import org.ontoware.semversion.SemVersion;
11:
12: /**
13: * Annotates each created blank node with a unique URI
14: *
15: * @author voelkel
16: *
17: */
18: public class BlankNodeEnrichmentModel extends DelegatingModel implements
19: Model {
20:
21: public BlankNodeEnrichmentModel(Model model) {
22: super (model);
23: }
24:
25: /**
26: * @return an new blank node, annotated with an IFP (inverse functional
27: * property = a unique ID)
28: */
29: @Override
30: public BlankNode createBlankNode() {
31: // blank node enrichment
32: BlankNode blankNode = getDelegatedModel().createBlankNode();
33: getDelegatedModel().addStatement(blankNode,
34: SemVersion.BLANK_NODE_ID, super.newRandomUniqueURI());
35: return blankNode;
36: }
37:
38: }
|