01: /*
02: * (c) Copyright 2001, 2003,2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
03: [See end of file]
04: $Id: AResource.java,v 1.13 2008/01/02 12:06:46 andy_seaborne Exp $
05: */
06: package com.hp.hpl.jena.rdf.arp;
07:
08: /**
09: * A URI or blank node reported to a {@link StatementHandler}.
10: * Note: equality (<code>.equals</code>) rather than identity
11: * (<code>==</code>) must be used to compare <code>AResource</code>s.
12: *
13: * @author <a href="mailto:Jeremy.Carroll@hp.com">Jeremy Carroll</a>
14: *
15: */
16: public interface AResource {
17:
18: /** A string distinguishing this anonymous resource, from other anonymous resources.
19: * Undefined if {@link #isAnonymous} returns false.
20: * @return An identifier with file scope for this anonymous resource..
21: */
22: public String getAnonymousID();
23:
24: /** The URI reference for this resource, if any.
25: * Not defined if {@link #isAnonymous} returns true.
26: * @return The URI reference of this resource.
27: */
28: public String getURI();
29:
30: /** The user data allows the RDF application to store one Object with each blank node during parsing.
31: * This may help with garbage collect strategies when parsing huge files.
32: * No references to the user data are maintained after a blank node goes out of
33: * scope.
34: * @return A user data object previously stored with {@link #setUserData}; or null if none.
35: */
36: public Object getUserData();
37:
38: /**
39: * True, if this is an anonymous resource with an explicit rdf:nodeID.
40: * @return true if this resource has a nodeID
41: */
42: public boolean hasNodeID();
43:
44: /** True if this resource does not have an associated URI.
45: * @return True if this resource is anonymous.
46: */
47: public boolean isAnonymous();
48:
49: /** The user data allows the RDF application to store one Object with each blank node during parsing.
50: * This may help with garbage collect strategies when parsing huge files.
51: * No references to the user data are maintained after a blank node goes out of
52: * scope.
53: * <p>
54: * See note about large files in class documentation for {@link ARP}.
55: * @param d A user data object which may be retrieved later with {@link #getUserData}.
56: */
57: public void setUserData(Object d);
58:
59: }
60:
61: /*
62: * (c) Copyright 2001, 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
63: All rights reserved.
64:
65: Redistribution and use in source and binary forms, with or without
66: modification, are permitted provided that the following conditions
67: are met:
68:
69: 1. Redistributions of source code must retain the above copyright
70: notice, this list of conditions and the following disclaimer.
71:
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:
76: 3. The name of the author may not be used to endorse or promote products
77: derived from this software without specific prior written permission.
78:
79: THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
80: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
81: OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
82: IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
83: INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
84: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
85: DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
86: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
87: (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
88: THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
89: */
|