001: /**
002: * generated by http://RDFReactor.semweb4j.org ($Id: CodeGenerator.java 785 2007-05-31 15:47:01Z voelkel $) on 01.06.07 18:30
003: */package org.rdfs.sioc;
004:
005: import org.ontoware.rdf2go.model.Model;
006: import org.ontoware.rdf2go.model.node.BlankNode;
007: import org.ontoware.rdf2go.model.node.URI;
008: import org.ontoware.rdf2go.model.node.impl.URIImpl;
009: import org.ontoware.rdf2go.exception.ModelRuntimeException;
010:
011: import org.ontoware.rdfreactor.runtime.RDFDataException;
012:
013: /**
014: * This class was generated by <a href="http://RDFReactor.semweb4j.org">RDFReactor</a> on 01.06.07 18:30
015: * This class manages access to these properties:
016: * <ul>
017: * <li> Spaceof </li>
018: * <li> Usergroup </li>
019: * </ul>
020: * Schema Comment: A Space is where data resides. It can be the location of a set of content item containers, e.g., on a website, desktop or fileshare.
021: */
022: public class Space extends Thing {
023:
024: /** http://rdfs.org/sioc/ns#Space */
025: public static final URI RDFS_CLASS = new URIImpl(
026: "http://rdfs.org/sioc/ns#Space", false);
027:
028: /** http://rdfs.org/sioc/ns#space_of */
029: public static final URI SPACEOF = new URIImpl(
030: "http://rdfs.org/sioc/ns#space_of", false);
031:
032: /** http://rdfs.org/sioc/ns#has_usergroup */
033: public static final URI USERGROUP = new URIImpl(
034: "http://rdfs.org/sioc/ns#has_usergroup", false);
035:
036: /** all property-URIs with this class as domain */
037: public static final URI[] MANAGED_URIS = {
038: new URIImpl("http://rdfs.org/sioc/ns#space_of", false),
039: new URIImpl("http://rdfs.org/sioc/ns#has_usergroup", false) };
040:
041: // protected constructors needed for inheritance
042:
043: /**
044: * Returns a Java wrapper over an RDF object, identified by URI.
045: * Creating two wrappers for the same instanceURI is legal.
046: * @param model RDF2GO Model implementation, see http://rdf2go.semweb4j.org
047: * @param classURI URI of RDFS class
048: * @param instanceIdentifier Resource that identifies this instance
049: * @param write if true, the statement (this, rdf:type, TYPE) is written to the model
050: */
051: protected Space(Model model, URI classURI,
052: org.ontoware.rdf2go.model.node.Resource instanceIdentifier,
053: boolean write) {
054: super (model, classURI, instanceIdentifier, write);
055: }
056:
057: // public constructors
058:
059: /**
060: * Returns a Java wrapper over an RDF object, identified by URI.
061: * Creating two wrappers for the same instanceURI is legal.
062: * @param model RDF2GO Model implementation, see http://rdf2go.ontoware.org
063: * @param instanceIdentifier an RDF2Go Resource identifying this instance
064: * @param write if true, the statement (this, rdf:type, TYPE) is written to the model
065: */
066: public Space(Model model,
067: org.ontoware.rdf2go.model.node.Resource instanceIdentifier,
068: boolean write) {
069: super (model, RDFS_CLASS, instanceIdentifier, write);
070: }
071:
072: /**
073: * Returns a Java wrapper over an RDF object, identified by URI.
074: * Creating two wrappers for the same instanceURI is legal.
075: * The statement (this, rdf:type, TYPE) is written to the model
076: * @param model RDF2GO Model implementation, see http://rdf2go.ontoware.org
077: * @param uri URI of this instance
078: */
079: public Space(Model model, URI uri) {
080: this (model, uri, true);
081: }
082:
083: /**
084: * Returns a Java wrapper over an RDF object, identified by URI.
085: * Creating two wrappers for the same instanceURI is legal.
086: * The statement (this, rdf:type, TYPE) is written to the model
087: * @param model RDF2GO Model implementation, see http://rdf2go.ontoware.org
088: * @param uriString A URI of this instance, represented as a String
089: * @throws ModelRuntimeException if URI syntax is wrong
090: */
091: public Space(Model model, String uriString)
092: throws ModelRuntimeException {
093: this (model, new URIImpl(uriString), true);
094: }
095:
096: /**
097: * Returns a Java wrapper over an RDF object, identified by a blank node.
098: * Creating two wrappers for the same blank node is legal.
099: * The statement (this, rdf:type, TYPE) is written to the model
100: * @param model RDF2GO Model implementation, see http://rdf2go.ontoware.org
101: * @param bnode BlankNode of this instance
102: */
103: public Space(Model model, BlankNode bnode) {
104: this (model, bnode, true);
105: }
106:
107: /**
108: * Returns a Java wrapper over an RDF object, identified by
109: * a randomly generated URI.
110: * Creating two wrappers results in different URIs.
111: * The statement (this, rdf:type, TYPE) is written to the model
112: * @param model RDF2GO Model implementation, see http://rdf2go.ontoware.org
113: */
114: public Space(Model model) {
115: this (model, model.newRandomUniqueURI(), true);
116: }
117:
118: ///////////////////////////////////////////////////////////////////
119: // getters, setters, ...
120:
121: /**
122: * @param model RDF2Go model
123: * @param uri instance identifier
124: * @return an instance of Space or null if none existst
125: * @throws Exception if Model causes problems
126: */
127: public static Space getInstance(Model model, URI uri)
128: throws Exception {
129: return (Space) getInstance(model, uri, Space.class);
130: }
131:
132: /**
133: * @param model
134: * @param uri
135: * @return true if uri is an instance of this class in the model
136: */
137: public static boolean hasInstance(Model model, URI uri) {
138: return hasInstance(model, uri, RDFS_CLASS);
139: }
140:
141: /**
142: * @return all instances of this class
143: */
144: public Space[] getAllInstances() {
145: return (Space[]) getAllInstances(super .model, Space.class);
146: }
147:
148: /**
149: * @return all instances of this class in the given Model
150: * @param model an RDF2Go model
151: */
152: public static Space[] getAllInstances(Model model) {
153: return (Space[]) getAllInstances(model, Space.class);
154: }
155:
156: /**
157: * @return all A's that have a relation 'Space' to this Space instance
158: */
159: public Thing[] getAllSiocSpace_Inverse() {
160: return (Thing[]) getAll_Inverse(Thing.SPACE,
161: this .getResource(), Thing.class);
162: }
163:
164: /**
165: * add 'Space'-Inverse
166: * @param value
167: */
168: public void addSiocSpace_Inverse(Thing value) {
169: value.add(Thing.SPACE, this );
170: }
171:
172: /**
173: * @return all A's that have a relation 'Usergroupof' to this Space instance
174: */
175: public Usergroup[] getAllSiocUsergroupof_Inverse() {
176: return (Usergroup[]) getAll_Inverse(Usergroup.USERGROUPOF, this
177: .getResource(), Usergroup.class);
178: }
179:
180: /**
181: * add 'Usergroupof'-Inverse
182: * @param value
183: */
184: public void addSiocUsergroupof_Inverse(Usergroup value) {
185: value.add(Usergroup.USERGROUPOF, this );
186: }
187:
188: /**
189: * Schema Comment: A resource which belongs to this data Space.
190: * @return the only value. null if none is found
191: * @throws RDFDataException, if the property has multiple values
192: */
193: public Thing getSiocSpaceof() {
194: return (Thing) get(SPACEOF, Thing.class);
195: }
196:
197: /**
198: * removes all values and sets this one
199: * @param value the value to be set
200: * Schema Comment: A resource which belongs to this data Space.
201: */
202: public void setSiocSpaceof(Thing value) {
203: set(SPACEOF, value);
204: }
205:
206: /**
207: * removes a value
208: * @param value the value to be removed
209: * Schema Comment: A resource which belongs to this data Space.
210: */
211: public void removeSiocSpaceof(Thing value) {
212: remove(SPACEOF, value);
213: }
214:
215: /**
216: * @param value
217: * @return true if the model contains a statement (this, SPACEOF, value)
218: */
219: public boolean hasSiocSpaceof(Thing value) {
220: return hasValue(SPACEOF, value);
221: }
222:
223: /**
224: * @return true if the model contains a statement (this, SPACEOF, *)
225: */
226: public boolean hasSiocSpaceof() {
227: return hasValue(SPACEOF);
228: }
229:
230: /**
231: * adds a value
232: * @param value the value to be added
233: * Schema Comment: A resource which belongs to this data Space.
234: */
235: public void addSiocSpaceof(Thing value) {
236: add(SPACEOF, value);
237: }
238:
239: /**
240: * @return all values
241: * Schema Comment: A resource which belongs to this data Space.
242: */
243: public Thing[] getAllSiocSpaceof() {
244: return (Thing[]) getAll(SPACEOF, Thing.class);
245: }
246:
247: /**
248: * Schema Comment: Points to a Usergroup that has certain access to this Space.
249: * @return the only value. null if none is found
250: * @throws RDFDataException, if the property has multiple values
251: */
252: public Usergroup getSiocUsergroup() {
253: return (Usergroup) get(USERGROUP, Usergroup.class);
254: }
255:
256: /**
257: * removes all values and sets this one
258: * @param value the value to be set
259: * Schema Comment: Points to a Usergroup that has certain access to this Space.
260: */
261: public void setSiocUsergroup(Usergroup value) {
262: set(USERGROUP, value);
263: }
264:
265: /**
266: * removes a value
267: * @param value the value to be removed
268: * Schema Comment: Points to a Usergroup that has certain access to this Space.
269: */
270: public void removeSiocUsergroup(Usergroup value) {
271: remove(USERGROUP, value);
272: }
273:
274: /**
275: * @param value
276: * @return true if the model contains a statement (this, USERGROUP, value)
277: */
278: public boolean hasSiocUsergroup(Usergroup value) {
279: return hasValue(USERGROUP, value);
280: }
281:
282: /**
283: * @return true if the model contains a statement (this, USERGROUP, *)
284: */
285: public boolean hasSiocUsergroup() {
286: return hasValue(USERGROUP);
287: }
288:
289: /**
290: * adds a value
291: * @param value the value to be added
292: * Schema Comment: Points to a Usergroup that has certain access to this Space.
293: */
294: public void addSiocUsergroup(Usergroup value) {
295: add(USERGROUP, value);
296: }
297:
298: /**
299: * @return all values
300: * Schema Comment: Points to a Usergroup that has certain access to this Space.
301: */
302: public Usergroup[] getAllSiocUsergroup() {
303: return (Usergroup[]) getAll(USERGROUP, Usergroup.class);
304: }
305:
306: }
|