Mentions légales du service

Skip to content
Snippets Groups Projects
Commit ae36cffe authored by Jérôme Euzenat's avatar Jérôme Euzenat
Browse files

- Make ontowrap interfaces even more able to raise exceptions

parent 81721c6f
No related branches found
No related tags found
No related merge requests found
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
<h2>Plan for release 5 (you can comment)</h2> <h2>Plan for release 5 (you can comment)</h2>
<p> <p>
The next major release, release 5, is now in sight due to various The next major release, release 5, is under design progressively under
constraints and needs that have arousen in the past months. Here are version 4. Here are
the main ruptures that will appear: the main ruptures that will appear:
<ul compact="1"> <ul compact="1">
<li>The use of Java 1.5 parametrization facilities for refining the <li>The use of Java 1.5 parametrization facilities for refining the
...@@ -31,13 +31,12 @@ Other less radical changes include: ...@@ -31,13 +31,12 @@ Other less radical changes include:
<ul compact="1"> <ul compact="1">
<li>Implementation of <tt>Relation</tt> and <tt>Confidence</tt> interfaces </li> <li>Implementation of <tt>Relation</tt> and <tt>Confidence</tt> interfaces </li>
</ul> </ul>
The development and maintainance of 4 versions continue. The development of 4 versions continue.
</p> </p>
<h2>Under development (you can contribute)</h2> <h2>Under development (you can contribute)</h2>
<p><ul compact="1"> <p><ul compact="1">
<li>Integration of SKOS API (ontowrap)</li>
<li>Implement full OWL rendering of EDOAL (impl)</li> <li>Implement full OWL rendering of EDOAL (impl)</li>
<li>Adding type checking to EDOAL parser (parser)</li> <li>Adding type checking to EDOAL parser (parser)</li>
<li>Implement fully relaxed precision and recall (impl)</li> <li>Implement fully relaxed precision and recall (impl)</li>
...@@ -46,8 +45,7 @@ The development and maintainance of 4 versions continue. ...@@ -46,8 +45,7 @@ The development and maintainance of 4 versions continue.
<li>Complete tutorial4 with distributed reasoning.</li> <li>Complete tutorial4 with distributed reasoning.</li>
<li>Genericize evaluators in <tt>GraphEvaluator</tt> and <tt>GenPlot</tt> (eval)</li> <li>Genericize evaluators in <tt>GraphEvaluator</tt> and <tt>GenPlot</tt> (eval)</li>
<li>Implementation of a provenance metadata tag (server/impl)</li> <li>Implementation of a provenance metadata tag (server/impl)</li>
<li>Providing a <tt>DiffAlign( al1, al2 )</tt> operation and interface <li>Providing a <tt>DiffAlign( al1, al2 )</tt> evaluator (impl) and interface (util)</li>
(util)</li>
<li>Replace <tt>DistanceAlignment</tt> with a version more in line <li>Replace <tt>DistanceAlignment</tt> with a version more in line
with OntoSim (impl)</tt> with OntoSim (impl)</tt>
<li>Improve HTML interface layout and usability (server)</li> <li>Improve HTML interface layout and usability (server)</li>
...@@ -67,11 +65,16 @@ The development and maintainance of 4 versions continue. ...@@ -67,11 +65,16 @@ The development and maintainance of 4 versions continue.
<!--h2>Version 4.1 (1xxx): xx/09/2009 - Tring</h2--> <!--h2>Version 4.1 (1xxx): xx/09/2009 - Tring</h2-->
<p><ul compact="1"> <p><ul compact="1">
<li>Integration of SKOS API (ontowrap)</li>
<li>Extended ontowrap so that all methods can raise exceptions (ontowrap)</li>
<li>Added a <tt>getResult()</tt> method to <tt>Evaluator</tt> (api)</li> <li>Added a <tt>getResult()</tt> method to <tt>Evaluator</tt> (api)</li>
<li>Implemented online evaluation (server)</li> <li>Implemented online evaluation (server)</li>
<!--li>Implemented transformations in EDOAL (edoal)</li--> <!--li>Implemented transformations in EDOAL (edoal)</li-->
<li><tt>edoal:or</tt>, <tt>edoal:and</tt> and <tt>edoal:compose</tt>
can be empty (edoal)</li>
<li>Upgraded to <span style="color: green">Pellet 2.1</span> (lib)</li> <li>Upgraded to <span style="color: green">Pellet 2.1</span> (lib)</li>
<li>Added tutorial 4 Pellet action (tutorial)</li> <li>Added <a href="tutorial/tutorial4/index.html">tutorial 4</a> Pellet action (tutorial)</li>
<li>Added <a href="tutorial/tutorial5/index.html">tutorial 5</a> about exposing matchers as web services (tutorial)</li>
<li>Fixed path errors in tutorials (tutorial)</li> <li>Fixed path errors in tutorials (tutorial)</li>
<li>Improved RDF Rendering layout (impl)</li> <li>Improved RDF Rendering layout (impl)</li>
</ul></p> </ul></p>
......
...@@ -232,7 +232,11 @@ public class ExtPREvaluator extends BasicEvaluator implements Evaluator { ...@@ -232,7 +232,11 @@ public class ExtPREvaluator extends BasicEvaluator implements Evaluator {
} }
public boolean isSuperProperty( Object prop1, Object prop2, HeavyLoadedOntology<Object> ontology ) throws AlignmentException { public boolean isSuperProperty( Object prop1, Object prop2, HeavyLoadedOntology<Object> ontology ) throws AlignmentException {
return ontology.getSuperProperties( prop2, OntologyFactory.DIRECT, OntologyFactory.ANY, OntologyFactory.ANY ).contains( prop1 ); try {
return ontology.getSuperProperties( prop2, OntologyFactory.DIRECT, OntologyFactory.ANY, OntologyFactory.ANY ).contains( prop1 );
} catch ( OntowrapException owex ) {
throw new AlignmentException( "Cannot interpret isSuperProperty", owex );
}
} }
......
...@@ -134,38 +134,43 @@ public class ClassStructAlignment extends DistanceAlignment implements Alignment ...@@ -134,38 +134,43 @@ public class ClassStructAlignment extends DistanceAlignment implements Alignment
// + pic2 * 2 * // + pic2 * 2 *
// (sigma (att in c[i]) getAllignCell... ) // (sigma (att in c[i]) getAllignCell... )
// / nbatts of c[i] + nbatts of c[j] // / nbatts of c[i] + nbatts of c[j]
for ( i=0; i<nbclass1; i++ ){ try {
Set<? extends Object> properties1 = honto1.getProperties( classlist1.get(i), OntologyFactory.ANY, OntologyFactory.ANY, OntologyFactory.ANY ); for ( i=0; i<nbclass1; i++ ){
int nba1 = properties1.size(); Set<? extends Object> properties1 = honto1.getProperties( classlist1.get(i), OntologyFactory.ANY, OntologyFactory.ANY, OntologyFactory.ANY );
if ( nba1 > 0 ) { // if not, keep old values... int nba1 = properties1.size();
//Set correspondences = new HashSet(); if ( nba1 > 0 ) { // if not, keep old values...
for ( j=0; j<nbclass2; j++ ){ //Set correspondences = new HashSet();
Set<? extends Object> properties2 = honto2.getProperties( classlist2.get(j), OntologyFactory.ANY, OntologyFactory.ANY, OntologyFactory.ANY ); for ( j=0; j<nbclass2; j++ ){
int nba2 = properties2.size(); Set<? extends Object> properties2 = honto2.getProperties( classlist2.get(j), OntologyFactory.ANY, OntologyFactory.ANY, OntologyFactory.ANY );
double attsum = 0.; int nba2 = properties2.size();
// check that there is a correspondance double attsum = 0.;
// in list of class2 atts and add their weights // check that there is a correspondance
for ( Object prp : properties1 ){ // in list of class2 atts and add their weights
Set<Cell> s2 = getAlignCells1( prp ); for ( Object prp : properties1 ){
// Find the property with the higest similarity Set<Cell> s2 = getAlignCells1( prp );
// that is matched here // Find the property with the higest similarity
double currentValue = 0.; // that is matched here
if ( s2 != null ) { double currentValue = 0.;
for( Cell c2 : s2 ){ if ( s2 != null ) {
if ( properties2.contains( c2.getObject2() ) ) { for( Cell c2 : s2 ){
double val = c2.getStrength(); if ( properties2.contains( c2.getObject2() ) ) {
if ( val > currentValue ) double val = c2.getStrength();
currentValue = val; if ( val > currentValue )
currentValue = val;
}
} }
} }
attsum = attsum + 1 - currentValue;
} }
attsum = attsum + 1 - currentValue; classmatrix[i][j] = classmatrix[i][j]
+ pic2 * (2 * attsum / (nba1 + nba2));
} }
classmatrix[i][j] = classmatrix[i][j]
+ pic2 * (2 * attsum / (nba1 + nba2));
} }
} }
} catch ( OntowrapException owex ) {
throw new AlignmentException( "Cannot navigate properties", owex );
} }
} }
} }
...@@ -190,29 +190,33 @@ public class NameAndPropertyAlignment extends DistanceAlignment implements Align ...@@ -190,29 +190,33 @@ public class NameAndPropertyAlignment extends DistanceAlignment implements Align
// + pic2 * 2 * // + pic2 * 2 *
// (sigma (att in c[i]) getAllignCell... ) // (sigma (att in c[i]) getAllignCell... )
// / nbatts of c[i] + nbatts of c[j] // / nbatts of c[i] + nbatts of c[j]
try {
for ( i=0; i<nbclass1; i++ ){ for ( i=0; i<nbclass1; i++ ){
Set<? extends Object> properties1 = honto1.getProperties( classlist1.get(i), OntologyFactory.ANY, OntologyFactory.ANY, OntologyFactory.ANY ); Set<? extends Object> properties1 = honto1.getProperties( classlist1.get(i), OntologyFactory.ANY, OntologyFactory.ANY, OntologyFactory.ANY );
int nba1 = properties1.size(); int nba1 = properties1.size();
if ( nba1 > 0 ) { // if not, keep old values... if ( nba1 > 0 ) { // if not, keep old values...
//Set correspondences = new HashSet(); //Set correspondences = new HashSet();
for ( j=0; j<nbclass2; j++ ){ for ( j=0; j<nbclass2; j++ ){
Set<? extends Object> properties2 = honto2.getProperties( classlist2.get(j), OntologyFactory.ANY, OntologyFactory.ANY, OntologyFactory.ANY ); Set<? extends Object> properties2 = honto2.getProperties( classlist2.get(j), OntologyFactory.ANY, OntologyFactory.ANY, OntologyFactory.ANY );
//int nba2 = properties1.size(); //int nba2 = properties1.size();
//double attsum = 0.; //double attsum = 0.;
// check that there is a correspondance // check that there is a correspondance
// in list of class2 atts and add their weights // in list of class2 atts and add their weights
// Make a local alignment with the properties. // Make a local alignment with the properties.
double moy_align_loc = alignLocal(properties1,properties2); double moy_align_loc = alignLocal(properties1,properties2);
if (moy_align_loc > 0.7){ if (moy_align_loc > 0.7){
classmatrix[i][j] = (classmatrix[i][j] + 2* moy_align_loc)/3; classmatrix[i][j] = (classmatrix[i][j] + 2* moy_align_loc)/3;
}
} }
} }
} }
} catch ( OntowrapException owex ) {
throw new AlignmentException( "Cannot navigate properties", owex );
} }
// Assess factor // Assess factor
// -- FirstExp: nothing to be done: one pass // -- FirstExp: nothing to be done: one pass
......
...@@ -194,36 +194,41 @@ public class StrucSubsDistAlignment extends DistanceAlignment implements Alignme ...@@ -194,36 +194,41 @@ public class StrucSubsDistAlignment extends DistanceAlignment implements Alignme
// + pic2 * 2 * // + pic2 * 2 *
// (sigma (att in c[i]) getAllignCell... ) // (sigma (att in c[i]) getAllignCell... )
// / nbatts of c[i] + nbatts of c[j] // / nbatts of c[i] + nbatts of c[j]
for ( i=0; i<nbclass1; i++ ){ try {
Set<? extends Object> properties1 = honto1.getProperties( classlist1.get(i), OntologyFactory.ANY, OntologyFactory.ANY, OntologyFactory.ANY ); for ( i=0; i<nbclass1; i++ ){
int nba1 = properties1.size(); Set<? extends Object> properties1 = honto1.getProperties( classlist1.get(i), OntologyFactory.ANY, OntologyFactory.ANY, OntologyFactory.ANY );
if ( nba1 > 0 ) { // if not, keep old values... int nba1 = properties1.size();
//Set correspondences = new HashSet(); if ( nba1 > 0 ) { // if not, keep old values...
for ( j=0; j<nbclass2; j++ ){ //Set correspondences = new HashSet();
Set<? extends Object> properties2 = honto2.getProperties( classlist2.get(j), OntologyFactory.ANY, OntologyFactory.ANY, OntologyFactory.ANY ); for ( j=0; j<nbclass2; j++ ){
int nba2 = properties2.size(); Set<? extends Object> properties2 = honto2.getProperties( classlist2.get(j), OntologyFactory.ANY, OntologyFactory.ANY, OntologyFactory.ANY );
double attsum = 0.; int nba2 = properties2.size();
// check that there is a correspondance double attsum = 0.;
// in list of class2 atts and add their weights // check that there is a correspondance
for ( Object prp : properties1 ){ // in list of class2 atts and add their weights
Set<Cell> s2 = getAlignCells1( prp ); for ( Object prp : properties1 ){
// Find the property with the higest similarity Set<Cell> s2 = getAlignCells1( prp );
// that is matched here // Find the property with the higest similarity
double currentValue = 0.; // that is matched here
for( Cell c2 : s2 ){ double currentValue = 0.;
if ( properties2.contains( c2.getObject2() ) ) { for( Cell c2 : s2 ){
double val = c2.getStrength(); if ( properties2.contains( c2.getObject2() ) ) {
if ( val > currentValue ) double val = c2.getStrength();
currentValue = val; if ( val > currentValue )
currentValue = val;
}
} }
attsum = attsum + 1 - currentValue;
} }
attsum = attsum + 1 - currentValue; classmatrix[i][j] = classmatrix[i][j]
+ pic2 * (2 * attsum / (nba1 + nba2));
} }
classmatrix[i][j] = classmatrix[i][j]
+ pic2 * (2 * attsum / (nba1 + nba2));
} }
} }
} catch ( OntowrapException owex ) {
throw new AlignmentException( "Error accessing ontology", owex );
} }
// Assess factor // Assess factor
// -- FirstExp: nothing to be done: one pass // -- FirstExp: nothing to be done: one pass
factor = 0.; factor = 0.;
......
...@@ -32,23 +32,23 @@ import java.util.Set; ...@@ -32,23 +32,23 @@ import java.util.Set;
public interface HeavyLoadedOntology<O> extends LoadedOntology<O> { public interface HeavyLoadedOntology<O> extends LoadedOntology<O> {
/* Capability methods */ /* Capability methods */
public boolean getCapabilities( int Direct, int Asserted, int Named ); public boolean getCapabilities( int Direct, int Asserted, int Named ) throws OntowrapException;
/* Class methods */ /* Class methods */
public <E >Set<E> getSubClasses( E c, int local, int asserted, int named ); public <E >Set<E> getSubClasses( E c, int local, int asserted, int named );
public Set<? extends Object> getSuperClasses( Object c, int local, int asserted, int named ); public Set<? extends Object> getSuperClasses( Object c, int local, int asserted, int named ) throws OntowrapException;
public Set<? extends Object> getProperties( Object c, int local, int asserted, int named ); public Set<? extends Object> getProperties( Object c, int local, int asserted, int named ) throws OntowrapException;
public Set<? extends Object> getDataProperties( Object c, int local, int asserted, int named ); public Set<? extends Object> getDataProperties( Object c, int local, int asserted, int named ) throws OntowrapException;
public Set<? extends Object> getObjectProperties( Object c, int local, int asserted, int named ); public Set<? extends Object> getObjectProperties( Object c, int local, int asserted, int named ) throws OntowrapException;
public Set<? extends Object> getInstances( Object c, int local, int asserted, int named ); public Set<? extends Object> getInstances( Object c, int local, int asserted, int named ) throws OntowrapException;
/* Property methods */ /* Property methods */
public Set<? extends Object> getSubProperties( Object p, int local, int asserted, int named ); public Set<? extends Object> getSubProperties( Object p, int local, int asserted, int named ) throws OntowrapException;
public Set<? extends Object> getSuperProperties( Object p, int local, int asserted, int named ); public Set<? extends Object> getSuperProperties( Object p, int local, int asserted, int named ) throws OntowrapException;
public Set<? extends Object> getRange( Object p, int asserted ); public Set<? extends Object> getRange( Object p, int asserted ) throws OntowrapException;
public Set<? extends Object> getDomain( Object p, int asserted ); public Set<? extends Object> getDomain( Object p, int asserted ) throws OntowrapException;
/* Individual methods */ /* Individual methods */
public Set<? extends Object> getClasses( Object i, int local, int asserted, int named ); public Set<? extends Object> getClasses( Object i, int local, int asserted, int named ) throws OntowrapException;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment