Alignment API and Server 4.6 (1875M)

fr.inrialpes.exmo.align.gen.alt
Class BasicAlterator

java.lang.Object
  extended by fr.inrialpes.exmo.align.gen.alt.BasicAlterator
All Implemented Interfaces:
Alterator
Direct Known Subclasses:
AddClasses, AddClassLevel, AddProperties, EmptyModification, FlattenLevel, RemoveClasses, RemoveClassLevel, RemoveComments, RemoveIndividuals, RemoveProperties, RemoveRestrictions, RenameThings, SuppressHierarchy

public abstract class BasicAlterator
extends Object
implements Alterator


Field Summary
protected  Properties alignment
           
protected  ClassHierarchy classHierarchy
           
protected  Alignment extractedAlignment
           
protected  String initOntologyNS
           
(package private) static org.slf4j.Logger logger
           
protected  com.hp.hpl.jena.ontology.OntModel modifiedModel
           
protected  String modifiedOntologyNS
           
 
Constructor Summary
BasicAlterator()
           
BasicAlterator(Alterator om)
           
 
Method Summary
 com.hp.hpl.jena.ontology.OntClass addClass(com.hp.hpl.jena.ontology.OntClass parentClass, String name)
           
 void buildClassHierarchy()
           
 com.hp.hpl.jena.ontology.OntModel changeDomainRange(HashMap<String,String> uris)
           
 com.hp.hpl.jena.ontology.OntModel changeNamespace(String ns)
          Modifies the namespace of the generated ontology This is the initial implementation.
 com.hp.hpl.jena.ontology.OntModel changeNamespace2(String base2)
          JE: starting an attempt to do the relocation through String reading and writing: The ideal case is that in the generated files, the namespace appears exactly twice: in xmlns and in xml:base.
 void checkClassesRestrictions(com.hp.hpl.jena.ontology.OntClass childClass, com.hp.hpl.jena.ontology.OntClass parentClass)
           
 Alignment extractAlignment(String base1, String base2)
           
 Alignment getAlignment()
          Returns the altered Alignment and Ontology in output form
 String getBase()
          the namespace of the source ontology in the input alignment
 ClassHierarchy getHierarchy()
           
static String getLocalName(String uri)
           
 com.hp.hpl.jena.ontology.OntModel getModifiedModel()
           
 com.hp.hpl.jena.ontology.OntModel getModifiedOntology()
           
 String getNamespace()
          the namespace of the input ontology
static String getNameSpace(String uri)
           
 List<com.hp.hpl.jena.ontology.OntClass> getOntologyClasses()
           
 List<com.hp.hpl.jena.ontology.OntProperty> getOntologyProperties()
           
 Properties getProtoAlignment()
          getProtoAlignment, getProtoOntology, getHierarchy are used for accessing these internal structure at creation time.
 com.hp.hpl.jena.ontology.OntModel getProtoOntology()
           
 String getRandomString()
           
protected  void initModel(Alterator om)
           
abstract  Alterator modify(Properties params)
          modify applies the alteration to the input (the results are kept in internal structures.
 int[] randNumbers(int count, int numElems)
           
 void relocateTest(String namespaceNew)
          Generates an Alignment from the property list hosting the alignment.
 void relocateTest(String base1, String base2)
          Modifies the namespaces of source and target ontologies (for the main purpose of outputing them)
 String removeClass(com.hp.hpl.jena.ontology.OntClass cls)
           
 void renameOntology(com.hp.hpl.jena.ontology.OntModel model, String oldURI, String newURI)
          Rename the ontology, just in case it does not have the same URI as its content...
 void setModifiedModel(com.hp.hpl.jena.ontology.OntModel model)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

static final org.slf4j.Logger logger

classHierarchy

protected ClassHierarchy classHierarchy

modifiedModel

protected com.hp.hpl.jena.ontology.OntModel modifiedModel

alignment

protected Properties alignment

extractedAlignment

protected Alignment extractedAlignment

modifiedOntologyNS

protected String modifiedOntologyNS

initOntologyNS

protected String initOntologyNS
Constructor Detail

BasicAlterator

public BasicAlterator()

BasicAlterator

public BasicAlterator(Alterator om)
Method Detail

initModel

protected void initModel(Alterator om)

modify

public abstract Alterator modify(Properties params)
Description copied from interface: Alterator
modify applies the alteration to the input (the results are kept in internal structures.

Specified by:
modify in interface Alterator

getModifiedOntology

public com.hp.hpl.jena.ontology.OntModel getModifiedOntology()
Specified by:
getModifiedOntology in interface Alterator

setModifiedModel

public void setModifiedModel(com.hp.hpl.jena.ontology.OntModel model)

getModifiedModel

public com.hp.hpl.jena.ontology.OntModel getModifiedModel()

getHierarchy

public ClassHierarchy getHierarchy()
Specified by:
getHierarchy in interface Alterator

getProtoAlignment

public Properties getProtoAlignment()
Description copied from interface: Alterator
getProtoAlignment, getProtoOntology, getHierarchy are used for accessing these internal structure at creation time.

Specified by:
getProtoAlignment in interface Alterator

getProtoOntology

public com.hp.hpl.jena.ontology.OntModel getProtoOntology()
Specified by:
getProtoOntology in interface Alterator

getNamespace

public String getNamespace()
Description copied from interface: Alterator
the namespace of the input ontology

Specified by:
getNamespace in interface Alterator

getBase

public String getBase()
Description copied from interface: Alterator
the namespace of the source ontology in the input alignment

Specified by:
getBase in interface Alterator

getLocalName

public static String getLocalName(String uri)

getNameSpace

public static String getNameSpace(String uri)

getRandomString

public String getRandomString()

randNumbers

public int[] randNumbers(int count,
                         int numElems)

buildClassHierarchy

public void buildClassHierarchy()

getOntologyClasses

public List<com.hp.hpl.jena.ontology.OntClass> getOntologyClasses()

getOntologyProperties

public List<com.hp.hpl.jena.ontology.OntProperty> getOntologyProperties()

addClass

public com.hp.hpl.jena.ontology.OntClass addClass(com.hp.hpl.jena.ontology.OntClass parentClass,
                                                  String name)

changeDomainRange

public com.hp.hpl.jena.ontology.OntModel changeDomainRange(HashMap<String,String> uris)

checkClassesRestrictions

public void checkClassesRestrictions(com.hp.hpl.jena.ontology.OntClass childClass,
                                     com.hp.hpl.jena.ontology.OntClass parentClass)

removeClass

public String removeClass(com.hp.hpl.jena.ontology.OntClass cls)

getAlignment

public Alignment getAlignment()
Description copied from interface: Alterator
Returns the altered Alignment and Ontology in output form

Specified by:
getAlignment in interface Alterator

relocateTest

public void relocateTest(String namespaceNew)
Generates an Alignment from the property list hosting the alignment. On the fly rename the matched entities from the base1 (source) and base2 (target) namespaces. The property list is also modified for reflecting the renaming of entities. This is useful when the property list is reused when generating TestSets.

Specified by:
relocateTest in interface Alterator

relocateTest

public void relocateTest(String base1,
                         String base2)
Description copied from interface: Alterator
Modifies the namespaces of source and target ontologies (for the main purpose of outputing them)

Specified by:
relocateTest in interface Alterator

extractAlignment

public Alignment extractAlignment(String base1,
                                  String base2)

changeNamespace

public com.hp.hpl.jena.ontology.OntModel changeNamespace(String ns)
Modifies the namespace of the generated ontology This is the initial implementation. However... it has some problem with Jena treating fragments (containing numbers and / in them).


changeNamespace2

public com.hp.hpl.jena.ontology.OntModel changeNamespace2(String base2)
JE: starting an attempt to do the relocation through String reading and writing: The ideal case is that in the generated files, the namespace appears exactly twice: in xmlns and in xml:base. But it depends on the actual seed. Two versions would be possible: OntModel.write( OutputStream out ) / OntModel.write( Writer writer ) new Model().read( InputStream in, String base ) / new Model().read(Reader reader, String base) So far this is less efficient (and less elegant) than the modifications above


renameOntology

public void renameOntology(com.hp.hpl.jena.ontology.OntModel model,
                           String oldURI,
                           String newURI)
Rename the ontology, just in case it does not have the same URI as its content... This happens oldURI should be useless


Alignment API and Server 4.6 (1875M)

(C) INRIA & friends, 2003-2014