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