de.fuberlin.wiwiss.semmf.taxon
Class Taxonomy

java.lang.Object
  extended by de.fuberlin.wiwiss.semmf.taxon.Taxonomy

public class Taxonomy
extends java.lang.Object

This class represents the hierarchical structure of concepts from a given ontology. The parent-child relationship between concepts must be indicated by the rdfs:subClassOf property !!! RESTRICTION: This class works properly for ontologies, where only BottomConcepts (concepts at the lowest haierarchy level, which do not have any children) are allowed to have multiple parents, e.g. to have more positions in the concept hierarchy.

Version:
1.3 last modified 29.11.2006
Author:
Radoslaw Oldakowski

Field Summary
private  java.util.Map concepts
          A hash map storing all descendants of the root concept in the taxonomy provided to the constructor
 int deepestLevel
          Index of the deepest level (= number of levels - 1)
private  java.lang.String ontURL
          URL of the taxonomy file file
private  java.lang.String rootURI
          URI of the root concept
 
Constructor Summary
Taxonomy(java.lang.String ontURL, java.lang.String rootConceptURI)
          This constructor uses the Jena2 API to read the ontology from an RDF document and create the hierarchy tree.
 
Method Summary
private  void createHierarchyTree(com.hp.hpl.jena.rdf.model.Model model, com.hp.hpl.jena.rdf.model.Resource r, SuperConcept superC, int level)
          Creates the parent-child-relationship among concepts from this taxonomy
 SuperConcept findCCP(SuperConcept c1, SuperConcept c2)
           
 Concept getConcept(java.lang.String conceptURI)
          For a given URI returns the Concept object inside this taxonomy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

concepts

private java.util.Map concepts
A hash map storing all descendants of the root concept in the taxonomy provided to the constructor


ontURL

private java.lang.String ontURL
URL of the taxonomy file file


rootURI

private java.lang.String rootURI
URI of the root concept


deepestLevel

public int deepestLevel
Index of the deepest level (= number of levels - 1)

Constructor Detail

Taxonomy

public Taxonomy(java.lang.String ontURL,
                java.lang.String rootConceptURI)
This constructor uses the Jena2 API to read the ontology from an RDF document and create the hierarchy tree.

Parameters:
ontURL - location of the ontology file
rootConceptURI - URI of the root concept inside the ontology
Method Detail

getConcept

public Concept getConcept(java.lang.String conceptURI)
For a given URI returns the Concept object inside this taxonomy

Parameters:
conceptURI - URI of the concept

findCCP

public SuperConcept findCCP(SuperConcept c1,
                            SuperConcept c2)
Returns:
the closest common parent of two SuperConcepts (concepts which have at least one subConcept)

createHierarchyTree

private void createHierarchyTree(com.hp.hpl.jena.rdf.model.Model model,
                                 com.hp.hpl.jena.rdf.model.Resource r,
                                 SuperConcept superC,
                                 int level)
Creates the parent-child-relationship among concepts from this taxonomy

Parameters:
model - Jena RDF model
r - Jena Resource from this model
superC - SuperConcept of r
level - hierarchy level