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