Package org.ontoware.semweb4j.lessons.lesson5.gen

Source Code of org.ontoware.semweb4j.lessons.lesson5.gen.Person

/**
* generated by http://RDFReactor.semweb4j.org ($Id: CodeGenerator.java 785 2007-05-31 15:47:01Z voelkel $) on 02.07.07 21:37
*/
package org.ontoware.semweb4j.lessons.lesson5.gen;

import org.ontoware.rdf2go.exception.ModelRuntimeException;
import org.ontoware.rdf2go.model.Model;
import org.ontoware.rdf2go.model.node.BlankNode;
import org.ontoware.rdf2go.model.node.URI;
import org.ontoware.rdf2go.model.node.impl.URIImpl;
import org.ontoware.rdfreactor.runtime.RDFDataException;


/**
* the 'atoms' of PeopleTag, people
* This class manages access to these properties:
* <ul>
*   <li> Name </li>
*   <li> Tag </li>
*   <li> Knows </li>
* </ul>
*
* This class was generated by <a href="http://RDFReactor.semweb4j.org">RDFReactor</a> on 02.07.07 21:37
*/
public class Person extends Thing {

    /** http://example.com/semweb4j#Person */
  public static final URI RDFS_CLASS = new URIImpl("http://example.com/semweb4j#Person", false);

    /** http://example.com/semweb4j#name */
  public static final URI NAME = new URIImpl("http://example.com/semweb4j#name",false);

    /** http://example.com/semweb4j#tag */
  public static final URI TAG = new URIImpl("http://example.com/semweb4j#tag",false);

    /** http://example.com/semweb4j#knows */
  public static final URI KNOWS = new URIImpl("http://example.com/semweb4j#knows",false);

    /** all property-URIs with this class as domain */
    public static final URI[] MANAGED_URIS = {
      new URIImpl("http://example.com/semweb4j#name",false),
      new URIImpl("http://example.com/semweb4j#tag",false),
      new URIImpl("http://example.com/semweb4j#knows",false)
    };

 
  // protected constructors needed for inheritance
 
  /**
   * Returns a Java wrapper over an RDF object, identified by URI.
   * Creating two wrappers for the same instanceURI is legal.
   * @param model RDF2GO Model implementation, see http://rdf2go.semweb4j.org
   * @param classURI URI of RDFS class
   * @param instanceIdentifier Resource that identifies this instance
   * @param write if true, the statement (this, rdf:type, TYPE) is written to the model
   */
  protected Person ( Model model, URI classURI, org.ontoware.rdf2go.model.node.Resource instanceIdentifier, boolean write ) {
    super(model, classURI, instanceIdentifier, write);
  }

  // public constructors

  /**
   * Returns a Java wrapper over an RDF object, identified by URI.
   * Creating two wrappers for the same instanceURI is legal.
   * @param model RDF2GO Model implementation, see http://rdf2go.ontoware.org
   * @param instanceIdentifier an RDF2Go Resource identifying this instance
   * @param write if true, the statement (this, rdf:type, TYPE) is written to the model
   */
  public Person ( Model model, org.ontoware.rdf2go.model.node.Resource instanceIdentifier, boolean write ) {
    super(model, RDFS_CLASS, instanceIdentifier, write);
  }

  /**
   * Returns a Java wrapper over an RDF object, identified by URI.
   * Creating two wrappers for the same instanceURI is legal.
   * The statement (this, rdf:type, TYPE) is written to the model
   * @param model RDF2GO Model implementation, see http://rdf2go.ontoware.org
   * @param uri URI of this instance
   */
  public Person ( Model model, URI uri ) {
    this(model, uri, true);
  }

  /**
   * Returns a Java wrapper over an RDF object, identified by URI.
   * Creating two wrappers for the same instanceURI is legal.
   * The statement (this, rdf:type, TYPE) is written to the model
   * @param model RDF2GO Model implementation, see http://rdf2go.ontoware.org
   * @param uriString A URI of this instance, represented as a String
   * @throws ModelRuntimeException if URI syntax is wrong
   */
  public Person ( Model model, String uriString ) throws ModelRuntimeException {
    this(model, new URIImpl(uriString), true);
  }

  /**
   * Returns a Java wrapper over an RDF object, identified by a blank node.
   * Creating two wrappers for the same blank node is legal.
   * The statement (this, rdf:type, TYPE) is written to the model
   * @param model RDF2GO Model implementation, see http://rdf2go.ontoware.org
   * @param bnode BlankNode of this instance
   */
  public Person ( Model model, BlankNode bnode ) {
    this(model, bnode, true);
  }

  /**
   * Returns a Java wrapper over an RDF object, identified by
   * a randomly generated URI.
   * Creating two wrappers results in different URIs.
   * The statement (this, rdf:type, TYPE) is written to the model
   * @param model RDF2GO Model implementation, see http://rdf2go.ontoware.org
   */
  public Person ( Model model ) {
    this(model, model.newRandomUniqueURI(), true);
  }


    ///////////////////////////////////////////////////////////////////
    // getters, setters, ...

  /**
   * @param model RDF2Go model
   * @param uri instance identifier
   * @return an instance of Person or null if none existst
   * @throws Exception if Model causes problems
   */
  public static Person getInstance(Model model, URI uri) throws Exception {
    return (Person) getInstance(model, uri, Person.class);
  }

  /**
   * @param model
   * @param uri
   * @return true if uri is an instance of this class in the model
   */
  public static boolean hasInstance(Model model, URI uri) {
    return hasInstance(model, uri, RDFS_CLASS);
  }

  /**
   * @return all instances of this class
   */
  public Person[] getAllInstances() {
    return (Person[]) getAllInstances(super.model, Person.class);
  }

  /**
   * @return all instances of this class in the given Model
   * @param model an RDF2Go model
   */
  public static Person[] getAllInstances(Model model) {
    return (Person[]) getAllInstances(model, Person.class);
  }

  /**
   * @return all A's that have a relation 'Knows' to this Person instance
   */
  public Person[] getAllKnows_Inverse() {
    return (Person[]) getAll_Inverse(Person.KNOWS, this.getResource(), Person.class);
  }

  /**
   * add 'Knows'-Inverse
   * @param value
   */
  public void addKnows_Inverse(Person value) {
    value.add( Person.KNOWS ,this);
  }



    /**
     * Schema Comment: a name of a person or tag
     * @return the only value. null if none is found
     * @throws RDFDataException, if the property has multiple values
     */
  public java.lang.String getName() {
    return (java.lang.String) get(NAME, java.lang.String.class);
  }

  /**
   * removes all values and sets this one
   * @param value the value to be set
     * Schema Comment: a name of a person or tag
   */
  public void setName( java.lang.String value ) {
    set(NAME, value);
  }

  /**
   * removes current value(s)
     * Schema Comment: a name of a person or tag
   */
  public void removeName() {
    removeAll(NAME);
  }
   /**
   * removes a value
   * @param value the value to be removed
     * Schema Comment: a name of a person or tag
   */
  public void removeName( java.lang.String value  ) {
    remove(NAME, value);
  }

  /**
   * removes all values
     * Schema Comment: a name of a person or tag
   */
  public void removeAllName() {
    removeAll(NAME);
  }
  /**
   * @param value
   * @return true if the model contains a statement (this, NAME, value)
   */
  public boolean hasName( java.lang.String value) {
    return hasValue(NAME, value);
  }

  /**
   * @return true if the model contains a statement (this, NAME, *)
   */
  public boolean hasName() {
    return hasValue(NAME);
  }

  /**
   * adds a value
   * @param value the value to be added
     * Schema Comment: a name of a person or tag
   */
  public void addName( java.lang.String value  ) {
    add(NAME, value );
  }

  /**
   * @return all values
     * Schema Comment: a name of a person or tag
   */
  public java.lang.String[] getAllName() {
    return (java.lang.String[]) getAll(NAME, java.lang.String.class);
  }
 

    /**
     * Schema Comment: a tag which has been assigned
     * @return the only value. null if none is found
     * @throws RDFDataException, if the property has multiple values
     */
  public Tag getTag() {
    return (Tag) get(TAG, Tag.class);
  }

  /**
   * removes all values and sets this one
   * @param value the value to be set
     * Schema Comment: a tag which has been assigned
   */
  public void setTag( Tag value ) {
    set(TAG, value);
  }

  /**
   * removes current value(s)
     * Schema Comment: a tag which has been assigned
   */
  public void removeTag() {
    removeAll(TAG);
  }
   /**
   * removes a value
   * @param value the value to be removed
     * Schema Comment: a tag which has been assigned
   */
  public void removeTag( Tag value  ) {
    remove(TAG, value);
  }

  /**
   * removes all values
     * Schema Comment: a tag which has been assigned
   */
  public void removeAllTag() {
    removeAll(TAG);
  }
  /**
   * @param value
   * @return true if the model contains a statement (this, TAG, value)
   */
  public boolean hasTag( Tag value) {
    return hasValue(TAG, value);
  }

  /**
   * @return true if the model contains a statement (this, TAG, *)
   */
  public boolean hasTag() {
    return hasValue(TAG);
  }

  /**
   * adds a value
   * @param value the value to be added
     * Schema Comment: a tag which has been assigned
   */
  public void addTag( Tag value  ) {
    add(TAG, value );
  }

  /**
   * @return all values
     * Schema Comment: a tag which has been assigned
   */
  public Tag[] getAllTag() {
    return (Tag[]) getAll(TAG, Tag.class);
  }
 

    /**
     * Schema Comment: a (somehow, weak) known person
     * @return the only value. null if none is found
     * @throws RDFDataException, if the property has multiple values
     */
  public Person getKnows() {
    return (Person) get(KNOWS, Person.class);
  }

  /**
   * removes all values and sets this one
   * @param value the value to be set
     * Schema Comment: a (somehow, weak) known person
   */
  public void setKnows( Person value ) {
    set(KNOWS, value);
  }

  /**
   * removes current value(s)
     * Schema Comment: a (somehow, weak) known person
   */
  public void removeKnows() {
    removeAll(KNOWS);
  }
   /**
   * removes a value
   * @param value the value to be removed
     * Schema Comment: a (somehow, weak) known person
   */
  public void removeKnows( Person value  ) {
    remove(KNOWS, value);
  }

  /**
   * removes all values
     * Schema Comment: a (somehow, weak) known person
   */
  public void removeAllKnows() {
    removeAll(KNOWS);
  }
  /**
   * @param value
   * @return true if the model contains a statement (this, KNOWS, value)
   */
  public boolean hasKnows( Person value) {
    return hasValue(KNOWS, value);
  }

  /**
   * @return true if the model contains a statement (this, KNOWS, *)
   */
  public boolean hasKnows() {
    return hasValue(KNOWS);
  }

  /**
   * adds a value
   * @param value the value to be added
     * Schema Comment: a (somehow, weak) known person
   */
  public void addKnows( Person value  ) {
    add(KNOWS, value );
  }

  /**
   * @return all values
     * Schema Comment: a (somehow, weak) known person
   */
  public Person[] getAllKnows() {
    return (Person[]) getAll(KNOWS, Person.class);
  }
  
}

 
 
TOP

Related Classes of org.ontoware.semweb4j.lessons.lesson5.gen.Person

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.