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 was generated by <a href="http://RDFReactor.semweb4j.org">RDFReactor</a> on 26.01.08 15:47
016: */
017: public class Dog extends Thing {
018:
019: /** urn:ex:Dog */
020: public static final URI RDFS_CLASS = new URIImpl("urn:ex:Dog",
021: false);
022:
023: /** all property-URIs with this class as domain */
024: public static final URI[] MANAGED_URIS = {
025:
026: };
027:
028: // protected constructors needed for inheritance
029:
030: /**
031: * Returns a Java wrapper over an RDF object, identified by URI.
032: * Creating two wrappers for the same instanceURI is legal.
033: * @param model RDF2GO Model implementation, see http://rdf2go.semweb4j.org
034: * @param classURI URI of RDFS class
035: * @param instanceIdentifier Resource that identifies this instance
036: * @param write if true, the statement (this, rdf:type, TYPE) is written to the model
037: *
038: * [Generated from RDFReactor template rule #c1]
039: */
040: protected Dog(Model model, URI classURI,
041: org.ontoware.rdf2go.model.node.Resource instanceIdentifier,
042: boolean write) {
043: super (model, classURI, instanceIdentifier, write);
044: }
045:
046: // public constructors
047:
048: /**
049: * Returns a Java wrapper over an RDF object, identified by URI.
050: * Creating two wrappers for the same instanceURI is legal.
051: * @param model RDF2GO Model implementation, see http://rdf2go.ontoware.org
052: * @param instanceIdentifier an RDF2Go Resource identifying this instance
053: * @param write if true, the statement (this, rdf:type, TYPE) is written to the model
054: *
055: * [Generated from RDFReactor template rule #c2]
056: */
057: public Dog(Model model,
058: org.ontoware.rdf2go.model.node.Resource instanceIdentifier,
059: boolean write) {
060: super (model, RDFS_CLASS, instanceIdentifier, write);
061: }
062:
063: /**
064: * Returns a Java wrapper over an RDF object, identified by a URI, given as a String.
065: * Creating two wrappers for the same URI is legal.
066: * @param model RDF2GO Model implementation, see http://rdf2go.ontoware.org
067: * @param uriString a URI given as a String
068: * @param write if true, the statement (this, rdf:type, TYPE) is written to the model
069: * @throws ModelRuntimeException if URI syntax is wrong
070: *
071: * [Generated from RDFReactor template rule #c7]
072: */
073: public Dog(Model model, String uriString, boolean write)
074: throws ModelRuntimeException {
075: super (model, RDFS_CLASS, new URIImpl(uriString, false), write);
076: }
077:
078: /**
079: * Returns a Java wrapper over an RDF object, identified by a blank node.
080: * Creating two wrappers for the same blank node is legal.
081: * @param model RDF2GO Model implementation, see http://rdf2go.ontoware.org
082: * @param bnode BlankNode of this instance
083: * @param write if true, the statement (this, rdf:type, TYPE) is written to the model
084: *
085: * [Generated from RDFReactor template rule #c8]
086: */
087: public Dog(Model model, BlankNode bnode, boolean write) {
088: super (model, RDFS_CLASS, bnode, write);
089: }
090:
091: /**
092: * Returns a Java wrapper over an RDF object, identified by
093: * a randomly generated URI.
094: * Creating two wrappers results in different URIs.
095: * @param model RDF2GO Model implementation, see http://rdf2go.ontoware.org
096: * @param write if true, the statement (this, rdf:type, TYPE) is written to the model
097: *
098: * [Generated from RDFReactor template rule #c9]
099: */
100: public Dog(Model model, boolean write) {
101: super (model, RDFS_CLASS, model.newRandomUniqueURI(), write);
102: }
103:
104: ///////////////////////////////////////////////////////////////////
105: // typing
106:
107: /**
108: * Create a new instance of this class in the model.
109: * That is, create the statement (instanceResource, RDF.type, urn:ex:Dog).
110: * @param model an RDF2Go model
111: * @param instanceResource an RDF2Go resource
112: *
113: * [Generated from RDFReactor template rule #class1]
114: */
115: public static void createInstance(Model model,
116: org.ontoware.rdf2go.model.node.Resource instanceResource) {
117: Base.createInstance(model, RDFS_CLASS, instanceResource);
118: }
119:
120: /**
121: * @param model an RDF2Go model
122: * @param instanceResource an RDF2Go resource
123: * @return true if instanceResource is an instance of this class in the model
124: *
125: * [Generated from RDFReactor template rule #class2]
126: */
127: public static boolean hasInstance(Model model,
128: org.ontoware.rdf2go.model.node.Resource instanceResource) {
129: return Base.hasInstance(model, RDFS_CLASS, instanceResource);
130: }
131:
132: /**
133: * @param model an RDF2Go model
134: * @return all instances of this class in Model 'model' as RDF resources
135: *
136: * [Generated from RDFReactor template rule #class3]
137: */
138: public static ClosableIterator<org.ontoware.rdf2go.model.node.Resource> getAllInstances(
139: Model model) {
140: return Base.getAllInstances(model, RDFS_CLASS,
141: org.ontoware.rdf2go.model.node.Resource.class);
142: }
143:
144: /**
145: * @param model an RDF2Go model
146: * @return all instances of this class in Model 'model' as a ReactorResult,
147: * which can conveniently be converted to iterator, list or array.
148: *
149: * [Generated from RDFReactor template rule #class3-as]
150: */
151: public static ReactorResult<? extends Dog> getAllInstance_as(
152: Model model) {
153: return Base.getAllInstances_as(model, RDFS_CLASS, Dog.class);
154: }
155:
156: /**
157: * Delete all rdf:type from this instance. Other triples are not affected.
158: * @param model an RDF2Go model
159: * @param instanceResource an RDF2Go resource
160: *
161: * [Generated from RDFReactor template rule #class4]
162: */
163: public static void deleteInstance(Model model,
164: org.ontoware.rdf2go.model.node.Resource instanceResource) {
165: Base.deleteInstance(model, RDFS_CLASS, instanceResource);
166: }
167:
168: ///////////////////////////////////////////////////////////////////
169: // property access methods
170:
171: /**
172: * @param model an RDF2Go model
173: * @param objectValue
174: * @return all A's as RDF resources, that have a relation 'Pet' to this Dog instance
175: *
176: * [Generated from RDFReactor template rule #getallinverse1static]
177: */
178: public static ClosableIterator<org.ontoware.rdf2go.model.node.Resource> getAllPet_Inverse(
179: Model model, Object objectValue) {
180: return Base.getAll_Inverse(model, Person.PET, objectValue);
181: }
182:
183: }
|