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

java.lang.Object
  extended byde.unidu.is.annotation.rework.ontology.classes.OntologyObjects.OntologyIndividual
      extended byde.unidu.is.annotation.rework.ontology.classes.OntologyObjects.AnnotationIndividual

public class AnnotationIndividual
extends OntologyIndividual

AnnotationIndividual.java Represents an annotation individual in a Jena OntModel

Author:
Marc Lechtenfeld

Field Summary
static java.lang.String ANNOTATION_CLASS
          Name of the ontology class for annotations
static java.lang.String CREATION_TIME_PROPERTY
          Name of the ontology property, which stores the creation time of the annotation
static java.lang.String CREATOR_PROPERTY
          Name of the ontology property, which stores the author of an annotation
static java.lang.String LINK_PROPERTY
          Name of the ontology property, which stores links of an annotation
static java.lang.String SELECTION_PROPERTY
          Name of the ontology property, which stores the selection
static java.lang.String SOURCE_PROPERTY
          Name of the ontology property, that stores the object, which is annotated
static java.lang.String TARGET_PROPERTY
          Name of the ontology property, which stores the target of an annotation
static java.lang.String TEXT_PROPERTY
          Name of the ontology property, which stores the text of an annotation
static java.lang.String TITLE_PROPERTY
          Name of the ontology property, which stores the title of an annotation
static java.lang.String WEIGHT_PROPERTY
          Name of the ontology property, which stores the weight of the annotation
 
Fields inherited from class de.unidu.is.annotation.rework.ontology.classes.OntologyObjects.OntologyIndividual
ANNOTATIONS_PROPERTY, NAMESPACE, ontIndividual, ontModel, TYPE_URI
 
Constructor Summary
AnnotationIndividual()
          Creates a new instance
 
Method Summary
 void clearProperties()
          Removes all property values
 void create(com.hp.hpl.jena.ontology.OntModel model, java.lang.String individualUri)
          Creates a new annotation individual with the specified URI
 void createClone(com.hp.hpl.jena.ontology.OntModel model, AnnotationIndividual annotationIndividual)
          Creates a new annotation with the same properties as the specified individual
protected  void createOntologyTypes(com.hp.hpl.jena.ontology.OntModel sourceModel, java.util.List annotationTypes)
          Creates the specified classes and all superclasses
 java.util.List getAnnotationTypes()
          Returns the annotation types of the annotation
 long getCreationTime()
          Returns the creation time in milliseconds
 java.lang.String getCreator()
          Returns the URI of the creator of the annotation
 java.lang.String getSelection()
          Resturns the Uri of the selection individual
 java.lang.String getSource()
          Returns the URI of the source of the annotation
 java.util.List getTargets()
          Returns the targets of the annotation (as RDFNode instances!)
 java.lang.String getText()
          Returns the text of the linked document
 java.lang.String getTitle()
          Returns the title of the annotation
 double getWeight()
          Returns the weight
 boolean hasAnnotations()
          Returns, if the annotations has got further annotations
 boolean hasPermissionToModify(java.lang.String userUri)
          The user has got the permission to modify/remove an annotation, if the annotation is created by the specified user and the annotation has got no childs.
 void remove()
          Removes the annotation individual
 void setAnnotationTypes(java.util.List annotationTypes)
          Sets the annotation types of the annotation
 void setCreationTime(long milliseconds)
          Sets the creation time
 void setCreator(java.lang.String personUri)
          Sets the creator of the annotation
 void setSelection(java.lang.String selectionUri)
          Sets the URI of the selection individual
 void setSource(java.lang.String ontologyClassName, java.lang.String sourceUri)
          Sets the source of the annotation
 void setTargets(java.util.List targetURIs)
          Sets the targets of the annotation
 void setText(java.lang.String text)
          Creates a document instance, adds the specified text and adds the document to the annotation
 void setTitle(java.lang.String title)
          Sets the title of the annotation
 void setWeight(double weight)
          Sets the weight
 void takeProperties(AnnotationIndividual annotationIndividual)
          Copies all properties from the specified annotation
 void update(AnnotationIndividual updatedAnnotation)
          Overwrite all propery values with the properties of the specified anntation individual
 
Methods inherited from class de.unidu.is.annotation.rework.ontology.classes.OntologyObjects.OntologyIndividual
addPropertyValue, addTypeValue, create, createClassClone, createClone, getIndividualName, getLocalName, getProperty, getPropertyValue, getPropertyValues, getTypes, getUri, init, isExisting, load, takeProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ANNOTATION_CLASS

public static final java.lang.String ANNOTATION_CLASS
Name of the ontology class for annotations

See Also:
Constant Field Values

SOURCE_PROPERTY

public static final java.lang.String SOURCE_PROPERTY
Name of the ontology property, that stores the object, which is annotated

See Also:
Constant Field Values

CREATOR_PROPERTY

public static final java.lang.String CREATOR_PROPERTY
Name of the ontology property, which stores the author of an annotation

See Also:
Constant Field Values

TITLE_PROPERTY

public static final java.lang.String TITLE_PROPERTY
Name of the ontology property, which stores the title of an annotation

See Also:
Constant Field Values

TEXT_PROPERTY

public static final java.lang.String TEXT_PROPERTY
Name of the ontology property, which stores the text of an annotation

See Also:
Constant Field Values

SELECTION_PROPERTY

public static final java.lang.String SELECTION_PROPERTY
Name of the ontology property, which stores the selection

See Also:
Constant Field Values

TARGET_PROPERTY

public static final java.lang.String TARGET_PROPERTY
Name of the ontology property, which stores the target of an annotation

See Also:
Constant Field Values

LINK_PROPERTY

public static final java.lang.String LINK_PROPERTY
Name of the ontology property, which stores links of an annotation

See Also:
Constant Field Values

CREATION_TIME_PROPERTY

public static final java.lang.String CREATION_TIME_PROPERTY
Name of the ontology property, which stores the creation time of the annotation

See Also:
Constant Field Values

WEIGHT_PROPERTY

public static final java.lang.String WEIGHT_PROPERTY
Name of the ontology property, which stores the weight of the annotation

See Also:
Constant Field Values
Constructor Detail

AnnotationIndividual

public AnnotationIndividual()
Creates a new instance

Method Detail

create

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

Overrides:
create in class OntologyIndividual
Parameters:
model - Model
individualUri - URI of the new annotation individual

createClone

public void createClone(com.hp.hpl.jena.ontology.OntModel model,
                        AnnotationIndividual annotationIndividual)
Creates a new annotation with the same properties as the specified individual

Parameters:
model - Model
annotationIndividual - Annotation individual to copy

createOntologyTypes

protected void createOntologyTypes(com.hp.hpl.jena.ontology.OntModel sourceModel,
                                   java.util.List annotationTypes)
Creates the specified classes and all superclasses

Parameters:
sourceModel - Source model

takeProperties

public void takeProperties(AnnotationIndividual annotationIndividual)
Copies all properties from the specified annotation

Parameters:
annotationIndividual - Annotation individual to copy

clearProperties

public void clearProperties()
Removes all property values

Overrides:
clearProperties in class OntologyIndividual

update

public void update(AnnotationIndividual updatedAnnotation)
Overwrite all propery values with the properties of the specified anntation individual

Parameters:
updatedAnnotation - Updated annotation individual

remove

public void remove()
Removes the annotation individual

Overrides:
remove in class OntologyIndividual

setCreator

public void setCreator(java.lang.String personUri)
Sets the creator of the annotation

Parameters:
personUri - URI of the creator

getCreator

public java.lang.String getCreator()
Returns the URI of the creator of the annotation

Returns:
URI of the creator

getSelection

public java.lang.String getSelection()
Resturns the Uri of the selection individual

Returns:
Uri of the selection individual

setAnnotationTypes

public void setAnnotationTypes(java.util.List annotationTypes)
Sets the annotation types of the annotation

Parameters:
annotationTypes - annotation type (without namespace)

getAnnotationTypes

public java.util.List getAnnotationTypes()
Returns the annotation types of the annotation

Returns:
List of annotation types (local names)

setTitle

public void setTitle(java.lang.String title)
Sets the title of the annotation

Parameters:
title - Title of the annotation

getTitle

public java.lang.String getTitle()
Returns the title of the annotation

Returns:
Title of the annotation

setText

public void setText(java.lang.String text)
Creates a document instance, adds the specified text and adds the document to the annotation

Parameters:
text - Document text

getText

public java.lang.String getText()
Returns the text of the linked document

Returns:
Text

setSelection

public void setSelection(java.lang.String selectionUri)
Sets the URI of the selection individual

Parameters:
selectionUri - Uri of the selection individual

setSource

public void setSource(java.lang.String ontologyClassName,
                      java.lang.String sourceUri)
Sets the source of the annotation

Parameters:
ontologyClassName - Ontology class name of the ontology
sourceUri - URI of the source of the annotation

getSource

public java.lang.String getSource()
Returns the URI of the source of the annotation

Returns:
URI of the source

setTargets

public void setTargets(java.util.List targetURIs)
Sets the targets of the annotation

Parameters:
targetURIs - URIs of the targets

getTargets

public java.util.List getTargets()
Returns the targets of the annotation (as RDFNode instances!)

Returns:
RDFNode instances (targets)

setCreationTime

public void setCreationTime(long milliseconds)
Sets the creation time

Parameters:
milliseconds - Time in milliseconds

getCreationTime

public long getCreationTime()
Returns the creation time in milliseconds

Returns:
Creation time

setWeight

public void setWeight(double weight)
Sets the weight

Parameters:
weight - Weight

getWeight

public double getWeight()
Returns the weight

Returns:
Weight

hasAnnotations

public boolean hasAnnotations()
Returns, if the annotations has got further annotations

Returns:
true, if the annotation has got annotations

hasPermissionToModify

public boolean hasPermissionToModify(java.lang.String userUri)
                              throws ModelException,
                                     ResourceNotFoundException,
                                     NoPermissionException
The user has got the permission to modify/remove an annotation, if the annotation is created by the specified user and the annotation has got no childs.

Parameters:
userUri - URI of the user
Returns:
true, if the user has got the permission
Throws:
ModelException
ResourceNotFoundException
NoPermissionException