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> Member </li>
018: * <li> Usergroupof </li>
019: * </ul>
020: * Schema Comment: A set of User accounts whose owners have a common purpose or interest. Can be used for access control purposes.
021: */
022: public class Usergroup extends Thing {
023:
024: /** http://rdfs.org/sioc/ns#Usergroup */
025: public static final URI RDFS_CLASS = new URIImpl(
026: "http://rdfs.org/sioc/ns#Usergroup", false);
027:
028: /** http://rdfs.org/sioc/ns#has_member */
029: public static final URI MEMBER = new URIImpl(
030: "http://rdfs.org/sioc/ns#has_member", false);
031:
032: /** http://rdfs.org/sioc/ns#usergroup_of */
033: public static final URI USERGROUPOF = new URIImpl(
034: "http://rdfs.org/sioc/ns#usergroup_of", 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#has_member", false),
039: new URIImpl("http://rdfs.org/sioc/ns#usergroup_of", 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 Usergroup(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 Usergroup(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 Usergroup(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 Usergroup(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 Usergroup(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 Usergroup(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 Usergroup or null if none existst
125: * @throws Exception if Model causes problems
126: */
127: public static Usergroup getInstance(Model model, URI uri)
128: throws Exception {
129: return (Usergroup) getInstance(model, uri, Usergroup.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 Usergroup[] getAllInstances() {
145: return (Usergroup[]) getAllInstances(super .model,
146: Usergroup.class);
147: }
148:
149: /**
150: * @return all instances of this class in the given Model
151: * @param model an RDF2Go model
152: */
153: public static Usergroup[] getAllInstances(Model model) {
154: return (Usergroup[]) getAllInstances(model, Usergroup.class);
155: }
156:
157: /**
158: * @return all A's that have a relation 'Usergroup' to this Usergroup instance
159: */
160: public Space[] getAllSiocUsergroup_Inverse() {
161: return (Space[]) getAll_Inverse(Space.USERGROUP, this
162: .getResource(), Space.class);
163: }
164:
165: /**
166: * add 'Usergroup'-Inverse
167: * @param value
168: */
169: public void addSiocUsergroup_Inverse(Space value) {
170: value.add(Space.USERGROUP, this );
171: }
172:
173: /**
174: * @return all A's that have a relation 'Memberof' to this Usergroup instance
175: */
176: public User[] getAllSiocMemberof_Inverse() {
177: return (User[]) getAll_Inverse(User.MEMBEROF, this
178: .getResource(), User.class);
179: }
180:
181: /**
182: * add 'Memberof'-Inverse
183: * @param value
184: */
185: public void addSiocMemberof_Inverse(User value) {
186: value.add(User.MEMBEROF, this );
187: }
188:
189: /**
190: * Schema Comment: A User who is a member of this Usergroup.
191: * @return the only value. null if none is found
192: * @throws RDFDataException, if the property has multiple values
193: */
194: public User getSiocMember() {
195: return (User) get(MEMBER, User.class);
196: }
197:
198: /**
199: * removes all values and sets this one
200: * @param value the value to be set
201: * Schema Comment: A User who is a member of this Usergroup.
202: */
203: public void setSiocMember(User value) {
204: set(MEMBER, value);
205: }
206:
207: /**
208: * removes a value
209: * @param value the value to be removed
210: * Schema Comment: A User who is a member of this Usergroup.
211: */
212: public void removeSiocMember(User value) {
213: remove(MEMBER, value);
214: }
215:
216: /**
217: * @param value
218: * @return true if the model contains a statement (this, MEMBER, value)
219: */
220: public boolean hasSiocMember(User value) {
221: return hasValue(MEMBER, value);
222: }
223:
224: /**
225: * @return true if the model contains a statement (this, MEMBER, *)
226: */
227: public boolean hasSiocMember() {
228: return hasValue(MEMBER);
229: }
230:
231: /**
232: * adds a value
233: * @param value the value to be added
234: * Schema Comment: A User who is a member of this Usergroup.
235: */
236: public void addSiocMember(User value) {
237: add(MEMBER, value);
238: }
239:
240: /**
241: * @return all values
242: * Schema Comment: A User who is a member of this Usergroup.
243: */
244: public User[] getAllSiocMember() {
245: return (User[]) getAll(MEMBER, User.class);
246: }
247:
248: /**
249: * Schema Comment: A Space that the Usergroup has access to.
250: * @return the only value. null if none is found
251: * @throws RDFDataException, if the property has multiple values
252: */
253: public Space getSiocUsergroupof() {
254: return (Space) get(USERGROUPOF, Space.class);
255: }
256:
257: /**
258: * removes all values and sets this one
259: * @param value the value to be set
260: * Schema Comment: A Space that the Usergroup has access to.
261: */
262: public void setSiocUsergroupof(Space value) {
263: set(USERGROUPOF, value);
264: }
265:
266: /**
267: * removes a value
268: * @param value the value to be removed
269: * Schema Comment: A Space that the Usergroup has access to.
270: */
271: public void removeSiocUsergroupof(Space value) {
272: remove(USERGROUPOF, value);
273: }
274:
275: /**
276: * @param value
277: * @return true if the model contains a statement (this, USERGROUPOF, value)
278: */
279: public boolean hasSiocUsergroupof(Space value) {
280: return hasValue(USERGROUPOF, value);
281: }
282:
283: /**
284: * @return true if the model contains a statement (this, USERGROUPOF, *)
285: */
286: public boolean hasSiocUsergroupof() {
287: return hasValue(USERGROUPOF);
288: }
289:
290: /**
291: * adds a value
292: * @param value the value to be added
293: * Schema Comment: A Space that the Usergroup has access to.
294: */
295: public void addSiocUsergroupof(Space value) {
296: add(USERGROUPOF, value);
297: }
298:
299: /**
300: * @return all values
301: * Schema Comment: A Space that the Usergroup has access to.
302: */
303: public Space[] getAllSiocUsergroupof() {
304: return (Space[]) getAll(USERGROUPOF, Space.class);
305: }
306:
307: }
|