01: /*
02: (c) Copyright 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
03: [See end of file]
04: */
05:
06: package com.hp.hpl.jena.db.impl;
07:
08: import com.hp.hpl.jena.graph.*;
09: import com.hp.hpl.jena.util.iterator.ExtendedIterator;
10: import com.hp.hpl.jena.vocabulary.DB;
11:
12: /**
13: *
14: * A wrapper to assist in getting and setting DB information from
15: * a persistent store.
16: *
17: * This is written in the style of enhanced nodes - no state is
18: * stored in the DBStoreDesc, instead all state is in the
19: * underlying graph and this is just provided as a convenience.
20: *
21: * (We don't use enhanced nodes because, since we control everything
22: * in the persistent store system description, we can avoid any
23: * need to handle polymorhphism).
24: *
25: * @since Jena 2.0
26: *
27: * @author csayers
28: * @version $Revision: 1.11 $
29: */
30: public class DBPropPrefix extends DBProp {
31:
32: public static Node_URI prefixValue = (Node_URI) DB.prefixValue
33: .asNode();
34: public static Node_URI prefixURI = (Node_URI) DB.prefixURI.asNode();
35:
36: public DBPropPrefix(SpecializedGraph g, String value, String uri) {
37: super (g, Node.createAnon());
38: putPropString(prefixValue, value);
39: putPropString(prefixURI, uri);
40: }
41:
42: public DBPropPrefix(SpecializedGraph g, Node n) {
43: super (g, n);
44: }
45:
46: public String getValue() {
47: return getPropString(prefixValue);
48: }
49:
50: public String getURI() {
51: return getPropString(prefixURI);
52: }
53:
54: public ExtendedIterator listTriples() {
55: return DBProp.listTriples(graph, self);
56: }
57:
58: public String toString() {
59: return "<[" + getValue() + "=" + getURI() + "]>";
60: }
61: }
62:
63: /*
64: * (c) Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
65: * All rights reserved.
66: *
67: * Redistribution and use in source and binary forms, with or without
68: * modification, are permitted provided that the following conditions
69: * are met:
70: * 1. Redistributions of source code must retain the above copyright
71: * notice, this list of conditions and the following disclaimer.
72: * 2. Redistributions in binary form must reproduce the above copyright
73: * notice, this list of conditions and the following disclaimer in the
74: * documentation and/or other materials provided with the distribution.
75: * 3. The name of the author may not be used to endorse or promote products
76: * derived from this software without specific prior written permission.
77:
78: * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
79: * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
80: * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
81: * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
82: * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
83: * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
84: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
85: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
86: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
87: * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
88: */
|