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: /**
012: * This class was generated by <a href="http://RDFReactor.semweb4j.org">RDFReactor</a> on 01.06.07 18:30
013: * Schema Comment: Community is a high-level concept that defines an online community and what it consists of.
014: */
015: public class Community extends Thing {
016:
017: /** http://rdfs.org/sioc/ns#Community */
018: public static final URI RDFS_CLASS = new URIImpl(
019: "http://rdfs.org/sioc/ns#Community", false);
020:
021: /** all property-URIs with this class as domain */
022: public static final URI[] MANAGED_URIS = {
023:
024: };
025:
026: // protected constructors needed for inheritance
027:
028: /**
029: * Returns a Java wrapper over an RDF object, identified by URI.
030: * Creating two wrappers for the same instanceURI is legal.
031: * @param model RDF2GO Model implementation, see http://rdf2go.semweb4j.org
032: * @param classURI URI of RDFS class
033: * @param instanceIdentifier Resource that identifies this instance
034: * @param write if true, the statement (this, rdf:type, TYPE) is written to the model
035: */
036: protected Community(Model model, URI classURI,
037: org.ontoware.rdf2go.model.node.Resource instanceIdentifier,
038: boolean write) {
039: super (model, classURI, instanceIdentifier, write);
040: }
041:
042: // public constructors
043:
044: /**
045: * Returns a Java wrapper over an RDF object, identified by URI.
046: * Creating two wrappers for the same instanceURI is legal.
047: * @param model RDF2GO Model implementation, see http://rdf2go.ontoware.org
048: * @param instanceIdentifier an RDF2Go Resource identifying this instance
049: * @param write if true, the statement (this, rdf:type, TYPE) is written to the model
050: */
051: public Community(Model model,
052: org.ontoware.rdf2go.model.node.Resource instanceIdentifier,
053: boolean write) {
054: super (model, RDFS_CLASS, instanceIdentifier, write);
055: }
056:
057: /**
058: * Returns a Java wrapper over an RDF object, identified by URI.
059: * Creating two wrappers for the same instanceURI is legal.
060: * The statement (this, rdf:type, TYPE) is written to the model
061: * @param model RDF2GO Model implementation, see http://rdf2go.ontoware.org
062: * @param uri URI of this instance
063: */
064: public Community(Model model, URI uri) {
065: this (model, uri, true);
066: }
067:
068: /**
069: * Returns a Java wrapper over an RDF object, identified by URI.
070: * Creating two wrappers for the same instanceURI is legal.
071: * The statement (this, rdf:type, TYPE) is written to the model
072: * @param model RDF2GO Model implementation, see http://rdf2go.ontoware.org
073: * @param uriString A URI of this instance, represented as a String
074: * @throws ModelRuntimeException if URI syntax is wrong
075: */
076: public Community(Model model, String uriString)
077: throws ModelRuntimeException {
078: this (model, new URIImpl(uriString), true);
079: }
080:
081: /**
082: * Returns a Java wrapper over an RDF object, identified by a blank node.
083: * Creating two wrappers for the same blank node is legal.
084: * The statement (this, rdf:type, TYPE) is written to the model
085: * @param model RDF2GO Model implementation, see http://rdf2go.ontoware.org
086: * @param bnode BlankNode of this instance
087: */
088: public Community(Model model, BlankNode bnode) {
089: this (model, bnode, true);
090: }
091:
092: /**
093: * Returns a Java wrapper over an RDF object, identified by
094: * a randomly generated URI.
095: * Creating two wrappers results in different URIs.
096: * The statement (this, rdf:type, TYPE) is written to the model
097: * @param model RDF2GO Model implementation, see http://rdf2go.ontoware.org
098: */
099: public Community(Model model) {
100: this (model, model.newRandomUniqueURI(), true);
101: }
102:
103: ///////////////////////////////////////////////////////////////////
104: // getters, setters, ...
105:
106: /**
107: * @param model RDF2Go model
108: * @param uri instance identifier
109: * @return an instance of Community or null if none existst
110: * @throws Exception if Model causes problems
111: */
112: public static Community getInstance(Model model, URI uri)
113: throws Exception {
114: return (Community) getInstance(model, uri, Community.class);
115: }
116:
117: /**
118: * @param model
119: * @param uri
120: * @return true if uri is an instance of this class in the model
121: */
122: public static boolean hasInstance(Model model, URI uri) {
123: return hasInstance(model, uri, RDFS_CLASS);
124: }
125:
126: /**
127: * @return all instances of this class
128: */
129: public Community[] getAllInstances() {
130: return (Community[]) getAllInstances(super .model,
131: Community.class);
132: }
133:
134: /**
135: * @return all instances of this class in the given Model
136: * @param model an RDF2Go model
137: */
138: public static Community[] getAllInstances(Model model) {
139: return (Community[]) getAllInstances(model, Community.class);
140: }
141:
142: }
|