Mentions légales du service

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

- Fixed a bug in SQLCache loading from database which prevented to reload EDOAL ontologies (serv)

parent ba53f20d
No related branches found
No related tags found
No related merge requests found
...@@ -60,6 +60,8 @@ with a warning: ...@@ -60,6 +60,8 @@ with a warning:
<!--h2>Version 4.9 (2xxx): ??/??/201X - Letraset</h2--> <!--h2>Version 4.9 (2xxx): ??/??/201X - Letraset</h2-->
<p><ul compact="1"> <p><ul compact="1">
<li><span style="color: red;">Suppressed</span> empty constructor in <tt>DBServiceImpl</tt> (serv)</li>
<li>Fixed a bug in <tt>SQLCache</tt> loading from database which prevented to reload EDOAL ontologies (serv)</li>
<li>Fixed a problem with Jade when running a server with no X server running (serv)</li> <li>Fixed a problem with Jade when running a server with no X server running (serv)</li>
<li>Moved all shell examples from csh to bash (html)</li> <li>Moved all shell examples from csh to bash (html)</li>
<li>Clarified EDOAL documentation (html)</li> <li>Clarified EDOAL documentation (html)</li>
......
/* /*
* $Id$ * $Id$
* *
* Copyright (C) INRIA, 2014-2015 * Copyright (C) INRIA, 2014-2016
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
...@@ -236,6 +236,7 @@ public class EDOALSQLCache { ...@@ -236,6 +236,7 @@ public class EDOALSQLCache {
} }
public Expression extractExpression( long intid ) throws SQLException, AlignmentException { public Expression extractExpression( long intid ) throws SQLException, AlignmentException {
logger.trace( "extractExpression for Id = {} ", intid );
try ( Statement st = service.getConnection().createStatement() ) { try ( Statement st = service.getConnection().createStatement() ) {
ResultSet rs = st.executeQuery( "SELECT type,joinid FROM edoalexpr WHERE intid='"+intid+"'" ); ResultSet rs = st.executeQuery( "SELECT type,joinid FROM edoalexpr WHERE intid='"+intid+"'" );
if ( !rs.next() ) throw new AlignmentException( "Cannot retrieve EDOAL expression : "+intid ); if ( !rs.next() ) throw new AlignmentException( "Cannot retrieve EDOAL expression : "+intid );
...@@ -295,6 +296,7 @@ public class EDOALSQLCache { ...@@ -295,6 +296,7 @@ public class EDOALSQLCache {
ResultSet rs = st.executeQuery( "SELECT uri FROM classid WHERE intid='"+intid+"'" ); ResultSet rs = st.executeQuery( "SELECT uri FROM classid WHERE intid='"+intid+"'" );
if ( !rs.next() ) throw new AlignmentException( "Cannot retrieve class id : "+intid ); if ( !rs.next() ) throw new AlignmentException( "Cannot retrieve class id : "+intid );
try { try {
logger.trace( "Identified ClassId = {}", rs.getString( "uri" ) );
return new ClassId( new URI( rs.getString( "uri" ) ) ); return new ClassId( new URI( rs.getString( "uri" ) ) );
} catch ( URISyntaxException urisex ) { } catch ( URISyntaxException urisex ) {
......
...@@ -289,14 +289,15 @@ public class SQLCache extends VolatilCache implements Cache { ...@@ -289,14 +289,15 @@ public class SQLCache extends VolatilCache implements Cache {
if ( confClassName != null ) { if ( confClassName != null ) {
result.setConfidenceType( confClassName ); result.setConfidenceType( confClassName );
} }
onto1 = rs.getString( "onto1" );
onto2 = rs.getString( "onto2" );
// Get the ontolologies // Get the ontolologies
onto1 = rs.getString( "onto1" );
onto2 = rs.getString( "onto2" );
retrieveOntology( onto1, result.getOntologyObject1() ); retrieveOntology( onto1, result.getOntologyObject1() );
result.setExtension( SVCNS, OURI1, onto1 ); result.setExtension( SVCNS, OURI1, onto1 );
retrieveOntology( onto2, result.getOntologyObject2() ); retrieveOntology( onto2, result.getOntologyObject2() );
result.setExtension( SVCNS, OURI2, onto2 ); result.setExtension( SVCNS, OURI2, onto2 );
result.init( result.getOntologyObject1(), result.getOntologyObject2() );
// Get dependencies if necessary // Get dependencies if necessary
...@@ -325,7 +326,6 @@ public class SQLCache extends VolatilCache implements Cache { ...@@ -325,7 +326,6 @@ public class SQLCache extends VolatilCache implements Cache {
ResultSet rs = st.executeQuery( "SELECT * FROM ontology WHERE uri = '" + uri +"'" ); ResultSet rs = st.executeQuery( "SELECT * FROM ontology WHERE uri = '" + uri +"'" );
if ( rs.next() ) { if ( rs.next() ) {
ob.setURI( new URI(rs.getString("uri")) ); ob.setURI( new URI(rs.getString("uri")) );
// I am really surprised by this
if ( rs.getString("file") != null ) ob.setFile( new URI( rs.getString("file") ) ); if ( rs.getString("file") != null ) ob.setFile( new URI( rs.getString("file") ) );
if ( rs.getString("formuri") != null ) ob.setFormURI( new URI( rs.getString("formuri") ) ); if ( rs.getString("formuri") != null ) ob.setFormURI( new URI( rs.getString("formuri") ) );
if ( rs.getString("formname") != null ) ob.setFormalism( rs.getString("formname") ); if ( rs.getString("formname") != null ) ob.setFormalism( rs.getString("formname") );
...@@ -366,8 +366,12 @@ public class SQLCache extends VolatilCache implements Cache { ...@@ -366,8 +366,12 @@ public class SQLCache extends VolatilCache implements Cache {
} else { // load the cell (if this is not a URIAlignment, this is an EDOALAlignment) } else { // load the cell (if this is not a URIAlignment, this is an EDOALAlignment)
esrv = new EDOALSQLCache( service ); esrv = new EDOALSQLCache( service );
esrv.init(); esrv.init();
logger.debug( " Entity1" );
Object ent1 = esrv.extractExpression( Long.parseLong( rs.getString("uri1") ) ); Object ent1 = esrv.extractExpression( Long.parseLong( rs.getString("uri1") ) );
logger.debug( "{}", ent1 );
logger.debug( " Entity2" );
Object ent2 = esrv.extractExpression( Long.parseLong( rs.getString("uri2") ) ); Object ent2 = esrv.extractExpression( Long.parseLong( rs.getString("uri2") ) );
logger.debug( "{}", ent2 );
if ( ent1 == null || ent2 == null ) break; if ( ent1 == null || ent2 == null ) break;
cell = ((EDOALAlignment)alignment).addAlignCell( ent1, ent2, rs.getString("relation"), Double.parseDouble(rs.getString("measure")) ); cell = ((EDOALAlignment)alignment).addAlignCell( ent1, ent2, rs.getString("relation"), Double.parseDouble(rs.getString("measure")) );
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment