de.unidu.is.annotation.rework.ontology.classes.OntologyObjects
Class OntologyIndividual

java.lang.Object
  extended byde.unidu.is.annotation.rework.ontology.classes.OntologyObjects.OntologyIndividual
Direct Known Subclasses:
AnnotationIndividual, DocumentIndividual, MVSelectionIndividual

public class OntologyIndividual
extends java.lang.Object

OntologyIndividual.java Represents an individual in a Jena OntModel

Author:
Marc Lechtenfeld

Field Summary
static java.lang.String ANNOTATIONS_PROPERTY
          Name of the ontology property, which stores annotations
static java.lang.String LINK_PROPERTY
          Name of the ontology property, which stores all linked objects
static java.lang.String NAMESPACE
          Namespace
 com.hp.hpl.jena.ontology.Individual ontIndividual
          Individual
 com.hp.hpl.jena.ontology.OntModel ontModel
          OntModel
static java.lang.String TYPE_URI
          RDF:Type property
 
Constructor Summary
OntologyIndividual()
          Creates a new instance
 
Method Summary
 void addPropertyValue(java.lang.String namespace, java.lang.String propertyName, java.lang.Object value)
          Adds the specified object to the specified property
 void addTypeValue(java.lang.String propertyUri, java.lang.Object value)
          Adds the specified RDF type
 void clearProperties()
          Removes all properties of the individual
 void create(com.hp.hpl.jena.ontology.OntModel model, java.lang.String individualUri)
          Creates a new individual
protected  void create(com.hp.hpl.jena.ontology.OntModel model, java.lang.String individualUri, java.lang.String classUri)
          Creates a new individual (Class classUri)
 void createClassClone(com.hp.hpl.jena.ontology.OntModel model, OntologyIndividual ontologyIndividual)
          Creates a new individual and copies only the RDF types
 void createClone(com.hp.hpl.jena.ontology.OntModel model, OntologyIndividual ontologyIndividual)
          Creates a copy of the specified individual
static java.lang.String getIndividualName(java.lang.String individualUri)
          Returns the local name of the specified URI
 java.lang.String getLocalName()
          Returns the local name of the URI
protected  com.hp.hpl.jena.rdf.model.Property getProperty(java.lang.String namespace, java.lang.String propertyName)
          Returns the property defined by the namespace and the property name
 java.lang.Object getPropertyValue(java.lang.String namespace, java.lang.String propertyName)
          Returns the property value of the specified property (as RDFNode)
 java.util.List getPropertyValues(java.lang.String namespace, java.lang.String propertyName)
          Returns property values of the specified property (as RDFNode)
 java.util.List getTypes()
          Returns RDF types of the individual
 java.lang.String getUri()
          Returns the URI
protected  void init(com.hp.hpl.jena.ontology.OntModel model, java.lang.String individualUri)
          Init ontModel and ontIndividual
 boolean isExisting()
          Returns, if instance is init.
 void load(com.hp.hpl.jena.ontology.OntModel model, java.lang.String individualUri)
          Loads/init the instance with the specified data
 void remove()
          Removes the individual
 void takeProperties(OntologyIndividual individual)
          Copies all properties from the specified individual
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAMESPACE

public static final java.lang.String NAMESPACE
Namespace

See Also:
Constant Field Values

TYPE_URI

public static final java.lang.String TYPE_URI
RDF:Type property

See Also:
Constant Field Values

ANNOTATIONS_PROPERTY

public static final java.lang.String ANNOTATIONS_PROPERTY
Name of the ontology property, which stores annotations

See Also:
Constant Field Values

LINK_PROPERTY

public static final java.lang.String LINK_PROPERTY
Name of the ontology property, which stores all linked objects

See Also:
Constant Field Values

ontIndividual

public com.hp.hpl.jena.ontology.Individual ontIndividual
Individual


ontModel

public com.hp.hpl.jena.ontology.OntModel ontModel
OntModel

Constructor Detail

OntologyIndividual

public OntologyIndividual()
Creates a new instance

Method Detail

init

protected void init(com.hp.hpl.jena.ontology.OntModel model,
                    java.lang.String individualUri)
Init ontModel and ontIndividual

Parameters:
model - Model
individualUri - URI of the individual

isExisting

public boolean isExisting()
Returns, if instance is init.

Returns:
true, if instance is init.

load

public void load(com.hp.hpl.jena.ontology.OntModel model,
                 java.lang.String individualUri)
Loads/init the instance with the specified data

Parameters:
model - Model
individualUri - URI of the individual

create

public void create(com.hp.hpl.jena.ontology.OntModel model,
                   java.lang.String individualUri)
Creates a new individual

Parameters:
model - Model
individualUri - URI of the individual

create

protected void create(com.hp.hpl.jena.ontology.OntModel model,
                      java.lang.String individualUri,
                      java.lang.String classUri)
Creates a new individual (Class classUri)

Parameters:
model - Model
individualUri - URI of the individual
classUri - URI of the class

createClone

public void createClone(com.hp.hpl.jena.ontology.OntModel model,
                        OntologyIndividual ontologyIndividual)
Creates a copy of the specified individual

Parameters:
model - Model
ontologyIndividual - Individual

createClassClone

public void createClassClone(com.hp.hpl.jena.ontology.OntModel model,
                             OntologyIndividual ontologyIndividual)
Creates a new individual and copies only the RDF types

Parameters:
model - Model
ontologyIndividual - Individual

getUri

public java.lang.String getUri()
Returns the URI

Returns:

getLocalName

public java.lang.String getLocalName()
Returns the local name of the URI

Returns:
local name of the URI

getTypes

public java.util.List getTypes()
Returns RDF types of the individual

Returns:
RDF types

addTypeValue

public void addTypeValue(java.lang.String propertyUri,
                         java.lang.Object value)
Adds the specified RDF type

Parameters:
propertyUri - URI of the Property
value - RDF type (ResourceImpl)

clearProperties

public void clearProperties()
Removes all properties of the individual


getProperty

protected com.hp.hpl.jena.rdf.model.Property getProperty(java.lang.String namespace,
                                                         java.lang.String propertyName)
Returns the property defined by the namespace and the property name

Parameters:
namespace - Namespace of the property
propertyName - Property name
Returns:
Property (namespace+propertyname)

getPropertyValue

public java.lang.Object getPropertyValue(java.lang.String namespace,
                                         java.lang.String propertyName)
Returns the property value of the specified property (as RDFNode)

Parameters:
namespace - Namespace
propertyName - Property name
Returns:
Property value (as RDFNode)

getPropertyValues

public java.util.List getPropertyValues(java.lang.String namespace,
                                        java.lang.String propertyName)
Returns property values of the specified property (as RDFNode)

Parameters:
namespace - Namespace
propertyName - Property name
Returns:
Property values (as RDFNode list)

takeProperties

public void takeProperties(OntologyIndividual individual)
Copies all properties from the specified individual

Parameters:
individual - Individual to copy

addPropertyValue

public void addPropertyValue(java.lang.String namespace,
                             java.lang.String propertyName,
                             java.lang.Object value)
Adds the specified object to the specified property

Parameters:
namespace - Namespace of the property
propertyName - Property name
value - Object to add

remove

public void remove()
Removes the individual


getIndividualName

public static java.lang.String getIndividualName(java.lang.String individualUri)
Returns the local name of the specified URI