gr.forth.ics.rdfsuite.swkm.model.impl
Class RDF_Schema_Resource<TYPE extends IRDF_Schema_Resource,TRIPLE extends IRDF_Subsumption>

java.lang.Object
  extended by gr.forth.ics.rdfsuite.swkm.model.impl.RDF_Resource
      extended by gr.forth.ics.rdfsuite.swkm.model.impl.RDF_Schema_Resource<TYPE,TRIPLE>
All Implemented Interfaces:
Identifiable, IRDF_Resource, IRDF_Schema_Resource<TYPE,TRIPLE>, java.lang.Comparable
Direct Known Subclasses:
RDF_Class, RDF_Property

public abstract class RDF_Schema_Resource<TYPE extends IRDF_Schema_Resource,TRIPLE extends IRDF_Subsumption>
extends RDF_Resource
implements IRDF_Schema_Resource<TYPE,TRIPLE>, java.lang.Comparable


Field Summary
protected  java.util.TreeSet<IntervalLabel> direct_propagated_labels
           
protected  java.util.TreeSet<IntervalLabel> indirect_propagated_labels
           
protected  java.util.HashSet<IntervalLabel> propLabelsToBeAdded
           
protected  java.util.HashSet<IntervalLabel> propLabelsToBeRemoved
           
protected  IntervalLabel tree_label
           
 
Fields inherited from class gr.forth.ics.rdfsuite.swkm.model.impl.RDF_Resource
column, comments, isDefinedBys, labels, line, local_name, log, namespace, seeAlsos, types, uri
 
Constructor Summary
RDF_Schema_Resource(java.lang.String uri, IRDF_Namespace namespace)
           
 
Method Summary
 void addDirectPropagatedLabel(IntervalLabel newLabel)
           
 void addDirectPropagatedLabels(java.util.TreeSet<IntervalLabel> newLabels)
          Adds a set of propagated labels to the resource's collection of propagated labels.
 void addIndirectPropagatedLabel(IntervalLabel newLabel)
           
 void addIndirectPropagatedLabels(java.util.TreeSet<IntervalLabel> newLabels)
          Not needed Adds a set of propagated labels to the resource's collection of propagated labels.
 int compareTo(java.lang.Object other)
           
 boolean contains(IntervalLabel interval)
           
 java.util.Collection<TYPE> getAncestors()
           
 java.util.Collection<TYPE> getDescendants()
           
 java.util.Collection<TYPE> getDirectAncestors()
           
 java.util.Collection<TYPE> getDirectDescendants()
           
 java.util.TreeSet<IntervalLabel> getDirectPropagatedLabels()
          Retrieves the propagated labels of this resource
 boolean getHasUnstoredLabels()
          This methods opines whether this schema resource has unstored labels that need to be stored regardless of if the resource is already stored or not
 java.util.TreeSet<IntervalLabel> getIndirectPropagatedLabels()
          Retrieves the propagated labels of this resource
protected abstract  java.util.Collection<? extends IRDF_Subsumption> getSubsumptionTriples(boolean upward)
           
 IntervalLabel getTree_label()
           
 void printLabels()
           
 void setDirectPropagatedLabels(java.util.TreeSet<IntervalLabel> labels)
          Sets the resource's proppagated labels.
 void setHasUnstoredLabels(boolean hasUnstoredLabels)
          This method sets whether the schema resource has propagated labels that are not already stored
 void setIndirectPropagatedLabels(java.util.TreeSet<IntervalLabel> labels)
          Sets the resource's proppagated labels.
 void setTree_label(IntervalLabel tree_label)
          Sets the tree label of this resource
 void updateIndirectPropagatedLabel(IntervalLabel oldLabel, IntervalLabel newLabel)
           
 
Methods inherited from class gr.forth.ics.rdfsuite.swkm.model.impl.RDF_Resource
getAllTypes, getColumn, getComments, getCommentsTriples, getIsDefinedBys, getIsDefinedBysTriples, getLabels, getLabelsTriples, getLine, getLocalName, getNamespace, getNamespacePart, getSeeAlsos, getSeeAlsosTriples, getTypes, getTypesTriples, getURI, hasTypeOf, setColumn, setLine, setLocalName, setNamespace, setURI, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gr.forth.ics.rdfsuite.swkm.model.IRDF_Schema_Resource
isAncestorOf, isDescendantOf
 
Methods inherited from interface gr.forth.ics.rdfsuite.swkm.model.IRDF_Resource
getAllTypes, getColumn, getComments, getCommentsTriples, getIsDefinedBys, getIsDefinedBysTriples, getLabels, getLabelsTriples, getLine, getLocalName, getNamespace, getNamespacePart, getSeeAlsos, getSeeAlsosTriples, getTypes, getTypesTriples, getURI, hasTypeOf, setColumn, setLine, setLocalName, setNamespace, setURI, toString
 

Field Detail

direct_propagated_labels

protected java.util.TreeSet<IntervalLabel> direct_propagated_labels

indirect_propagated_labels

protected java.util.TreeSet<IntervalLabel> indirect_propagated_labels

tree_label

protected IntervalLabel tree_label

propLabelsToBeAdded

protected java.util.HashSet<IntervalLabel> propLabelsToBeAdded

propLabelsToBeRemoved

protected java.util.HashSet<IntervalLabel> propLabelsToBeRemoved
Constructor Detail

RDF_Schema_Resource

public RDF_Schema_Resource(java.lang.String uri,
                           IRDF_Namespace namespace)
Method Detail

setTree_label

public void setTree_label(IntervalLabel tree_label)
Sets the tree label of this resource

Specified by:
setTree_label in interface IRDF_Schema_Resource<TYPE extends IRDF_Schema_Resource,TRIPLE extends IRDF_Subsumption>
Parameters:
tree_label - An IntervalLabel object

getDirectPropagatedLabels

public java.util.TreeSet<IntervalLabel> getDirectPropagatedLabels()
Retrieves the propagated labels of this resource

Specified by:
getDirectPropagatedLabels in interface IRDF_Schema_Resource<TYPE extends IRDF_Schema_Resource,TRIPLE extends IRDF_Subsumption>
Returns:
A TreeSet object

setDirectPropagatedLabels

public void setDirectPropagatedLabels(java.util.TreeSet<IntervalLabel> labels)
Sets the resource's proppagated labels. Compresses labels if it is possible.

Specified by:
setDirectPropagatedLabels in interface IRDF_Schema_Resource<TYPE extends IRDF_Schema_Resource,TRIPLE extends IRDF_Subsumption>
Parameters:
label - An Collection object

addDirectPropagatedLabels

public void addDirectPropagatedLabels(java.util.TreeSet<IntervalLabel> newLabels)
Adds a set of propagated labels to the resource's collection of propagated labels. If some of the new nodes can be absorbed or compressed, they are. This method should be called once after a modification of a hierarchy. During a hierarchy modification, there might be several labels that should be propagated to the node. These should be all collected in one set and passed as argument to this method. newLabels should be the set of all new labels that should be propagated to the node

Specified by:
addDirectPropagatedLabels in interface IRDF_Schema_Resource<TYPE extends IRDF_Schema_Resource,TRIPLE extends IRDF_Subsumption>
Parameters:
newLabels - the set of labels that shoud be propagated

getIndirectPropagatedLabels

public java.util.TreeSet<IntervalLabel> getIndirectPropagatedLabels()
Retrieves the propagated labels of this resource

Specified by:
getIndirectPropagatedLabels in interface IRDF_Schema_Resource<TYPE extends IRDF_Schema_Resource,TRIPLE extends IRDF_Subsumption>
Returns:
A TreeSet object

setIndirectPropagatedLabels

public void setIndirectPropagatedLabels(java.util.TreeSet<IntervalLabel> labels)
Sets the resource's proppagated labels. Compresses labels if it is possible.

Specified by:
setIndirectPropagatedLabels in interface IRDF_Schema_Resource<TYPE extends IRDF_Schema_Resource,TRIPLE extends IRDF_Subsumption>
Parameters:
label - An Collection object

addIndirectPropagatedLabels

public void addIndirectPropagatedLabels(java.util.TreeSet<IntervalLabel> newLabels)
Not needed Adds a set of propagated labels to the resource's collection of propagated labels. If some of the new nodes can be absorbed or compressed, they are. This method should be called once after a modification of a hierarchy. During a hierarchy modification, there might be several labels that should be propagated to the node. These should be all collected in one set and passed as argument to this method. newLabels should be the set of all new labels that should be propagated to the node

Specified by:
addIndirectPropagatedLabels in interface IRDF_Schema_Resource<TYPE extends IRDF_Schema_Resource,TRIPLE extends IRDF_Subsumption>
Parameters:
newLabels - the set of labels that shoud be propagated

addIndirectPropagatedLabel

public void addIndirectPropagatedLabel(IntervalLabel newLabel)
Specified by:
addIndirectPropagatedLabel in interface IRDF_Schema_Resource<TYPE extends IRDF_Schema_Resource,TRIPLE extends IRDF_Subsumption>

addDirectPropagatedLabel

public void addDirectPropagatedLabel(IntervalLabel newLabel)
Specified by:
addDirectPropagatedLabel in interface IRDF_Schema_Resource<TYPE extends IRDF_Schema_Resource,TRIPLE extends IRDF_Subsumption>

updateIndirectPropagatedLabel

public void updateIndirectPropagatedLabel(IntervalLabel oldLabel,
                                          IntervalLabel newLabel)
Specified by:
updateIndirectPropagatedLabel in interface IRDF_Schema_Resource<TYPE extends IRDF_Schema_Resource,TRIPLE extends IRDF_Subsumption>

contains

public boolean contains(IntervalLabel interval)
Specified by:
contains in interface IRDF_Schema_Resource<TYPE extends IRDF_Schema_Resource,TRIPLE extends IRDF_Subsumption>
Returns:
true, if the given interval is contained in one of the resource's interval, false otherwise

getTree_label

public IntervalLabel getTree_label()
Specified by:
getTree_label in interface IRDF_Schema_Resource<TYPE extends IRDF_Schema_Resource,TRIPLE extends IRDF_Subsumption>
Returns:
An IntervalLabel object representing the tree label of this resource

getSubsumptionTriples

protected abstract java.util.Collection<? extends IRDF_Subsumption> getSubsumptionTriples(boolean upward)

getDirectDescendants

public java.util.Collection<TYPE> getDirectDescendants()
Specified by:
getDirectDescendants in interface IRDF_Schema_Resource<TYPE extends IRDF_Schema_Resource,TRIPLE extends IRDF_Subsumption>
Returns:
a collection of the children (direct descendants) of this node

getDirectAncestors

public java.util.Collection<TYPE> getDirectAncestors()
Specified by:
getDirectAncestors in interface IRDF_Schema_Resource<TYPE extends IRDF_Schema_Resource,TRIPLE extends IRDF_Subsumption>
Returns:
a collection of the fathers (direct ancestors) of this node

getDescendants

public java.util.Collection<TYPE> getDescendants()
Specified by:
getDescendants in interface IRDF_Schema_Resource<TYPE extends IRDF_Schema_Resource,TRIPLE extends IRDF_Subsumption>
Returns:
The descendants of this schema resource. The result does not contain the resource itself

getAncestors

public java.util.Collection<TYPE> getAncestors()
Specified by:
getAncestors in interface IRDF_Schema_Resource<TYPE extends IRDF_Schema_Resource,TRIPLE extends IRDF_Subsumption>
Returns:
The Ancestors of this schema resource. The result does not contain the resource itself

compareTo

public int compareTo(java.lang.Object other)
Specified by:
compareTo in interface java.lang.Comparable

printLabels

public void printLabels()

getHasUnstoredLabels

public boolean getHasUnstoredLabels()
This methods opines whether this schema resource has unstored labels that need to be stored regardless of if the resource is already stored or not

Specified by:
getHasUnstoredLabels in interface IRDF_Schema_Resource<TYPE extends IRDF_Schema_Resource,TRIPLE extends IRDF_Subsumption>
Returns:

setHasUnstoredLabels

public void setHasUnstoredLabels(boolean hasUnstoredLabels)
This method sets whether the schema resource has propagated labels that are not already stored

Specified by:
setHasUnstoredLabels in interface IRDF_Schema_Resource<TYPE extends IRDF_Schema_Resource,TRIPLE extends IRDF_Subsumption>
Parameters:
hasUnstoredLabels -