diff --git a/plugins/webcontent/lib/weblab.jar b/plugins/webcontent/lib/weblab.jar index 8fba2ae1f02c9afadd8a1c15ba87f24f999e4509..1bcd0ad907446520b70d98436bdc465405c42741 100644 Binary files a/plugins/webcontent/lib/weblab.jar and b/plugins/webcontent/lib/weblab.jar differ diff --git a/plugins/webcontent/src/fr/inrialpes/exmo/align/plugin/webcontent/OntologyAlignmentImpl.java b/plugins/webcontent/src/fr/inrialpes/exmo/align/plugin/webcontent/OntologyAlignmentImpl.java index fb80c2a5a467e98e7ec40308af5ead0f93730f28..c00962e248c3f382b483781fbf39ab732d667681 100644 --- a/plugins/webcontent/src/fr/inrialpes/exmo/align/plugin/webcontent/OntologyAlignmentImpl.java +++ b/plugins/webcontent/src/fr/inrialpes/exmo/align/plugin/webcontent/OntologyAlignmentImpl.java @@ -1,7 +1,7 @@ /* * $Id$ * - * Copyright (C) INRIA Rh�ne-Alpes, 2007-2008 + * Copyright (C) INRIA Rh�ne-Alpes, 2007-2009 * * 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 @@ -26,68 +26,105 @@ import org.weblab_project.core.model.Document; import org.weblab_project.core.model.MediaUnit; import org.weblab_project.services.exception.WebLabException; import org.weblab_project.core.model.text.Text; -import org.weblab_project.services.ontologyalignment.types.ProcessArgs; +import org.weblab_project.services.ontologyalignment.types.MatchArgs; +import org.weblab_project.services.ontologyalignment.types.FindArgs; +import org.weblab_project.services.ontologyalignment.types.RetrieveArgs; +import org.weblab_project.services.ontologyalignment.types.LoadArgs; +import org.weblab_project.services.ontologyalignment.types.StoreArgs; +import org.weblab_project.services.ontologyalignment.types.TrimArgs; import org.weblab_project.services.ontologyalignment.types.AddResourceArgs; import org.weblab_project.services.ontologyalignment.types.AddResourceReturn; -import org.weblab_project.services.ontologyalignment.types.ProcessReturn; +import org.weblab_project.services.ontologyalignment.types.MatchReturn; +import org.weblab_project.services.ontologyalignment.types.FindReturn; +import org.weblab_project.services.ontologyalignment.types.RetrieveReturn; +import org.weblab_project.services.ontologyalignment.types.LoadReturn; +import org.weblab_project.services.ontologyalignment.types.StoreReturn; +import org.weblab_project.services.ontologyalignment.types.TrimReturn; import org.weblab_project.services.ontologyalignment.OntologyAlignment; -import org.weblab_project.services.ontologyalignment.ProcessException; +import org.weblab_project.services.ontologyalignment.MatchException; +import org.weblab_project.services.ontologyalignment.FindException; +import org.weblab_project.services.ontologyalignment.RetrieveException; +import org.weblab_project.services.ontologyalignment.LoadException; +import org.weblab_project.services.ontologyalignment.StoreException; +import org.weblab_project.services.ontologyalignment.TrimException; import org.weblab_project.services.ontologyalignment.AddResourceException; import org.weblab_project.core.model.ontology.Ontology; import org.weblab_project.core.model.Annotation; + +import org.weblab_project.core.model.user.UsageContext; +import fr.inrialpes.exmo.align.parser.AlignmentParser; +import fr.inrialpes.exmo.align.impl.BasicParameters; +import fr.inrialpes.exmo.align.impl.BasicAlignment; +import fr.inrialpes.exmo.align.impl.URIAlignment; +import fr.inrialpes.exmo.align.impl.ObjectAlignment; + -//import fr.inrialpes.exmo.align.plugin.neontk.OnlineAlign; +import org.semanticweb.owl.align.Parameters; +import org.semanticweb.owl.align.Alignment; +import org.semanticweb.owl.align.AlignmentProcess; +import org.semanticweb.owl.align.AlignmentVisitor; +import org.semanticweb.owl.align.AlignmentException; import java.net.URI; +import java.util.List; +import java.io.ByteArrayOutputStream; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.io.BufferedWriter; +import java.io.OutputStreamWriter; + + @WebService(endpointInterface = "org.weblab_project.services.ontologyalignment.OntologyAlignment") public class OntologyAlignmentImpl implements OntologyAlignment { -public ProcessReturn process(ProcessArgs args) throws ProcessException { - -//System.out.println("Alignment Hello"); +public MatchReturn match(MatchArgs args) throws MatchException { String defaultHost = "aserv.inrialpes.fr"; String defaultPort = "80"; -String[] methodList = new String[8]; - -methodList[0] = "fr.inrialpes.exmo.align.impl.method.NameEqAlignment"; -methodList[1] = "fr.inrialpes.exmo.align.impl.method.StringDistAlignment"; -methodList[2] = "fr.inrialpes.exmo.align.impl.method.SMOANameAlignment"; -methodList[3] = "fr.inrialpes.exmo.align.impl.method.SubsDistNameAlignment"; -methodList[4] = "fr.inrialpes.exmo.align.impl.method.StrucSubsDistAlignment"; -methodList[5] = "fr.inrialpes.exmo.align.impl.method.NameAndPropertyAlignment"; -methodList[6] = "fr.inrialpes.exmo.align.impl.method.ClassStructAlignment"; -methodList[7] = "fr.inrialpes.exmo.align.impl.method.EditDistNameAlignment"; +String defaultMethod = "fr.inrialpes.exmo.align.impl.method.EditDistNameAlignment"; + WSInterface onAlign = new WSInterface(defaultPort, defaultHost); -Ontology onto1 = args.getOnto1(); -Ontology onto2 = args.getOnto2(); -String uri1 = onto1.getUri(); -String uri2 = onto2.getUri(); -String matchMethod = methodList[7]; +Ontology onto1 = args.getOnto1(); +Ontology onto2 = args.getOnto2(); +String uri1 = onto1.getUri(); +String uri2 = onto2.getUri(); +UsageContext uc = args.getUsageContext(); + +String matchMethod = uc.getUri(); +String[] methods = onAlign.getMethods(); + +boolean found = false; + +for(int i=0; i < methods.length; i++) { + if ( matchMethod.equals(methods[i]) ) found = true; +} + +if(found) defaultMethod = matchMethod; + String alignURI = null; if (!uri1.startsWith("http://") || !uri2.startsWith("http://") ) { WebLabException ex = new WebLabException(); ex.setErrorMessage("ERROR : Ontology URI."); ex.setErrorId("OntologyAlignment"); - throw new ProcessException("ProcessException : ", ex); + throw new MatchException("MatchException : ", ex); } else { - + alignURI = onAlign.getAlignId( matchMethod, uri1, uri2 ); if(alignURI==null || alignURI.equals("")) { WebLabException ex = new WebLabException(); ex.setErrorMessage("ERROR : Alignment URI."); ex.setErrorId("OntologyAlignment"); - throw new ProcessException("ProcessException : ", ex); + throw new MatchException("MatchException : ", ex); } } -ProcessReturn out = new ProcessReturn(); +MatchReturn out = new MatchReturn(); Annotation annot = new Annotation(); annot.setUri(alignURI); out.setAnnotation(annot); @@ -96,6 +133,238 @@ return out; } +public FindReturn find(FindArgs args) throws FindException { + +String defaultHost = "aserv.inrialpes.fr"; +String defaultPort = "80"; + +WSInterface onAlign = new WSInterface(defaultPort, defaultHost); + +Ontology onto1 = args.getOnto1(); +Ontology onto2 = args.getOnto2(); +String uri1 = onto1.getUri(); +String uri2 = onto2.getUri(); + +if (!uri1.startsWith("http://") || !uri2.startsWith("http://") ) { + WebLabException ex = new WebLabException(); + ex.setErrorMessage("ERROR : Ontology URI."); + ex.setErrorId("OntologyAlignment"); + throw new FindException("FindException : ", ex); + +} else { + String[] alignUris = onAlign.findAlignForOntos( uri1, uri2 ); + if( alignUris==null || alignUris.length == 0) { + WebLabException ex = new WebLabException(); + ex.setErrorMessage("ERROR : Alignment not found."); + ex.setErrorId("OntologyAlignment"); + throw new FindException("FindException : ", ex); + } else { + FindReturn out = new FindReturn(); + List<Annotation> ll = out.getAnnotation(); + for(int i=0; i < alignUris.length; i++) { + Annotation annot = new Annotation(); + annot.setUri(alignUris[i]); + ll.add(annot); + } + return out; + } +} + +} + +public RetrieveReturn retrieve(RetrieveArgs args) throws RetrieveException { + +String defaultHost = "aserv.inrialpes.fr"; +String defaultPort = "80"; + +WSInterface onAlign = new WSInterface(defaultPort, defaultHost); + +Annotation align = args.getAlign(); +String aUri = align.getUri(); +UsageContext uc = args.getUsageContext(); +String method = uc.getUri(); + + +if (!aUri.startsWith("http://") ) { + WebLabException ex = new WebLabException(); + ex.setErrorMessage("ERROR : Ontology URI."); + ex.setErrorId("OntologyAlignment"); + throw new RetrieveException("RetrieveException : ", ex); + +} else { + String alignContent = onAlign.render( aUri , method); + if( alignContent == null ) { + WebLabException ex = new WebLabException(); + ex.setErrorMessage("ERROR : No rendered Alignment."); + ex.setErrorId("OntologyAlignment"); + throw new RetrieveException("RetrieveException : ", ex); + } else { + /* + PrintWriter writer = null; + ByteArrayOutputStream result = new ByteArrayOutputStream(); + + AlignmentParser ap = null; + URIAlignment al = null; + + try { + ap = new AlignmentParser(0); + ap.setEmbedded( true ); + al = (URIAlignment) ap.parse( alignContent ); + } catch (Exception e) { + WebLabException ex = new WebLabException(); + ex.setErrorMessage(" Parsing problem."); + ex.setErrorId("OntologyAlignment"); + throw new RetrieveException("RetrieveException : ", ex); + } + + // Render it + + AlignmentVisitor renderer = null; + // Redirect the output in a String + try { + writer = new PrintWriter ( + new BufferedWriter( + new OutputStreamWriter( result, "UTF-8" )), true); + + Object[] mparams = {(Object) writer }; + java.lang.reflect.Constructor[] rendererConstructors = + Class.forName(method).getConstructors(); + renderer = + (AlignmentVisitor) rendererConstructors[0].newInstance(mparams); + } catch (Exception ex) { + WebLabException e = new WebLabException(); + e.setErrorMessage("Unknown method."); + e.setErrorId("OntologyAlignment"); + throw new RetrieveException("RetrieveException : ", e); + } + + try { + ObjectAlignment obAl = ObjectAlignment.toObjectAlignment( al ); + obAl.render( renderer ); + writer.flush(); + writer.close(); + + } catch (Exception e) { + WebLabException ex = new WebLabException(); + ex.setErrorMessage(" Renderer problem."); + ex.setErrorId("OntologyAlignment"); + throw new RetrieveException("RetrieveException : ", ex); + } + */ + RetrieveReturn out = new RetrieveReturn(); + Annotation annot = new Annotation(); + //String strRes = result.toString(); + //if(strRes == null || strRes.equals("") ) { + if(alignContent == null || alignContent.equals("") ) { + annot.setData("No alignment"); + } else + //annot.setData(strRes); + annot.setData( alignContent ); + + out.setAnnotation(annot); + return out; + } +} + +} + + +public TrimReturn trim(TrimArgs args) throws TrimException { + String defaultHost = "aserv.inrialpes.fr"; + String defaultPort = "80"; + + WSInterface onAlign = new WSInterface(defaultPort, defaultHost); + Annotation th = args.getThreshold(); + + String threshold = th.getData(); + Annotation align = args.getAlign(); + String aUri = align.getUri(); + + if (!aUri.startsWith("http://") ) { + WebLabException ex = new WebLabException(); + ex.setErrorMessage("ERROR : Alignment URI."); + ex.setErrorId("OntologyAlignment"); + throw new TrimException("TrimException : ", ex); + } + + String resUri = onAlign.trimAlign( aUri, threshold ); + + if (resUri == null || resUri.equals("") ) { + WebLabException ex = new WebLabException(); + ex.setErrorMessage("ERROR : Trimmed Alignment ."); + ex.setErrorId("OntologyAlignment"); + throw new TrimException("TrimException : ", ex); + } + + TrimReturn out = new TrimReturn(); + Annotation annot = new Annotation(); + annot.setUri( resUri ); + out.setAnnotation(annot); + return out; +} + +public StoreReturn store(StoreArgs args) throws StoreException { + String defaultHost = "aserv.inrialpes.fr"; + String defaultPort = "80"; + + WSInterface onAlign = new WSInterface(defaultPort, defaultHost); + + Annotation align = args.getAlign(); + String aUri = align.getUri(); + + if (!aUri.startsWith("http://") ) { + WebLabException ex = new WebLabException(); + ex.setErrorMessage("ERROR : Alignment URI."); + ex.setErrorId("OntologyAlignment"); + throw new StoreException("StoreException : ", ex); + } + + String resUri = onAlign.storeAlign( aUri ); + + if (resUri == null || resUri.equals("") ) { + WebLabException ex = new WebLabException(); + ex.setErrorMessage("ERROR : Stored Alignment ."); + ex.setErrorId("OntologyAlignment"); + throw new StoreException("StoreException : ", ex); + } + + StoreReturn out = new StoreReturn(); + Annotation annot = new Annotation(); + annot.setUri( resUri ); + out.setAnnotation(annot); + return out; + +} + + +public LoadReturn load(LoadArgs args) throws LoadException { + +String defaultHost = "aserv.inrialpes.fr"; +String defaultPort = "80"; + +WSInterface onAlign = new WSInterface(defaultPort, defaultHost); + +Annotation fileContent = args.getFileContent(); +String content = fileContent.getData(); + +System.out.println("content="+content); + +String alignUri = onAlign.loadStringAsAlignment( content ); +if( alignUri == null ) { + WebLabException ex = new WebLabException(); + ex.setErrorMessage("ERROR : No loaded Alignment."); + ex.setErrorId("OntologyAlignment"); + throw new LoadException("RetrieveException : ", ex); +} + +LoadReturn out = new LoadReturn(); +Annotation annot = new Annotation(); +annot.setUri(alignUri); +out.setAnnotation(annot); + +return out; +} + public AddResourceReturn addResource(AddResourceArgs args) throws AddResourceException { AddResourceReturn out = new AddResourceReturn(); return out; diff --git a/plugins/webcontent/src/fr/inrialpes/exmo/align/plugin/webcontent/WSInterface.java b/plugins/webcontent/src/fr/inrialpes/exmo/align/plugin/webcontent/WSInterface.java index 69a48ccc8d3a89b4c8c8657727bafd403b29f7a6..d31e45f7dc6f17b98df6a0c915550681d510a357 100644 --- a/plugins/webcontent/src/fr/inrialpes/exmo/align/plugin/webcontent/WSInterface.java +++ b/plugins/webcontent/src/fr/inrialpes/exmo/align/plugin/webcontent/WSInterface.java @@ -24,6 +24,7 @@ import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.InputStream; +import java.lang.StringBuffer; import java.io.FileInputStream; import java.io.DataOutputStream; @@ -145,8 +146,7 @@ public class WSInterface { Parameters params = new BasicParameters(); params.setParameter( "host", HOST ); - //params.setParameter( "http", PORT ); - //params.setParameter( "wsdl", WSDL ); + params.setParameter( "command","trim"); params.setParameter( "arg1",alignId); params.setParameter( "arg2",thres); @@ -194,8 +194,7 @@ public class WSInterface { Parameters params = new BasicParameters(); params.setParameter( "host", HOST ); - //params.setParameter( "http", PORT ); - //params.setParameter( "wsdl", WSDL ); + params.setParameter( "command","list"); params.setParameter( "arg1","methods"); @@ -236,17 +235,13 @@ public class WSInterface { // Read parameters Parameters params = new BasicParameters(); params.setParameter( "host", HOST ); - //params.setParameter( "http", PORT ); - //params.setParameter( "wsdl", WSDL ); + params.setParameter( "command","find"); params.setParameter( "arg1", onto1); params.setParameter( "arg2", onto2); // Create the SOAP message String message = createMessage( params ); - - //System.out.println("HOST= :"+ HOST + ", PORT= " + PORT + ", Action = "+ SOAPAction); - //System.out.println("Message :"+ message); - + // Send message answer = sendMessage( message, params ); } @@ -265,9 +260,7 @@ public class WSInterface { String[] result = getTagFromSOAP( domMessage, "findResponse/alignmentList/alid" ); - //for(int i=0; i< result.length;i++) System.out.println("aligns for ontos=" + result[i]); - - return result; + return result; } @@ -469,13 +462,6 @@ public class WSInterface { } catch ( Exception ex ) { ex.printStackTrace(); }; - - // Cut SOAP header - - //answer = "<?xml version='1.0' encoding='utf-8' standalone='no'?>" + answer ; - answer = answer.replace("<?xml version='1.0' encoding='utf-8' standalone='no'?>", ""); - - Document domMessage = null; try { domMessage = BUILDER.parse( new ByteArrayInputStream( answer.getBytes()) ); @@ -488,14 +474,55 @@ public class WSInterface { String result[] = getTagFromSOAP( domMessage, "retrieveResponse/result/RDF" ); - - - //System.out.println("RDFAlign="+ result[0]); - + return result[0]; } - + public String render(String alignId, String method) { + + Parameters params = new BasicParameters(); + params.setParameter( "host", HOST ); + //params.setParameter( "http", PORT ); + //params.setParameter( "wsdl", WSDL ); + params.setParameter( "command","retrieve"); + params.setParameter( "arg1", alignId); + params.setParameter( "arg2", method); + + String answer=null; + + try { + // Read parameters + //Parameters params = ws.readParameters( aservArgRetrieve ); + + // Create the SOAP message + String message = createMessage( params ); + + // Send message + answer = sendMessage( message, params ); + if(! connected ) return null; + + + + } catch ( Exception ex ) { ex.printStackTrace(); }; + + //there is a problem when trying to remove SOAP header from message for this case + /* + Document domMessage = null; + try { + domMessage = BUILDER.parse( new ByteArrayInputStream( answer.getBytes()) ); + + } catch ( IOException ioex ) { + ioex.printStackTrace(); + } catch ( SAXException saxex ) { + saxex.printStackTrace(); + } + + + String result[] = getTagFromSOAP( domMessage, "retrieveResponse/result" ); + */ + + return answer; + } public String storeAlign(String alignId) { @@ -508,7 +535,6 @@ public class WSInterface { params.setParameter( "command","store"); params.setParameter( "arg1", alignId); - String answer = null; try { @@ -553,6 +579,101 @@ public class WSInterface { } + public String loadStringAsAlignment( String message ) { + // Create the connection + + byte[] b = message.getBytes(); + + String answer = ""; + // Create HTTP Request + try { + + URLConnection connection = SOAPUrl.openConnection(); + HttpURLConnection httpConn = (HttpURLConnection) connection; + + httpConn.setRequestProperty("SOAPAction","loadRequest"); + httpConn.setRequestMethod( "POST" ); + httpConn.setDoOutput( true ); + httpConn.setDoInput( true ); + + // Don't use a cached version of URL connection. + httpConn.setUseCaches ( false ); + httpConn.setDefaultUseCaches (false); + + //File f = new File("/home/exmo/cleduc/Desktop/align.rdf"); + //FileInputStream fi = new FileInputStream(f); + // set headers and their values. + httpConn.setRequestProperty("Content-Type", + "application/octet-stream"); + httpConn.setRequestProperty("Content-Length", + Long.toString(b.length )); + + // create file stream and write stream to write file data. + + OutputStream os = httpConn.getOutputStream(); + + try { + os.write( b, 0, b.length ); + os.flush(); + os.close(); + } catch (Exception ex) {} + + /* + + try + { + // transfer the file in 4K chunks. + byte[] buffer = new byte[4096]; + //long byteCnt = 0; + int bytes=0; + while (true) + { + bytes = fi.read(buffer); + System.out.println("line1="+ buffer.toString() ); + if (bytes < 0) break; + + os.write( buffer, 0, bytes ); + + } + + os.flush(); + } catch (Exception ex) {} + */ + // Read the response + InputStreamReader isr = new InputStreamReader(httpConn.getInputStream()); + BufferedReader in = new BufferedReader(isr); + + String line; + StringBuffer strBuff = new StringBuffer(); + while ((line = in.readLine()) != null) { + strBuff.append( line + "\n"); + } + if (in != null) in.close(); + answer = strBuff.toString(); + + + } catch (Exception ex) { + connected= false; ex.printStackTrace() ; return null; + } + + connected = true; + + Document domMessage = null; + try { + domMessage = BUILDER.parse( new ByteArrayInputStream( answer.getBytes()) ); + + } catch ( IOException ioex ) { + ioex.printStackTrace(); + } catch ( SAXException saxex ) { + saxex.printStackTrace(); + } + + + String[] result = getTagFromSOAP( domMessage, "loadResponse" ); + + return result[0]; + } + public String[] getTagFromSOAP( Document dom, String tag ){ XPath XPATH = XPathFactory.newInstance().newXPath(); String[] result = null; @@ -590,8 +711,7 @@ public class WSInterface { String nm = stream.toString(); result = new String[1]; result[0] = nm; - //System.out.println("result retrieve="+result[0]); - //System.out.println("no first="+ n.getNodeValue()); + } else { Node nn = (Node)(XPATH.evaluate("/Envelope/Body/" + tag, dom, XPathConstants.NODE)); result = new String[1]; @@ -599,7 +719,7 @@ public class WSInterface { NodeList ns = nn.getChildNodes(); //tag "alid" is third - Node n3 = (Node) ns.item(2); + Node n3 = (Node) ns.item(3); Node nx = n3.getFirstChild(); String nm = nx.getNodeValue(); @@ -645,7 +765,7 @@ public class WSInterface { //usage(); System.exit(-1); } - messageBody = "<uri1>"+uri1+"</uri1><uri2>"+uri2+"</uri2>"; + messageBody = "<url1>"+uri1+"</url1><url2>"+uri2+"</url2>"; } else if ( cmd.equals("match" ) ) { SOAPAction = "matchRequest"; String uri1 = (String)params.getParameter( "arg1" ); @@ -796,10 +916,12 @@ public class WSInterface { BufferedReader in = new BufferedReader(isr); String line; - while ((line = in.readLine()) != null) { - answer += line + "\n"; + StringBuffer strBuff = new StringBuffer(); + while ((line = in.readLine()) != null) { + strBuff.append( line + "\n"); } if (in != null) in.close(); + answer = strBuff.toString(); if(httpConn.HTTP_REQ_TOO_LONG == httpConn.getResponseCode()) System.err.println("Request too long"); @@ -816,7 +938,7 @@ public class WSInterface { public String sendFile( String message, Parameters param ) { // Create the connection - byte[] b = message.getBytes(); + //byte[] b = message.getBytes(); String answer = ""; // Create HTTP Request @@ -835,7 +957,7 @@ public class WSInterface { httpConn.setDefaultUseCaches (false); File f = new File(uploadFile); - FileInputStream fi = new FileInputStream(f); + FileInputStream fi = new FileInputStream(f); // set headers and their values. httpConn.setRequestProperty("Content-Type", "application/octet-stream"); diff --git a/plugins/webcontent/src/wsdl/interfaces/OntologyAlignment.wsdl b/plugins/webcontent/src/wsdl/interfaces/OntologyAlignment.wsdl index b82c42aa048968e9259f11ada243413dc27d0e7e..46ce0b9c94911d2e3ce8a79f7271f77a76bd2b9e 100644 --- a/plugins/webcontent/src/wsdl/interfaces/OntologyAlignment.wsdl +++ b/plugins/webcontent/src/wsdl/interfaces/OntologyAlignment.wsdl @@ -16,19 +16,69 @@ schemaLocation="OntologyAlignmentTypes.xsd" /> <xsd:import namespace="http://weblab-project.org/services/exception" - schemaLocation="http://ipcc-projects.org/weblab/core/services/1.0/exception.xsd" /> + schemaLocation="http://ipcc-projects.org/weblab/core/back/services/1.0/exception.xsd" /> </xsd:schema> </types> - <message name="processRequest"> - <part name="args" element="types:processArgs" /> + <message name="matchRequest"> + <part name="args" element="types:matchArgs" /> </message> - <message name="processResponse"> - <part name="return" element="types:processReturn" /> + <message name="matchResponse"> + <part name="return" element="types:matchReturn" /> </message> - <message name="processException"> + <message name="matchException"> <part name="error" element="ex:webLabException" /> + </message> + + <message name="findRequest"> + <part name="args" element="types:findArgs" /> </message> + <message name="findResponse"> + <part name="return" element="types:findReturn" /> + </message> + <message name="findException"> + <part name="error" element="ex:webLabException" /> + </message> + + <message name="retrieveRequest"> + <part name="args" element="types:retrieveArgs" /> + </message> + <message name="retrieveResponse"> + <part name="return" element="types:retrieveReturn" /> + </message> + <message name="retrieveException"> + <part name="error" element="ex:webLabException" /> + </message> + + <message name="trimRequest"> + <part name="args" element="types:trimArgs" /> + </message> + <message name="trimResponse"> + <part name="return" element="types:trimReturn" /> + </message> + <message name="trimException"> + <part name="error" element="ex:webLabException" /> + </message> + + <message name="storeRequest"> + <part name="args" element="types:storeArgs" /> + </message> + <message name="storeResponse"> + <part name="return" element="types:storeReturn" /> + </message> + <message name="storeException"> + <part name="error" element="ex:webLabException" /> + </message> + + <message name="loadRequest"> + <part name="args" element="types:loadArgs" /> + </message> + <message name="loadResponse"> + <part name="return" element="types:loadReturn" /> + </message> + <message name="loadException"> + <part name="error" element="ex:webLabException" /> + </message> <message name="addResourceRequest"> <part name="args" element="types:addResourceArgs" /> @@ -42,25 +92,100 @@ <portType name="OntologyAlignment"> <documentation> - A simple interface for a, ontology alignment. It contains a + A simple interface for an ontology alignment. It contains a method to enable business analyser to process two ontologies, given a usage content; and a method enabling to add some resources to extract the knowledge from. - </documentation> - <operation name="process"> + </documentation> + <operation name="match"> <documentation> Ask to the service to process with its business method. </documentation> - <input name="processInput" message="tns:processRequest" /> - <output name="processOutput" message="tns:processResponse" /> - <fault name="processException" - message="tns:processException"> + <input name="matchInput" message="tns:matchRequest" /> + <output name="matchOutput" message="tns:matchResponse" /> + <fault name="matchException" + message="tns:matchException"> <documentation> To be thrown when an error occurs in the process method of the ontology alignment. </documentation> </fault> - </operation> + </operation> + <operation name="find"> + <documentation> + Ask to the service to process with its business method. + </documentation> + <input name="findInput" message="tns:findRequest" /> + <output name="findOutput" message="tns:findResponse" /> + <fault name="findException" + message="tns:findException"> + <documentation> + To be thrown when an error occurs in the process + method of the ontology alignment. + </documentation> + </fault> + </operation> + + <operation name="retrieve"> + <documentation> + Ask to the service to process with its business method. + </documentation> + <input name="retrieveInput" message="tns:retrieveRequest" /> + <output name="retrieveOutput" message="tns:retrieveResponse" /> + <fault name="retrieveException" + message="tns:retrieveException"> + <documentation> + To be thrown when an error occurs in the process + method of the ontology alignment. + </documentation> + </fault> + </operation> + + <operation name="trim"> + <documentation> + Ask to the service to process with its business method. + </documentation> + <input name="trimInput" message="tns:trimRequest" /> + <output name="trimOutput" message="tns:trimResponse" /> + <fault name="trimException" + message="tns:trimException"> + <documentation> + To be thrown when an error occurs in the process + method of the ontology alignment. + </documentation> + </fault> + </operation> + + <operation name="store"> + <documentation> + Ask to the service to process with its business method. + </documentation> + <input name="storeInput" message="tns:storeRequest" /> + <output name="storeOutput" message="tns:storeResponse" /> + <fault name="storeException" + message="tns:storeException"> + <documentation> + To be thrown when an error occurs in the process + method of the ontology alignment. + </documentation> + </fault> + </operation> + + <operation name="load"> + <documentation> + Ask to the service to process with its business method. + </documentation> + <input name="loadInput" message="tns:loadRequest" /> + <output name="loadOutput" message="tns:loadResponse" /> + <fault name="loadException" + message="tns:loadException"> + <documentation> + To be thrown when an error occurs in the process + method of the ontology alignment. + </documentation> + </fault> + </operation> + <operation name="addResource"> <documentation> Add the resource within a usage context to the service. @@ -83,16 +208,76 @@ type="tns:OntologyAlignment"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> - <operation name="process"> - <soap:operation soapAction="process" /> - <input name="processInput"> + <operation name="match"> + <soap:operation soapAction="match" /> + <input name="matchInput"> + <soap:body use="literal" /> + </input> + <output name="matchOutput"> + <soap:body use="literal" /> + </output> + <fault name="matchException"> + <soap:fault name="matchException" use="literal" /> + </fault> + </operation> + <operation name="find"> + <soap:operation soapAction="find" /> + <input name="findInput"> + <soap:body use="literal" /> + </input> + <output name="findOutput"> + <soap:body use="literal" /> + </output> + <fault name="findException"> + <soap:fault name="findException" use="literal" /> + </fault> + </operation> + <operation name="retrieve"> + <soap:operation soapAction="retrieve" /> + <input name="retrieveInput"> + <soap:body use="literal" /> + </input> + <output name="retrieveOutput"> + <soap:body use="literal" /> + </output> + <fault name="retrieveException"> + <soap:fault name="retrieveException" use="literal" /> + </fault> + </operation> + <operation name="trim"> + <soap:operation soapAction="trim" /> + <input name="trimInput"> + <soap:body use="literal" /> + </input> + <output name="trimOutput"> + <soap:body use="literal" /> + </output> + <fault name="trimException"> + <soap:fault name="trimException" use="literal" /> + </fault> + </operation> + <operation name="store"> + <soap:operation soapAction="store" /> + <input name="storeInput"> + <soap:body use="literal" /> + </input> + <output name="storeOutput"> + <soap:body use="literal" /> + </output> + <fault name="storeException"> + <soap:fault name="storeException" use="literal" /> + </fault> + </operation> + <operation name="load"> + <soap:operation soapAction="load" /> + <input name="loadInput"> <soap:body use="literal" /> </input> - <output name="processOutput"> + <output name="loadOutput"> <soap:body use="literal" /> </output> - <fault name="processException"> - <soap:fault name="processException" use="literal" /> + <fault name="loadException"> + <soap:fault name="loadException" use="literal" /> </fault> </operation> <operation name="addResource"> diff --git a/plugins/webcontent/src/wsdl/interfaces/OntologyAlignmentTypes.xsd b/plugins/webcontent/src/wsdl/interfaces/OntologyAlignmentTypes.xsd index 393c7d465bba22fce6ff8fe80e46a6dd9543a641..c41abb907e7ef6e7a77622dd7815d3af0e9c20dd 100644 --- a/plugins/webcontent/src/wsdl/interfaces/OntologyAlignmentTypes.xsd +++ b/plugins/webcontent/src/wsdl/interfaces/OntologyAlignmentTypes.xsd @@ -1,7 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- Created by EADS DS - IPCC --> <xs:schema xmlns:tns="http://weblab-project.org/services/ontologyalignment/types" - xmlns:model="http://weblab-project.org/core/model/" xmlns:user="http://weblab-project.org/core/model/user" + xmlns:model="http://weblab-project.org/core/model/" xmlns:user="http://weblab-project.org/core/model/user" + xmlns:structure="http://weblab-project.org/core/model/structure" xmlns:ontology="http://weblab-project.org/core/model/ontology" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://weblab-project.org/services/ontologyalignment/types"> @@ -32,9 +33,9 @@ OntologyEnrichment service. </xs:documentation> </xs:annotation> - <xs:element name="processArgs" type="tns:processArgs" /> - <xs:element name="processReturn" type="tns:processReturn" /> - <xs:complexType name="processArgs"> + <xs:element name="matchArgs" type="tns:matchArgs" /> + <xs:element name="matchReturn" type="tns:matchReturn" /> + <xs:complexType name="matchArgs"> <xs:annotation> <xs:documentation> Wrapper containing the two ontologies to align and the usage @@ -50,7 +51,7 @@ minOccurs="0" maxOccurs="1" /> </xs:sequence> </xs:complexType> - <xs:complexType name="processReturn"> + <xs:complexType name="matchReturn"> <xs:annotation> <xs:documentation> Wrapper containing the computed annotation @@ -60,7 +61,149 @@ <xs:element name="annotation" type="model:annotation" minOccurs="1" maxOccurs="1" /> </xs:sequence> - </xs:complexType> + </xs:complexType> + + <xs:element name="findArgs" type="tns:findArgs" /> + <xs:element name="findReturn" type="tns:findReturn" /> + <xs:complexType name="findArgs"> + <xs:annotation> + <xs:documentation> + Wrapper containing the two ontologies to align and the usage + context to be used. + </xs:documentation> + </xs:annotation> + <xs:sequence> + <xs:element name="onto1" type="ontology:ontology" + minOccurs="0" maxOccurs="1" /> + <xs:element name="onto2" type="ontology:ontology" + minOccurs="0" maxOccurs="1" /> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="findReturn"> + <xs:annotation> + <xs:documentation> + Wrapper containing the computed annotation + </xs:documentation> + </xs:annotation> + <xs:sequence> + <xs:element name="annotation" type="model:annotation" + minOccurs="0" maxOccurs="unbounded" /> + </xs:sequence> + </xs:complexType> + + <xs:element name="retrieveArgs" type="tns:retrieveArgs" /> + <xs:element name="retrieveReturn" type="tns:retrieveReturn" /> + <xs:complexType name="retrieveArgs"> + <xs:annotation> + <xs:documentation> + Wrapper containing the two ontologies to align and the usage + context to be used. + </xs:documentation> + </xs:annotation> + <xs:sequence> + <xs:element name="usageContext" type="user:usageContext" + minOccurs="0" maxOccurs="1" /> + <xs:element name="align" type="model:annotation" + minOccurs="0" maxOccurs="1" /> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="retrieveReturn"> + <xs:annotation> + <xs:documentation> + Wrapper containing the computed annotation + </xs:documentation> + </xs:annotation> + <xs:sequence> + <xs:element name="annotation" type="model:annotation" + minOccurs="1" maxOccurs="1" /> + </xs:sequence> + </xs:complexType> + + <xs:element name="trimArgs" type="tns:trimArgs" /> + <xs:element name="trimReturn" type="tns:trimReturn" /> + <xs:complexType name="trimArgs"> + <xs:annotation> + <xs:documentation> + Wrapper containing the two ontologies to align and the usage + context to be used. + </xs:documentation> + </xs:annotation> + <xs:sequence> + <xs:element name="threshold" type="model:annotation" + minOccurs="1" maxOccurs="1" /> + <xs:element name="align" type="model:annotation" + minOccurs="1" maxOccurs="1" /> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="trimReturn"> + <xs:annotation> + <xs:documentation> + Wrapper containing the computed annotation + </xs:documentation> + </xs:annotation> + <xs:sequence> + <xs:element name="annotation" type="model:annotation" + minOccurs="1" maxOccurs="1" /> + </xs:sequence> + </xs:complexType> + + <xs:element name="storeArgs" type="tns:storeArgs" /> + <xs:element name="storeReturn" type="tns:storeReturn" /> + <xs:complexType name="storeArgs"> + <xs:annotation> + <xs:documentation> + Wrapper containing the two ontologies to align and the usage + context to be used. + </xs:documentation> + </xs:annotation> + <xs:sequence> + <xs:element name="align" type="model:annotation" + minOccurs="1" maxOccurs="1" /> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="storeReturn"> + <xs:annotation> + <xs:documentation> + Wrapper containing the computed annotation + </xs:documentation> + </xs:annotation> + <xs:sequence> + <xs:element name="annotation" type="model:annotation" + minOccurs="1" maxOccurs="1" /> + </xs:sequence> + </xs:complexType> + + <xs:element name="loadArgs" type="tns:loadArgs" /> + <xs:element name="loadReturn" type="tns:loadReturn" /> + <xs:complexType name="loadArgs"> + <xs:annotation> + <xs:documentation> + Wrapper containing the two ontologies to align and the usage + context to be used. + </xs:documentation> + </xs:annotation> + <xs:sequence> + <xs:element name="fileContent" type="model:annotation" + minOccurs="1" maxOccurs="1" /> + </xs:sequence> + </xs:complexType> + + <xs:complexType name="loadReturn"> + <xs:annotation> + <xs:documentation> + Wrapper containing the computed annotation + </xs:documentation> + </xs:annotation> + <xs:sequence> + <xs:element name="annotation" type="model:annotation" + minOccurs="1" maxOccurs="1" /> + </xs:sequence> + </xs:complexType> + <xs:element name="addResourceArgs" type="tns:addResourceArgs" /> <xs:element name="addResourceReturn" type="tns:addResourceReturn" /> <xs:complexType name="addResourceArgs"> diff --git a/plugins/webcontent/src/wsdl/model/model.xsd b/plugins/webcontent/src/wsdl/model/model.xsd index 8991f27b2d91d55d319d6ab460231e0c2703d9b5..55d9103e68762b36ec033c1dca481e9aeaddc0ed 100755 --- a/plugins/webcontent/src/wsdl/model/model.xsd +++ b/plugins/webcontent/src/wsdl/model/model.xsd @@ -106,7 +106,8 @@ <xs:complexContent> <xs:extension base="tns:resource"> <xs:sequence> - <xs:element name="data" type="xs:anyType" + <!--<xs:element name="data" type="xs:anyType"--> + <xs:element name="data" type="xs:string" minOccurs="1" maxOccurs="1"> <xs:annotation> <xs:documentation>