Mentions légales du service

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

- implemented EDOAL SQL store (serv)

parent f298992b
No related branches found
No related tags found
No related merge requests found
...@@ -38,7 +38,6 @@ The development of 4 versions continues. ...@@ -38,7 +38,6 @@ The development of 4 versions continues.
<p><ul compact="1"> <p><ul compact="1">
<li>Implement correspondence selection (serv)</li> <li>Implement correspondence selection (serv)</li>
<li>Implement database store for EDOAL (serv)</li>
<li>Implementation of a provenance metadata tag (serv/impl)</li> <li>Implementation of a provenance metadata tag (serv/impl)</li>
<li>Implement metadata edition (serv)</li> <li>Implement metadata edition (serv)</li>
<li>Add simple "harder" test generator (gen)</li> <li>Add simple "harder" test generator (gen)</li>
...@@ -66,12 +65,13 @@ The default type of StringDistAlignment should be reverted to "**" ...@@ -66,12 +65,13 @@ The default type of StringDistAlignment should be reverted to "**"
with a warning: with a warning:
--> -->
<!--h2>Version 4.9 (1xxx): ??/??/201X - Letraset</h2--> <!--h2>Version 4.9 (2xxx): ??/??/201X - Letraset</h2-->
<!--h2>Version 4.8 (1xxx): ??/??/201x - Antésine</h2--> <!--h2>Version 4.8 (2xxx): ??/??/2015 - Ant&eacute;sine</h2-->
<p><ul compact="1"> <p><ul compact="1">
<li>Added interface <tt>AlignmentRepairer</tt> (api)</tt> <li>Added interface <tt>AlignmentRepairer</tt> (api)</tt>
<li>Implemented <tt>AbstractRepairer</tt> (impl)</tt> <li>Implemented <tt>AbstractRepairer</tt> (impl)</tt>
<li>Implement database store for EDOAL (serv)</li>
</ul></p> </ul></p>
<h2>Version 4.7 (2014): 06/12/2014 - Al pesto</h2> <h2>Version 4.7 (2014): 06/12/2014 - Al pesto</h2>
......
/* /*
* $Id$ * $Id$
* *
* Copyright (C) INRIA, 2009-2010, 2012 * Copyright (C) INRIA, 2009-2010, 2012, 2015
* *
* 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
...@@ -29,7 +29,6 @@ public class Comparator { ...@@ -29,7 +29,6 @@ public class Comparator {
URI uri = null; URI uri = null;
// This replaces the Comparator class
// SHOULD CERTAINLY BE AN ENUM // SHOULD CERTAINLY BE AN ENUM
public static Comparator EQUAL = initComparator( Namespace.EDOAL.prefix+"equals", 0 ); public static Comparator EQUAL = initComparator( Namespace.EDOAL.prefix+"equals", 0 );
public static Comparator LOWER = initComparator( Namespace.EDOAL.prefix+"lower-than", -1 ); public static Comparator LOWER = initComparator( Namespace.EDOAL.prefix+"lower-than", -1 );
...@@ -66,4 +65,10 @@ public class Comparator { ...@@ -66,4 +65,10 @@ public class Comparator {
return uri; return uri;
} }
public boolean equals ( Object ob ) {
if ( ob == this ) return true;
else if ( !(ob instanceof Comparator) ) return false;
else return uri.equals( ((Comparator)ob).getURI() );
}
} }
...@@ -52,6 +52,7 @@ import fr.inrialpes.exmo.align.service.msg.UnknownOntologyNetwork; ...@@ -52,6 +52,7 @@ import fr.inrialpes.exmo.align.service.msg.UnknownOntologyNetwork;
import fr.inrialpes.exmo.align.service.msg.UnreachableAlignment; import fr.inrialpes.exmo.align.service.msg.UnreachableAlignment;
import fr.inrialpes.exmo.align.service.msg.UnreachableOntology; import fr.inrialpes.exmo.align.service.msg.UnreachableOntology;
import fr.inrialpes.exmo.align.service.msg.CannotRenderAlignment; import fr.inrialpes.exmo.align.service.msg.CannotRenderAlignment;
import fr.inrialpes.exmo.align.service.msg.CannotStoreAlignment;
import fr.inrialpes.exmo.align.service.msg.UnreachableOntologyNetwork; import fr.inrialpes.exmo.align.service.msg.UnreachableOntologyNetwork;
import fr.inrialpes.exmo.ontowrap.OntologyFactory; import fr.inrialpes.exmo.ontowrap.OntologyFactory;
...@@ -507,6 +508,7 @@ public class AServProtocolManager implements Service { ...@@ -507,6 +508,7 @@ public class AServProtocolManager implements Service {
al = alignmentCache.getAlignment( id ); al = alignmentCache.getAlignment( id );
logger.trace("Alignment found"); logger.trace("Alignment found");
} catch (Exception e) { } catch (Exception e) {
logger.debug( "Alignment {} not found", id, e );
return new UnknownAlignment( params, newId(), serverId,id ); return new UnknownAlignment( params, newId(), serverId,id );
} }
// Render it // Render it
...@@ -554,18 +556,16 @@ public class AServProtocolManager implements Service { ...@@ -554,18 +556,16 @@ public class AServProtocolManager implements Service {
public Message store( Properties params ) { public Message store( Properties params ) {
String id = params.getProperty("id"); String id = params.getProperty("id");
Alignment al = null; Alignment al = null;
try { try {
try { try {
al = alignmentCache.getAlignment( id ); al = alignmentCache.getAlignment( id );
} catch(Exception ex) { } catch( Exception ex ) {
logger.warn( "Unknown Id {} in Store", id ); logger.warn( "Unknown Id {} in Store", id );
return new UnknownAlignment( params, newId(), serverId, id );
} }
// Be sure it is not already stored // Be sure it is not already stored
if ( !alignmentCache.isAlignmentStored( al ) ) { if ( !alignmentCache.isAlignmentStored( al ) ) {
alignmentCache.storeAlignment( id ); alignmentCache.storeAlignment( id );
// Retrieve the alignment again // Retrieve the alignment again
al = alignmentCache.getAlignment( id ); al = alignmentCache.getAlignment( id );
// for all directories... // for all directories...
...@@ -581,8 +581,9 @@ public class AServProtocolManager implements Service { ...@@ -581,8 +581,9 @@ public class AServProtocolManager implements Service {
// Could also be an AlreadyStoredAlignment error // Could also be an AlreadyStoredAlignment error
return new AlignmentId( params, newId(), serverId, id, return new AlignmentId( params, newId(), serverId, id,
al.getExtension( Namespace.EXT.uri, Annotations.PRETTY )); al.getExtension( Namespace.EXT.uri, Annotations.PRETTY ));
} catch (Exception e) { } catch ( Exception ex ) {
return new UnknownAlignment( params, newId(), serverId,id ); logger.debug( "Impossible storage ", ex );
return new CannotStoreAlignment( params, newId(), serverId, id );
} }
} }
......
This diff is collapsed.
This diff is collapsed.
/*
* $Id$
*
* Copyright (C) INRIA, 2015
*
* 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 the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package fr.inrialpes.exmo.align.service.msg;
import java.util.Properties;
/**
* Contains the messages that should be sent according to the protocol
*/
public class CannotStoreAlignment extends ErrorMsg {
public CannotStoreAlignment ( int surr, Message rep, String from, String to, String cont, Properties param ) {
super( surr, rep, from, to, cont, param );
}
public CannotStoreAlignment ( Properties mess, int surr, String from, String cont ) {
super( mess, surr, from, cont );
}
public String HTMLString(){
return "Cannot store alignment "+content;
}
public String RESTString(){
return "<CannotStoreAlignment>"+getXMLContent()+"</CannotStoreAlignment>";
}
public String JSONString(){
return "{ \"type\" : \"CannotStoreAlignment\",\n \"content\" : \""+getJSONContent()+"\"\n}";
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment