001: /**
002: * generated by http://RDFReactor.semweb4j.org ($Id: CodeGenerator.java 1046 2008-01-26 14:38:26Z max.at.xam.de $) on 26.01.08 15:47
003: */package com.example;
004:
005: import org.ontoware.aifbcommons.collection.ClosableIterator;
006: import org.ontoware.rdf2go.exception.ModelRuntimeException;
007: import org.ontoware.rdf2go.model.Model;
008: import org.ontoware.rdf2go.model.node.BlankNode;
009: import org.ontoware.rdf2go.model.node.URI;
010: import org.ontoware.rdf2go.model.node.impl.URIImpl;
011: import org.ontoware.rdfreactor.runtime.Base;
012: import org.ontoware.rdfreactor.runtime.ReactorResult;
013:
014: /**
015: * This class manages access to these properties:
016: * <ul>
017: * <li> Pet </li>
018: * </ul>
019: *
020: * This class was generated by <a href="http://RDFReactor.semweb4j.org">RDFReactor</a> on 26.01.08 15:47
021: */
022: public class Person extends Thing {
023:
024: /** urn:ex:Person */
025: public static final URI RDFS_CLASS = new URIImpl("urn:ex:Person",
026: false);
027:
028: /** urn:ex:hasPet */
029: public static final URI PET = new URIImpl("urn:ex:hasPet", false);
030:
031: /** all property-URIs with this class as domain */
032: public static final URI[] MANAGED_URIS = { new URIImpl(
033: "urn:ex:hasPet", false) };
034:
035: // protected constructors needed for inheritance
036:
037: /**
038: * Returns a Java wrapper over an RDF object, identified by URI.
039: * Creating two wrappers for the same instanceURI is legal.
040: * @param model RDF2GO Model implementation, see http://rdf2go.semweb4j.org
041: * @param classURI URI of RDFS class
042: * @param instanceIdentifier Resource that identifies this instance
043: * @param write if true, the statement (this, rdf:type, TYPE) is written to the model
044: *
045: * [Generated from RDFReactor template rule #c1]
046: */
047: protected Person(Model model, URI classURI,
048: org.ontoware.rdf2go.model.node.Resource instanceIdentifier,
049: boolean write) {
050: super (model, classURI, instanceIdentifier, write);
051: }
052:
053: // public constructors
054:
055: /**
056: * Returns a Java wrapper over an RDF object, identified by URI.
057: * Creating two wrappers for the same instanceURI is legal.
058: * @param model RDF2GO Model implementation, see http://rdf2go.ontoware.org
059: * @param instanceIdentifier an RDF2Go Resource identifying this instance
060: * @param write if true, the statement (this, rdf:type, TYPE) is written to the model
061: *
062: * [Generated from RDFReactor template rule #c2]
063: */
064: public Person(Model model,
065: org.ontoware.rdf2go.model.node.Resource instanceIdentifier,
066: boolean write) {
067: super (model, RDFS_CLASS, instanceIdentifier, write);
068: }
069:
070: /**
071: * Returns a Java wrapper over an RDF object, identified by a URI, given as a String.
072: * Creating two wrappers for the same URI is legal.
073: * @param model RDF2GO Model implementation, see http://rdf2go.ontoware.org
074: * @param uriString a URI given as a String
075: * @param write if true, the statement (this, rdf:type, TYPE) is written to the model
076: * @throws ModelRuntimeException if URI syntax is wrong
077: *
078: * [Generated from RDFReactor template rule #c7]
079: */
080: public Person(Model model, String uriString, boolean write)
081: throws ModelRuntimeException {
082: super (model, RDFS_CLASS, new URIImpl(uriString, false), write);
083: }
084:
085: /**
086: * Returns a Java wrapper over an RDF object, identified by a blank node.
087: * Creating two wrappers for the same blank node is legal.
088: * @param model RDF2GO Model implementation, see http://rdf2go.ontoware.org
089: * @param bnode BlankNode of this instance
090: * @param write if true, the statement (this, rdf:type, TYPE) is written to the model
091: *
092: * [Generated from RDFReactor template rule #c8]
093: */
094: public Person(Model model, BlankNode bnode, boolean write) {
095: super (model, RDFS_CLASS, bnode, write);
096: }
097:
098: /**
099: * Returns a Java wrapper over an RDF object, identified by
100: * a randomly generated URI.
101: * Creating two wrappers results in different URIs.
102: * @param model RDF2GO Model implementation, see http://rdf2go.ontoware.org
103: * @param write if true, the statement (this, rdf:type, TYPE) is written to the model
104: *
105: * [Generated from RDFReactor template rule #c9]
106: */
107: public Person(Model model, boolean write) {
108: super (model, RDFS_CLASS, model.newRandomUniqueURI(), write);
109: }
110:
111: ///////////////////////////////////////////////////////////////////
112: // typing
113:
114: /**
115: * Create a new instance of this class in the model.
116: * That is, create the statement (instanceResource, RDF.type, urn:ex:Person).
117: * @param model an RDF2Go model
118: * @param instanceResource an RDF2Go resource
119: *
120: * [Generated from RDFReactor template rule #class1]
121: */
122: public static void createInstance(Model model,
123: org.ontoware.rdf2go.model.node.Resource instanceResource) {
124: Base.createInstance(model, RDFS_CLASS, instanceResource);
125: }
126:
127: /**
128: * @param model an RDF2Go model
129: * @param instanceResource an RDF2Go resource
130: * @return true if instanceResource is an instance of this class in the model
131: *
132: * [Generated from RDFReactor template rule #class2]
133: */
134: public static boolean hasInstance(Model model,
135: org.ontoware.rdf2go.model.node.Resource instanceResource) {
136: return Base.hasInstance(model, RDFS_CLASS, instanceResource);
137: }
138:
139: /**
140: * @param model an RDF2Go model
141: * @return all instances of this class in Model 'model' as RDF resources
142: *
143: * [Generated from RDFReactor template rule #class3]
144: */
145: public static ClosableIterator<org.ontoware.rdf2go.model.node.Resource> getAllInstances(
146: Model model) {
147: return Base.getAllInstances(model, RDFS_CLASS,
148: org.ontoware.rdf2go.model.node.Resource.class);
149: }
150:
151: /**
152: * @param model an RDF2Go model
153: * @return all instances of this class in Model 'model' as a ReactorResult,
154: * which can conveniently be converted to iterator, list or array.
155: *
156: * [Generated from RDFReactor template rule #class3-as]
157: */
158: public static ReactorResult<? extends Person> getAllInstance_as(
159: Model model) {
160: return Base.getAllInstances_as(model, RDFS_CLASS, Person.class);
161: }
162:
163: /**
164: * Delete all rdf:type from this instance. Other triples are not affected.
165: * @param model an RDF2Go model
166: * @param instanceResource an RDF2Go resource
167: *
168: * [Generated from RDFReactor template rule #class4]
169: */
170: public static void deleteInstance(Model model,
171: org.ontoware.rdf2go.model.node.Resource instanceResource) {
172: Base.deleteInstance(model, RDFS_CLASS, instanceResource);
173: }
174:
175: ///////////////////////////////////////////////////////////////////
176: // property access methods
177:
178: /**
179: * Get all values of property Pet as an Iterator over RDF2Go nodes
180: * @param model an RDF2Go model
181: * @param resource an RDF2Go resource
182: * @return a ClosableIterator of RDF2Go Nodes
183: *
184: * [Generated from RDFReactor template rule #get7static]
185: */
186: public static ClosableIterator<org.ontoware.rdf2go.model.node.Node> getAllPet_asNode(
187: Model model,
188: org.ontoware.rdf2go.model.node.Resource instanceResource) {
189: return (ClosableIterator<org.ontoware.rdf2go.model.node.Node>) Base
190: .getAll_asNode(model, instanceResource, PET);
191: }
192:
193: /**
194: * Get all values of property Pet as a ReactorResult of RDF2Go nodes
195: * @param model an RDF2Go model
196: * @param resource an RDF2Go resource
197: * @return a List of RDF2Go Nodes
198: *
199: * [Generated from RDFReactor template rule #get7static-reactor-result]
200: */
201: public static ReactorResult<org.ontoware.rdf2go.model.node.Node> getAllPet_asNode_(
202: Model model,
203: org.ontoware.rdf2go.model.node.Resource instanceResource) {
204: return (ReactorResult<org.ontoware.rdf2go.model.node.Node>) Base
205: .getAll_as(model, instanceResource, PET,
206: org.ontoware.rdf2go.model.node.Node.class);
207: }
208:
209: /**
210: * Get all values of property Pet as an Iterator over RDF2Go nodes
211: * @return a ClosableIterator of RDF2Go Nodes
212: *
213: * [Generated from RDFReactor template rule #get8dynamic]
214: */
215: public ClosableIterator<org.ontoware.rdf2go.model.node.Node> getAllPet_asNode() {
216: return (ClosableIterator<org.ontoware.rdf2go.model.node.Node>) Base
217: .getAll_asNode(this .model, this .getResource(), PET);
218: }
219:
220: /**
221: * Get all values of property Pet as a ReactorResult of RDF2Go nodes
222: * @return a List of RDF2Go Nodes
223: *
224: * [Generated from RDFReactor template rule #get8dynamic-reactor-result]
225: */
226: public ReactorResult<org.ontoware.rdf2go.model.node.Node> getAllPet_asNode_() {
227: return (ReactorResult<org.ontoware.rdf2go.model.node.Node>) Base
228: .getAll_as(this .model, this .getResource(), PET,
229: org.ontoware.rdf2go.model.node.Node.class);
230: }
231:
232: /**
233: * Get all values of property Pet * @param model an RDF2Go model
234: * @param resource an RDF2Go resource
235: * @return a ClosableIterator of $type
236: *
237: * [Generated from RDFReactor template rule #get11static]
238: */
239: public static ClosableIterator<Dog> getAllPet(Model model,
240: org.ontoware.rdf2go.model.node.Resource instanceResource) {
241: return Base.getAll(model, instanceResource, PET, Dog.class);
242: }
243:
244: /**
245: * Get all values of property Pet as a ReactorResult of Dog
246: * @param model an RDF2Go model
247: * @param resource an RDF2Go resource
248: * @return a ReactorResult of $type which can conveniently be converted to iterator, list or array
249: *
250: * [Generated from RDFReactor template rule #get11static-reactorresult]
251: */
252: public static ReactorResult<Dog> getAllPet_as(Model model,
253: org.ontoware.rdf2go.model.node.Resource instanceResource) {
254: return Base.getAll_as(model, instanceResource, PET, Dog.class);
255: }
256:
257: /**
258: * Get all values of property Pet * @return a ClosableIterator of $type
259: *
260: * [Generated from RDFReactor template rule #get12dynamic]
261: */
262: public ClosableIterator<Dog> getAllPet() {
263: return Base.getAll(this .model, this .getResource(), PET,
264: Dog.class);
265: }
266:
267: /**
268: * Get all values of property Pet as a ReactorResult of Dog
269: * @return a ReactorResult of $type which can conveniently be converted to iterator, list or array
270: *
271: * [Generated from RDFReactor template rule #get12dynamic-reactorresult]
272: */
273: public ReactorResult<Dog> getAllPet_as() {
274: return Base.getAll_as(this .model, this .getResource(), PET,
275: Dog.class);
276: }
277:
278: /**
279: * Adds a value to property Pet as an RDF2Go node
280: * @param model an RDF2Go model
281: * @param resource an RDF2Go resource
282: * @param value the value to be added
283: *
284: * [Generated from RDFReactor template rule #add1static]
285: */
286: public static void addPet(Model model,
287: org.ontoware.rdf2go.model.node.Resource instanceResource,
288: org.ontoware.rdf2go.model.node.Node value) {
289: Base.add(model, instanceResource, PET, value);
290: }
291:
292: /**
293: * Adds a value to property Pet as an RDF2Go node
294: * @param value the value to be added
295: *
296: * [Generated from RDFReactor template rule #add1dynamic]
297: */
298: public void addPet(org.ontoware.rdf2go.model.node.Node value) {
299: Base.add(this .model, this .getResource(), PET, value);
300: }
301:
302: /**
303: * Adds a value to property Pet from an instance of Dog
304: * @param model an RDF2Go model
305: * @param resource an RDF2Go resource
306: *
307: * [Generated from RDFReactor template rule #add3static]
308: */
309: public static void addPet(Model model,
310: org.ontoware.rdf2go.model.node.Resource instanceResource,
311: Dog value) {
312: Base.add(model, instanceResource, PET, value);
313: }
314:
315: /**
316: * Adds a value to property Pet from an instance of Dog
317: *
318: * [Generated from RDFReactor template rule #add4dynamic]
319: */
320: public void addPet(Dog value) {
321: Base.add(this .model, this .getResource(), PET, value);
322: }
323:
324: /**
325: * Sets a value of property Pet from an RDF2Go node.
326: * First, all existing values are removed, then this value is added.
327: * Cardinality constraints are not checked, but this method exists only for properties with
328: * no minCardinality or minCardinality == 1.
329: * @param model an RDF2Go model
330: * @param resource an RDF2Go resource
331: * @param value the value to be set
332: *
333: * [Generated from RDFReactor template rule #set1static]
334: */
335: public static void setPet(Model model,
336: org.ontoware.rdf2go.model.node.Resource instanceResource,
337: org.ontoware.rdf2go.model.node.Node value) {
338: Base.set(model, instanceResource, PET, value);
339: }
340:
341: /**
342: * Sets a value of property Pet from an RDF2Go node.
343: * First, all existing values are removed, then this value is added.
344: * Cardinality constraints are not checked, but this method exists only for properties with
345: * no minCardinality or minCardinality == 1.
346: * @param value the value to be added
347: *
348: * [Generated from RDFReactor template rule #set1dynamic]
349: */
350: public void setPet(org.ontoware.rdf2go.model.node.Node value) {
351: Base.set(this .model, this .getResource(), PET, value);
352: }
353:
354: /**
355: * Sets a value of property Pet from an instance of Dog
356: * First, all existing values are removed, then this value is added.
357: * Cardinality constraints are not checked, but this method exists only for properties with
358: * no minCardinality or minCardinality == 1.
359: * @param model an RDF2Go model
360: * @param resource an RDF2Go resource
361: * @param value the value to be added
362: *
363: * [Generated from RDFReactor template rule #set3static]
364: */
365: public static void setPet(Model model,
366: org.ontoware.rdf2go.model.node.Resource instanceResource,
367: Dog value) {
368: Base.set(model, instanceResource, PET, value);
369: }
370:
371: /**
372: * Sets a value of property Pet from an instance of Dog
373: * First, all existing values are removed, then this value is added.
374: * Cardinality constraints are not checked, but this method exists only for properties with
375: * no minCardinality or minCardinality == 1.
376: * @param value the value to be added
377: *
378: * [Generated from RDFReactor template rule #set4dynamic]
379: */
380: public void setPet(Dog value) {
381: Base.set(this .model, this .getResource(), PET, value);
382: }
383:
384: /**
385: * Removes a value of property Pet as an RDF2Go node
386: * @param model an RDF2Go model
387: * @param resource an RDF2Go resource
388: * @param value the value to be removed
389: *
390: * [Generated from RDFReactor template rule #remove1static]
391: */
392: public static void removePet(Model model,
393: org.ontoware.rdf2go.model.node.Resource instanceResource,
394: org.ontoware.rdf2go.model.node.Node value) {
395: Base.remove(model, instanceResource, PET, value);
396: }
397:
398: /**
399: * Removes a value of property Pet as an RDF2Go node
400: * @param value the value to be removed
401: *
402: * [Generated from RDFReactor template rule #remove1dynamic]
403: */
404: public void removePet(org.ontoware.rdf2go.model.node.Node value) {
405: Base.remove(this .model, this .getResource(), PET, value);
406: }
407:
408: /**
409: * Removes a value of property Pet given as an instance of Dog
410: * @param model an RDF2Go model
411: * @param resource an RDF2Go resource
412: * @param value the value to be removed
413: *
414: * [Generated from RDFReactor template rule #remove3static]
415: */
416: public static void removePet(Model model,
417: org.ontoware.rdf2go.model.node.Resource instanceResource,
418: Dog value) {
419: Base.remove(model, instanceResource, PET, value);
420: }
421:
422: /**
423: * Removes a value of property Pet given as an instance of Dog
424: * @param value the value to be removed
425: *
426: * [Generated from RDFReactor template rule #remove4dynamic]
427: */
428: public void removePet(Dog value) {
429: Base.remove(this .model, this .getResource(), PET, value);
430: }
431:
432: /**
433: * Removes all values of property Pet * @param model an RDF2Go model
434: * @param resource an RDF2Go resource
435: *
436: * [Generated from RDFReactor template rule #removeall1static]
437: */
438: public static void removeAllPet(Model model,
439: org.ontoware.rdf2go.model.node.Resource instanceResource) {
440: Base.removeAll(model, instanceResource, PET);
441: }
442:
443: /**
444: * Removes all values of property Pet *
445: * [Generated from RDFReactor template rule #removeall1dynamic]
446: */
447: public void addPet() {
448: Base.removeAll(this.model, this.getResource(), PET);
449: }
450: }
|