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> Containerof </li>
018: * <li> Subscriber </li>
019: * <li> Parent </li>
020: * <li> Owner </li>
021: * <li> Parentof </li>
022: * </ul>
023: * Schema Comment: An area in which content Items are contained.
024: */
025: public class Container extends Thing {
026:
027: /** http://rdfs.org/sioc/ns#Container */
028: public static final URI RDFS_CLASS = new URIImpl(
029: "http://rdfs.org/sioc/ns#Container", false);
030:
031: /** http://rdfs.org/sioc/ns#container_of */
032: public static final URI CONTAINEROF = new URIImpl(
033: "http://rdfs.org/sioc/ns#container_of", false);
034:
035: /** http://rdfs.org/sioc/ns#has_subscriber */
036: public static final URI SUBSCRIBER = new URIImpl(
037: "http://rdfs.org/sioc/ns#has_subscriber", false);
038:
039: /** http://rdfs.org/sioc/ns#has_parent */
040: public static final URI PARENT = new URIImpl(
041: "http://rdfs.org/sioc/ns#has_parent", false);
042:
043: /** http://rdfs.org/sioc/ns#has_owner */
044: public static final URI OWNER = new URIImpl(
045: "http://rdfs.org/sioc/ns#has_owner", false);
046:
047: /** http://rdfs.org/sioc/ns#parent_of */
048: public static final URI PARENTOF = new URIImpl(
049: "http://rdfs.org/sioc/ns#parent_of", false);
050:
051: /** all property-URIs with this class as domain */
052: public static final URI[] MANAGED_URIS = {
053: new URIImpl("http://rdfs.org/sioc/ns#container_of", false),
054: new URIImpl("http://rdfs.org/sioc/ns#has_subscriber", false),
055: new URIImpl("http://rdfs.org/sioc/ns#has_parent", false),
056: new URIImpl("http://rdfs.org/sioc/ns#has_owner", false),
057: new URIImpl("http://rdfs.org/sioc/ns#parent_of", false) };
058:
059: // protected constructors needed for inheritance
060:
061: /**
062: * Returns a Java wrapper over an RDF object, identified by URI.
063: * Creating two wrappers for the same instanceURI is legal.
064: * @param model RDF2GO Model implementation, see http://rdf2go.semweb4j.org
065: * @param classURI URI of RDFS class
066: * @param instanceIdentifier Resource that identifies this instance
067: * @param write if true, the statement (this, rdf:type, TYPE) is written to the model
068: */
069: protected Container(Model model, URI classURI,
070: org.ontoware.rdf2go.model.node.Resource instanceIdentifier,
071: boolean write) {
072: super (model, classURI, instanceIdentifier, write);
073: }
074:
075: // public constructors
076:
077: /**
078: * Returns a Java wrapper over an RDF object, identified by URI.
079: * Creating two wrappers for the same instanceURI is legal.
080: * @param model RDF2GO Model implementation, see http://rdf2go.ontoware.org
081: * @param instanceIdentifier an RDF2Go Resource identifying this instance
082: * @param write if true, the statement (this, rdf:type, TYPE) is written to the model
083: */
084: public Container(Model model,
085: org.ontoware.rdf2go.model.node.Resource instanceIdentifier,
086: boolean write) {
087: super (model, RDFS_CLASS, instanceIdentifier, write);
088: }
089:
090: /**
091: * Returns a Java wrapper over an RDF object, identified by URI.
092: * Creating two wrappers for the same instanceURI is legal.
093: * The statement (this, rdf:type, TYPE) is written to the model
094: * @param model RDF2GO Model implementation, see http://rdf2go.ontoware.org
095: * @param uri URI of this instance
096: */
097: public Container(Model model, URI uri) {
098: this (model, uri, true);
099: }
100:
101: /**
102: * Returns a Java wrapper over an RDF object, identified by URI.
103: * Creating two wrappers for the same instanceURI is legal.
104: * The statement (this, rdf:type, TYPE) is written to the model
105: * @param model RDF2GO Model implementation, see http://rdf2go.ontoware.org
106: * @param uriString A URI of this instance, represented as a String
107: * @throws ModelRuntimeException if URI syntax is wrong
108: */
109: public Container(Model model, String uriString)
110: throws ModelRuntimeException {
111: this (model, new URIImpl(uriString), true);
112: }
113:
114: /**
115: * Returns a Java wrapper over an RDF object, identified by a blank node.
116: * Creating two wrappers for the same blank node is legal.
117: * The statement (this, rdf:type, TYPE) is written to the model
118: * @param model RDF2GO Model implementation, see http://rdf2go.ontoware.org
119: * @param bnode BlankNode of this instance
120: */
121: public Container(Model model, BlankNode bnode) {
122: this (model, bnode, true);
123: }
124:
125: /**
126: * Returns a Java wrapper over an RDF object, identified by
127: * a randomly generated URI.
128: * Creating two wrappers results in different URIs.
129: * The statement (this, rdf:type, TYPE) is written to the model
130: * @param model RDF2GO Model implementation, see http://rdf2go.ontoware.org
131: */
132: public Container(Model model) {
133: this (model, model.newRandomUniqueURI(), true);
134: }
135:
136: ///////////////////////////////////////////////////////////////////
137: // getters, setters, ...
138:
139: /**
140: * @param model RDF2Go model
141: * @param uri instance identifier
142: * @return an instance of Container or null if none existst
143: * @throws Exception if Model causes problems
144: */
145: public static Container getInstance(Model model, URI uri)
146: throws Exception {
147: return (Container) getInstance(model, uri, Container.class);
148: }
149:
150: /**
151: * @param model
152: * @param uri
153: * @return true if uri is an instance of this class in the model
154: */
155: public static boolean hasInstance(Model model, URI uri) {
156: return hasInstance(model, uri, RDFS_CLASS);
157: }
158:
159: /**
160: * @return all instances of this class
161: */
162: public Container[] getAllInstances() {
163: return (Container[]) getAllInstances(super .model,
164: Container.class);
165: }
166:
167: /**
168: * @return all instances of this class in the given Model
169: * @param model an RDF2Go model
170: */
171: public static Container[] getAllInstances(Model model) {
172: return (Container[]) getAllInstances(model, Container.class);
173: }
174:
175: /**
176: * @return all A's that have a relation 'Parent' to this Container instance
177: */
178: public Container[] getAllSiocParent_Inverse() {
179: return (Container[]) getAll_Inverse(Container.PARENT, this
180: .getResource(), Container.class);
181: }
182:
183: /**
184: * add 'Parent'-Inverse
185: * @param value
186: */
187: public void addSiocParent_Inverse(Container value) {
188: value.add(Container.PARENT, this );
189: }
190:
191: /**
192: * @return all A's that have a relation 'Parentof' to this Container instance
193: */
194: public Container[] getAllSiocParentof_Inverse() {
195: return (Container[]) getAll_Inverse(Container.PARENTOF, this
196: .getResource(), Container.class);
197: }
198:
199: /**
200: * add 'Parentof'-Inverse
201: * @param value
202: */
203: public void addSiocParentof_Inverse(Container value) {
204: value.add(Container.PARENTOF, this );
205: }
206:
207: /**
208: * @return all A's that have a relation 'Container' to this Container instance
209: */
210: public Item[] getAllSiocContainer_Inverse() {
211: return (Item[]) getAll_Inverse(Item.CONTAINER, this
212: .getResource(), Item.class);
213: }
214:
215: /**
216: * add 'Container'-Inverse
217: * @param value
218: */
219: public void addSiocContainer_Inverse(Item value) {
220: value.add(Item.CONTAINER, this );
221: }
222:
223: /**
224: * @return all A's that have a relation 'Ownerof' to this Container instance
225: */
226: public User[] getAllSiocOwnerof_Inverse() {
227: return (User[]) getAll_Inverse(User.OWNEROF,
228: this .getResource(), User.class);
229: }
230:
231: /**
232: * add 'Ownerof'-Inverse
233: * @param value
234: */
235: public void addSiocOwnerof_Inverse(User value) {
236: value.add(User.OWNEROF, this );
237: }
238:
239: /**
240: * @return all A's that have a relation 'Subscriberof' to this Container instance
241: */
242: public User[] getAllSiocSubscriberof_Inverse() {
243: return (User[]) getAll_Inverse(User.SUBSCRIBEROF, this
244: .getResource(), User.class);
245: }
246:
247: /**
248: * add 'Subscriberof'-Inverse
249: * @param value
250: */
251: public void addSiocSubscriberof_Inverse(User value) {
252: value.add(User.SUBSCRIBEROF, this );
253: }
254:
255: /**
256: * Schema Comment: An Item that this Container contains.
257: * @return the only value. null if none is found
258: * @throws RDFDataException, if the property has multiple values
259: */
260: public Item getSiocContainerof() {
261: return (Item) get(CONTAINEROF, Item.class);
262: }
263:
264: /**
265: * removes all values and sets this one
266: * @param value the value to be set
267: * Schema Comment: An Item that this Container contains.
268: */
269: public void setSiocContainerof(Item value) {
270: set(CONTAINEROF, value);
271: }
272:
273: /**
274: * removes a value
275: * @param value the value to be removed
276: * Schema Comment: An Item that this Container contains.
277: */
278: public void removeSiocContainerof(Item value) {
279: remove(CONTAINEROF, value);
280: }
281:
282: /**
283: * @param value
284: * @return true if the model contains a statement (this, CONTAINEROF, value)
285: */
286: public boolean hasSiocContainerof(Item value) {
287: return hasValue(CONTAINEROF, value);
288: }
289:
290: /**
291: * @return true if the model contains a statement (this, CONTAINEROF, *)
292: */
293: public boolean hasSiocContainerof() {
294: return hasValue(CONTAINEROF);
295: }
296:
297: /**
298: * adds a value
299: * @param value the value to be added
300: * Schema Comment: An Item that this Container contains.
301: */
302: public void addSiocContainerof(Item value) {
303: add(CONTAINEROF, value);
304: }
305:
306: /**
307: * @return all values
308: * Schema Comment: An Item that this Container contains.
309: */
310: public Item[] getAllSiocContainerof() {
311: return (Item[]) getAll(CONTAINEROF, Item.class);
312: }
313:
314: /**
315: * Schema Comment: A User who is subscribed to this Container.
316: * @return the only value. null if none is found
317: * @throws RDFDataException, if the property has multiple values
318: */
319: public User getSiocSubscriber() {
320: return (User) get(SUBSCRIBER, User.class);
321: }
322:
323: /**
324: * removes all values and sets this one
325: * @param value the value to be set
326: * Schema Comment: A User who is subscribed to this Container.
327: */
328: public void setSiocSubscriber(User value) {
329: set(SUBSCRIBER, value);
330: }
331:
332: /**
333: * removes a value
334: * @param value the value to be removed
335: * Schema Comment: A User who is subscribed to this Container.
336: */
337: public void removeSiocSubscriber(User value) {
338: remove(SUBSCRIBER, value);
339: }
340:
341: /**
342: * @param value
343: * @return true if the model contains a statement (this, SUBSCRIBER, value)
344: */
345: public boolean hasSiocSubscriber(User value) {
346: return hasValue(SUBSCRIBER, value);
347: }
348:
349: /**
350: * @return true if the model contains a statement (this, SUBSCRIBER, *)
351: */
352: public boolean hasSiocSubscriber() {
353: return hasValue(SUBSCRIBER);
354: }
355:
356: /**
357: * adds a value
358: * @param value the value to be added
359: * Schema Comment: A User who is subscribed to this Container.
360: */
361: public void addSiocSubscriber(User value) {
362: add(SUBSCRIBER, value);
363: }
364:
365: /**
366: * @return all values
367: * Schema Comment: A User who is subscribed to this Container.
368: */
369: public User[] getAllSiocSubscriber() {
370: return (User[]) getAll(SUBSCRIBER, User.class);
371: }
372:
373: /**
374: * Schema Comment: A Container (or Forum) that this Container (or Forum) is a child of.
375: * @return the only value. null if none is found
376: * @throws RDFDataException, if the property has multiple values
377: */
378: public Container getSiocParent() {
379: return (Container) get(PARENT, Container.class);
380: }
381:
382: /**
383: * removes all values and sets this one
384: * @param value the value to be set
385: * Schema Comment: A Container (or Forum) that this Container (or Forum) is a child of.
386: */
387: public void setSiocParent(Container value) {
388: set(PARENT, value);
389: }
390:
391: /**
392: * removes a value
393: * @param value the value to be removed
394: * Schema Comment: A Container (or Forum) that this Container (or Forum) is a child of.
395: */
396: public void removeSiocParent(Container value) {
397: remove(PARENT, value);
398: }
399:
400: /**
401: * @param value
402: * @return true if the model contains a statement (this, PARENT, value)
403: */
404: public boolean hasSiocParent(Container value) {
405: return hasValue(PARENT, value);
406: }
407:
408: /**
409: * @return true if the model contains a statement (this, PARENT, *)
410: */
411: public boolean hasSiocParent() {
412: return hasValue(PARENT);
413: }
414:
415: /**
416: * adds a value
417: * @param value the value to be added
418: * Schema Comment: A Container (or Forum) that this Container (or Forum) is a child of.
419: */
420: public void addSiocParent(Container value) {
421: add(PARENT, value);
422: }
423:
424: /**
425: * @return all values
426: * Schema Comment: A Container (or Forum) that this Container (or Forum) is a child of.
427: */
428: public Container[] getAllSiocParent() {
429: return (Container[]) getAll(PARENT, Container.class);
430: }
431:
432: /**
433: * Schema Comment: A User that this Container is owned by.
434: * @return the only value. null if none is found
435: * @throws RDFDataException, if the property has multiple values
436: */
437: public User getSiocOwner() {
438: return (User) get(OWNER, User.class);
439: }
440:
441: /**
442: * removes all values and sets this one
443: * @param value the value to be set
444: * Schema Comment: A User that this Container is owned by.
445: */
446: public void setSiocOwner(User value) {
447: set(OWNER, value);
448: }
449:
450: /**
451: * removes a value
452: * @param value the value to be removed
453: * Schema Comment: A User that this Container is owned by.
454: */
455: public void removeSiocOwner(User value) {
456: remove(OWNER, value);
457: }
458:
459: /**
460: * @param value
461: * @return true if the model contains a statement (this, OWNER, value)
462: */
463: public boolean hasSiocOwner(User value) {
464: return hasValue(OWNER, value);
465: }
466:
467: /**
468: * @return true if the model contains a statement (this, OWNER, *)
469: */
470: public boolean hasSiocOwner() {
471: return hasValue(OWNER);
472: }
473:
474: /**
475: * adds a value
476: * @param value the value to be added
477: * Schema Comment: A User that this Container is owned by.
478: */
479: public void addSiocOwner(User value) {
480: add(OWNER, value);
481: }
482:
483: /**
484: * @return all values
485: * Schema Comment: A User that this Container is owned by.
486: */
487: public User[] getAllSiocOwner() {
488: return (User[]) getAll(OWNER, User.class);
489: }
490:
491: /**
492: * Schema Comment: A child Container (or Forum) that this Container (or Forum) is a parent of.
493: * @return the only value. null if none is found
494: * @throws RDFDataException, if the property has multiple values
495: */
496: public Container getSiocParentof() {
497: return (Container) get(PARENTOF, Container.class);
498: }
499:
500: /**
501: * removes all values and sets this one
502: * @param value the value to be set
503: * Schema Comment: A child Container (or Forum) that this Container (or Forum) is a parent of.
504: */
505: public void setSiocParentof(Container value) {
506: set(PARENTOF, value);
507: }
508:
509: /**
510: * removes a value
511: * @param value the value to be removed
512: * Schema Comment: A child Container (or Forum) that this Container (or Forum) is a parent of.
513: */
514: public void removeSiocParentof(Container value) {
515: remove(PARENTOF, value);
516: }
517:
518: /**
519: * @param value
520: * @return true if the model contains a statement (this, PARENTOF, value)
521: */
522: public boolean hasSiocParentof(Container value) {
523: return hasValue(PARENTOF, value);
524: }
525:
526: /**
527: * @return true if the model contains a statement (this, PARENTOF, *)
528: */
529: public boolean hasSiocParentof() {
530: return hasValue(PARENTOF);
531: }
532:
533: /**
534: * adds a value
535: * @param value the value to be added
536: * Schema Comment: A child Container (or Forum) that this Container (or Forum) is a parent of.
537: */
538: public void addSiocParentof(Container value) {
539: add(PARENTOF, value);
540: }
541:
542: /**
543: * @return all values
544: * Schema Comment: A child Container (or Forum) that this Container (or Forum) is a parent of.
545: */
546: public Container[] getAllSiocParentof() {
547: return (Container[]) getAll(PARENTOF, Container.class);
548: }
549:
550: }
|