gr.forth.ics.vrp.statistics
Class RDFModelStatistics

java.lang.Object
  extended bygr.forth.ics.vrp.statistics.RDFModelStatistics

public class RDFModelStatistics
extends java.lang.Object

Computes & Reports statistics based on the model & the RDF_DAG for subclass and subproperty hierarchies constructed by VRP.


Field Summary
static int ANCESTOR_DIST
          Constant used to indicate that the the distribution is computed on the ancestors
static int CLASS_HIERARCHY
          Constant used to indicate that the type of a hierarchy is Class Hierarchy.
static int DESCENDANT_DIST
          Constant used to indicate that the the distribution is computed on the descendants
static int PROPERTY_HIERARCHY
          Constant used to indicate that the type of a hierarchy is Property Hierarchy.
 
Constructor Summary
RDFModelStatistics(Model mdl)
           
 
Method Summary
 java.util.HashMap getInstanceDistribution()
          Returns the instances distribution.
 java.util.HashMap instancesPerClass()
          Returns the number of instances of each class
 void printHierarchyStatistics(RDF_DAG rdf_dag, int hierType)
          Prints the statistics either for the class or property hierarchy contained in the RDF_DAG.
 void printInstanceDistribution()
          Prints the number of instances per class
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_HIERARCHY

public static int CLASS_HIERARCHY
Constant used to indicate that the type of a hierarchy is Class Hierarchy.


PROPERTY_HIERARCHY

public static int PROPERTY_HIERARCHY
Constant used to indicate that the type of a hierarchy is Property Hierarchy.


DESCENDANT_DIST

public static int DESCENDANT_DIST
Constant used to indicate that the the distribution is computed on the descendants


ANCESTOR_DIST

public static int ANCESTOR_DIST
Constant used to indicate that the the distribution is computed on the ancestors

Constructor Detail

RDFModelStatistics

public RDFModelStatistics(Model mdl)
Method Detail

instancesPerClass

public java.util.HashMap instancesPerClass()
Returns the number of instances of each class


getInstanceDistribution

public java.util.HashMap getInstanceDistribution()
Returns the instances distribution. More precisely, the first column of the hashmap contains the number of instances and the second column the number of classes having that number of instances


printInstanceDistribution

public void printInstanceDistribution()
Prints the number of instances per class


printHierarchyStatistics

public void printHierarchyStatistics(RDF_DAG rdf_dag,
                                     int hierType)
Prints the statistics either for the class or property hierarchy contained in the RDF_DAG. It prints the average/maximum number of direct subnodes, the average/maximum number of direct supernodes, the average/maximum length of the paths in the hierarchy and the distribution of the ancestors and descendants. More precisely the ancestors/descendants distribution depicts how many nodes have x ancestors/descendants - ancestors/descendants of a node are considered all the nodes found above/below this node in the hierarchy (not only the direct nodes).

Parameters:
rdf_dag - the RDF_DAG that represents the Hierarchy
hierType - if equals to CLASS_HIERARCHY indicates that the rdf_dag contains the class hierarchy otherwise the rdf_dag contains the property hierarchy