de.dfleischhacker.uni.thesis.utils.ontology
Class OntologyRenamer

java.lang.Object
  extended by de.dfleischhacker.uni.thesis.utils.ontology.OntologyRenamer

public class OntologyRenamer
extends java.lang.Object

This class provides methods to rename entities contained in two ontologies. Renaming is done to guarantee unique names across both ontologies.


Constructor Summary
OntologyRenamer(Ontology onto1, Ontology onto2)
          Renames all entities of the given to ontology so that each of these has a unique namespace which guarantees that no name clashes are possible during the merge.
 
Method Summary
 TypeMap getTypeMap()
          Returns the typemap generated by this merger
static boolean isBlacklisted(java.lang.String uri)
          Checks if the given URI is blacklisted for the renaming step either by it's namespace or individually.
static java.net.URI resolveURI(int onto, java.lang.String uri)
          Generates a new unique URI based on the given URI and the given number.
static java.net.URI resolveURI(int onto, java.net.URI uri)
          Generates a new unique URI based on the given URI and the given number.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OntologyRenamer

public OntologyRenamer(Ontology onto1,
                       Ontology onto2)
                throws MergingException
Renames all entities of the given to ontology so that each of these has a unique namespace which guarantees that no name clashes are possible during the merge. Furthermore, it creates a TypeMap containing the types of all entities. This renaming is done in the given ontologies and NOT in copies, so be aware of the side effects

Parameters:
onto1 - ontology 1
onto2 - ontology 2
Throws:
MergingException
Method Detail

getTypeMap

public TypeMap getTypeMap()
Returns the typemap generated by this merger

Returns:
typemap containing entities' types

resolveURI

public static java.net.URI resolveURI(int onto,
                                      java.net.URI uri)
Generates a new unique URI based on the given URI and the given number. The number should be the ontology the corresponding entity is assigned to.

Parameters:
onto - number for ontology
uri - uri to base the new unique URI on
Returns:
unique URI based on the given URI and number

resolveURI

public static java.net.URI resolveURI(int onto,
                                      java.lang.String uri)
Generates a new unique URI based on the given URI and the given number. The number should be the ontology the corresponding entity is assigned to.

Parameters:
onto - number for ontology
uri - uri to base the new unique URI on
Returns:
unique URI based on the given URI and number

isBlacklisted

public static boolean isBlacklisted(java.lang.String uri)
Checks if the given URI is blacklisted for the renaming step either by it's namespace or individually.

Parameters:
uri - URI to check
Returns:
true if blacklisted, otherwise false