diff --git a/build.xml b/build.xml index a46e5a0f729ccfb1b83ccaf726a8744138048a43..c01367490a9cd790f12e92103438f23ead14ee7c 100644 --- a/build.xml +++ b/build.xml @@ -155,11 +155,10 @@ <attribute name="group" description="Maven group ID" /> <attribute name="file" description="Artifact name" /> <attribute name="desc" description="Description" /> - <attribute name="main" description="Main class to call" default=""/> - <attribute name="pack" description="Exported packages" /> - <attribute name="impt" description="Imported packages" default="" /> + <attribute name="main" description="Main class to call" default="" /> <attribute name="path" description="Class path" default="" /> - <attribute name="contentid" description="The fileset Id of the files to include" /> + <element name="files" description="The fileset Id of the files to include" /> + <element name="extramanifest" description="The part of included manifest" optional="yes"/> <sequential> <delete file="lib/@{file}.jar"/> <!-- it may even be easier to generate the pom --> @@ -180,19 +179,12 @@ <attribute name="Class-Path" value="@{path}"/> <attribute name="Implementation-Title" value="@{desc}"/> <attribute name="Implementation-Version" value="${version} (${svn.rev})"/> - <attribute name="Bundle-Name" value="@{desc}"/> - <attribute name="Bundle-SymbolicName" value="@{file}"/> - <attribute name="Bundle-Version" value="${version} (${svn.rev})"/> - <attribute name="Bundle-Copyright" value="INRIA, ${copyyear}"/> - <attribute name="Bundle-Date" value="${date}"/> - <attribute name="Bundle-License" value="GNU Lesser General Public License 2.1 or above"/> - <attribute name="Export-package" value="@{pack}"/> - <attribute name="Import-package" value="@{impt}"/> </manifest> + <extramanifest /> <!-- This should be achieved with a metainf tag, but not working --> <zipfileset file="classes/LICENSE.TXT" fullpath="META-INF/LICENSE.TXT" /> <zipfileset file="lib/@{file}.pom" fullpath="META-INF/maven/@{group}/@{file}/pom.xml" /> - <fileset refid="@{contentid}" /> + <files /> </jar> </sequential> </macrodef> @@ -203,60 +195,77 @@ <copy file="distrib/LICENSE.TXT" tofile="classes/LICENSE.TXT" filtering="true"/> <!-- align.jar --> - <fileset id="alignset" dir="classes"> - <include name="org/semanticweb/owl/align/*.class"/> - </fileset> <onejar file="align" group="org.semanticweb.owl" - desc="Alignment API" - pack="org.semanticweb.owl.align" - contentid="alignset" /> + desc="Alignment API"> + <files> + <fileset dir="classes"> + <include name="org/semanticweb/owl/align/*.class"/> + </fileset> + </files> + </onejar> <!-- ontowrap.jar --> <copy file="src/fr/inrialpes/exmo/ontowrap/skoslite/skos.rdf" tofile="classes/fr/inrialpes/exmo/ontowrap/skoslite/skos.rdf" /> - <fileset id="wrapset" dir="classes"> - <include name="fr/inrialpes/exmo/ontowrap/**/*.class" /> - <include name="fr/inrialpes/exmo/ontowrap/**/*.rdf"/> - </fileset> <onejar file="ontowrap" group="fr.inrialpes.exmo" desc="Ontology wrapper" - path="jena/arq.jar jena/icu4j.jar jena/iri.jar jena/jena.jar skosapi/skosapi.jar owlapi10/api.jar owlapi10/impl.jar owlapi10/io.jar owlapi10/rdfapi.jar owlapi10/rdfparser.jar owlapi3/owlapi-bin.jar" - pack="fr.inrialpes.exmo.ontowrap,fr.inrialpes.exmo.ontowrap.jena25,fr.inrialpes.exmo.ontowrap.owlapi10,fr.inrialpes.exmo.ontowrap.owlapi30,fr.inrialpes.exmo.ontowrap.util" - contentid="wrapset" /> + path="jena/arq.jar jena/icu4j.jar jena/iri.jar jena/jena.jar skosapi/skosapi.jar owlapi10/api.jar owlapi10/impl.jar owlapi10/io.jar owlapi10/rdfapi.jar owlapi10/rdfparser.jar owlapi3/owlapi-bin.jar"> + <files> + <fileset dir="classes"> + <include name="fr/inrialpes/exmo/ontowrap/**/*.class" /> + <include name="fr/inrialpes/exmo/ontowrap/**/*.rdf"/> + </fileset> + </files> + </onejar> <!-- procalign.jar --> - <fileset id="procset" dir="classes"> - <include name="fr/inrialpes/exmo/align/impl/**/*.class"/> - <include name="fr/inrialpes/exmo/align/parser/**/*.class"/> - <include name="fr/inrialpes/exmo/align/util/**/*.class"/> - <include name="fr/inrialpes/exmo/align/cli/**/*.class"/> - <include name="fr/inrialpes/exmo/align/gen/**/*.class"/> - <include name="fr/inrialpes/exmo/align/ling/**/*.class"/> - </fileset> <onejar file="procalign" group="fr.inrialpes.exmo.align" desc="Alignment API implementation" main="fr.inrialpes.exmo.align.cli.Procalign" - pack="fr.inrialpes.exmo.align.impl,fr.inrialpes.exmo.align.impl.edoal,fr.inrialpes.exmo.align.impl.eval,fr.inrialpes.exmo.align.impl.method,fr.inrialpes.exmo.align.impl.rel,fr.inrialpes.exmo.align.impl.renderer,fr.inrialpes.exmo.align.ling,fr.inrialpes.exmo.align.parser,fr.inrialpes.exmo.align.util,fr.inrialpes.exmo.align.cli,fr.inrialpes.exmo.align.gen" - impt="fr.inrialpes.exmo.ontowrap,fr.inrialpes.exmo.ontowrap.jena25,fr.inrialpes.exmo.ontowrap.owlapi10,fr.inrialpes.exmo.ontowrap.owlapi30,fr.inrialpes.exmo.ontowrap.util,org.semanticweb.owl.align" - path="skosapi/skosapi.jar owlapi30/owlapi-bin.jar ontosim/ontosim.jar getopt/getopt.jar slf4j/jcl-over-slf4j.jar slf4j/log4j-over-slf4j.jar slf4j/slf4j-api.jar jwnl/jwnl.jar lucene/lucene-core.jar jena/jena.jar jena/iri.jar jena/icu4j.jar iddl/iddl.jar xerces/xercesImpl.jar xerces/resolver.jar xerces/xml-apis.jar hermit/hermit.jar align.jar ontowrap.jar procalign.jar" - contentid="procset" /> + path="skosapi/skosapi.jar owlapi30/owlapi-bin.jar ontosim/ontosim.jar getopt/getopt.jar slf4j/jcl-over-slf4j.jar slf4j/log4j-over-slf4j.jar slf4j/slf4j-api.jar jwnl/jwnl.jar lucene/lucene-core.jar jena/jena.jar jena/iri.jar jena/icu4j.jar iddl/iddl.jar xerces/xercesImpl.jar xerces/resolver.jar xerces/xml-apis.jar hermit/hermit.jar align.jar ontowrap.jar procalign.jar"> + <files> + <fileset dir="classes"> + <include name="fr/inrialpes/exmo/align/impl/**/*.class"/> + <include name="fr/inrialpes/exmo/align/parser/**/*.class"/> + <include name="fr/inrialpes/exmo/align/util/**/*.class"/> + <include name="fr/inrialpes/exmo/align/cli/**/*.class"/> + <include name="fr/inrialpes/exmo/align/gen/**/*.class"/> + <include name="fr/inrialpes/exmo/align/ling/**/*.class"/> + </fileset> + </files> + </onejar> <!-- alignsvc.jar --> <copy file="src/fr/inrialpes/exmo/align/service/aserv.wsdl" tofile="classes/fr/inrialpes/exmo/align/service/aserv.wsdl" filtering="false"/> - <fileset id="servset" dir="classes"> - <include name="fr/inrialpes/exmo/align/service/**/*.class"/> - <include name="fr/inrialpes/exmo/align/service/**/*.wsdl"/> - <include name="fr/inrialpes/exmo/queryprocessor/**/*.class"/> - </fileset> <onejar file="alignsvc" group="fr.inrialpes.exmo.align" desc="Alignment server" main="fr.inrialpes.exmo.align.service.AlignmentService" - pack="fr.inrialpes.exmo.align.queryprocessor,fr.inrialpes.exmo.align.service,fr.inrialpes.exmo.align.service.jade,fr.inrialpes.exmo.align.service.jade.messageontology" - path="procalign.jar jade/jade.jar jade/iiop.jar jade/http.jar jdbc/mysql-connector-java.jar jdbc/postgresql-jdbc4.jar servlet/servlet-api.jar jetty/jetty.jar jetty/jetty-util.jar xerces/xercesImpl.jar" - contentid="servset" /> + path="procalign.jar osgi/osgi-core.jar jade/jade.jar jade/iiop.jar jade/http.jar jdbc/mysql-connector-java.jar jdbc/postgresql-jdbc4.jar servlet/servlet-api.jar jetty/jetty.jar jetty/jetty-util.jar xerces/xercesImpl.jar"> + <files> + <fileset dir="classes"> + <include name="fr/inrialpes/exmo/align/service/**/*.class"/> + <include name="fr/inrialpes/exmo/align/service/**/*.wsdl"/> + <include name="fr/inrialpes/exmo/queryprocessor/**/*.class"/> + </fileset> + </files> + <extramanifest> + <!-- This is all for OSGI --> + <manifest> + <attribute name="Bundle-Name" value="Alignment server"/> + <attribute name="Bundle-SymbolicName" value="alignsvc"/> + <attribute name="Bundle-Version" value="${version} (${svn.rev})"/> + <attribute name="Bundle-Copyright" value="INRIA, ${copyyear}"/> + <attribute name="Bundle-Date" value="${date}"/> + <attribute name="Bundle-License" value="GNU Lesser General Public License 2.1 or above"/> + <attribute name="Bundle-Activator" value="fr.inrialpes.exmo.align.service.osgi.OSGIAServProfile"/> + <attribute name="Export-package" value="fr.inrialpes.exmo.align.service"/> + <attribute name="Import-package" value="org.osgi.framework"/> + </manifest> + </extramanifest> + </onejar> </target> <!-- tested --> @@ -312,7 +321,7 @@ </javac> <!-- possible groups: raw=impl+serv+io+onto+omwg, full=raw+ling+sem --> <!-- ling requires WordNet and takes ages initialising it --> - <testng groups="raw" + <testng groups="full" outputDir="test/html" verbose="1" haltOnFailure="false" failureProperty="failed"> <!-- if ones uses logback --> @@ -528,6 +537,7 @@ <onepom file="slf4j/log4j-over-slf4j" /> <onepom file="lucene/lucene-core" /> <onepom file="ontosim/ontosim" /> + <onepom file="osgi/osgi-core" /> <onepom file="owlapi10/api" /> <onepom file="owlapi10/impl" /> <onepom file="owlapi10/io" /> diff --git a/distrib/alignsvc.pom b/distrib/alignsvc.pom index 5fd697864cbba6bfc88340869d615b0cc9e038e4..2d89efcd59ff749c7b195a48f155dd25465f17ee 100644 --- a/distrib/alignsvc.pom +++ b/distrib/alignsvc.pom @@ -77,6 +77,10 @@ <groupId>org.neon_toolkit.registery</groupId> <artifactId>oyster2</artifactId> </dependency> + <dependency> + <groupId>org.knopflerfish</groupId> + <artifactId>framework</artifactId> + </dependency> <dependency> <groupId>javax</groupId> <artifactId>servlet</artifactId> diff --git a/html/lib.html b/html/lib.html index e90974a7e7c314fcfd603aa328ce002ac043b9c4..176c3a256a7840ac293d6a0ea62d38be77f2f7f7 100644 --- a/html/lib.html +++ b/html/lib.html @@ -53,10 +53,10 @@ This is a simplified view: <a href="img/dependencies.png">click here <h3>Required for using EDOAL</h3> <dl> -<dt><a href="http://jena.sourceforge.net/">Jena</a> 2.6.2: - jena.jar icu4j.jar iri.jar arq.jar [<a href="http://www.opensource.org/licenses/bsd-license.php">BSD*</a>]</dt> +<dt><a href="http://jena.sourceforge.net/">Jena</a> 2.7.0-incubating: + jena.jar icu4j.jar iri.jar arq.jar [<a href="http://www.apache.org/licenses/LICENSE-2.0.txt">Apache</a>]</dt> <dd>Provides the RDF parser.</dd> -<dt><a href="http://xerces.apache.org">Xerces</a> 2.9.1: xercesImpl.jar resolver.jar xml-apis.jar [<a href="http://www.apache.org/licenses/LICENSE-2.0.html">Apache</a>]</dt> +<dt><a href="http://xerces.apache.org">Xerces</a> 2.10.0: xercesImpl.jar resolver.jar xml-apis.jar [<a href="http://www.apache.org/licenses/LICENSE-2.0.html">Apache</a>]</dt> <dd>Required by Jena for parsing international characters.</dd--> </dl> @@ -86,7 +86,7 @@ In addition to OntoSim, JWNLAlignment requires JWNL. <dt><a href="http://iddl.gforge.inria.fr">DRAOn</a> (or IDDL) 1.5: iddl.jar [<a href="http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html">LGPL</a>]</dt> <dd>In turns it requires HermiT.</dd> <dt><a href="http://www.hermit-reasoner.com/">HermiT</a> 1.3.6: - [<a href="http://www.gnu.org/licenses/old-licenses/lgpl-3.0.html">LGPL</a>]</dt> + hermit.jar [<a href="http://www.gnu.org/licenses/old-licenses/lgpl-3.0.html">LGPL</a>]</dt> <dd>Provides OWL Reasoning. It requires the OWL API.</dd> </dl> @@ -99,7 +99,7 @@ delete the subdirectories <tt>src/fr/inrialpes/exmo/ontowrap/xxxx</tt> and this will compile again. </p> <dl> -<dt><a href="http://owlapi.sourceforge.org">OWL API</a> 3.0: +<dt><a href="http://owlapi.sourceforge.org">OWL API</a> 3.4.2: owlapi-bin.jar [<a href="http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html">LGPL</a>]</dt> <dd>Provides parsing and API to OWL entities. Used by OWLAPIAlignments. api.jar is required for compiling, the others are @@ -151,6 +151,13 @@ and this will compile again. <dl> </dl> +<h3>Required for the OSGI plug-in</h3> + +<dl> +<dt><a href="http://www.osgi.org/">OSGi core framework </a> 5.0.0: osgi-core.jar [<a href="http://www.apache.org/licenses/LICENSE-2.0.html">Apache</a>]</dt> +<dd>Required by alignsvc (OSGi version).</dd> +</dl> + <dl> <dd></dd> <dt><a href=""></a> </dt> diff --git a/html/relnotes.html b/html/relnotes.html index b5e25b007c7cc1123f5bab74a555d17dd8e7f969..eda8d8663cf6e9997bdf40b0cc301e1ca3c76c2d 100644 --- a/html/relnotes.html +++ b/html/relnotes.html @@ -75,8 +75,12 @@ with a warning: <!--h2>Version 4.8 (1xxx): ??/??/201x - Antésine</h2--> <!--h2>Version 4.7 (1xxx): ??/??/201x - Letraset</h2--> <!--h2>Version 4.6 (1xxx): ??/??/201X - Da lec'h all</h2--> +<p><ul compact="1"> +<li>Declared Alignment server as an OSGi service (server)</li> +</ul></p> <h2>Version 4.5 (1847): 25/03/2013 - Building 16</h2> + <p><ul compact="1"> <li>Added several EDOAL-SPARQL renderers (impl)</li> <li>Added <tt>ontowrap</tt> support in database store (server)</li> diff --git a/lib/jena/jena.pom b/lib/jena/jena.pom index 3ae783e6a2733264776127dfbea47b541e9ec38f..f644348c0d8b3d10669920dd4064d4420e9d5486 100644 --- a/lib/jena/jena.pom +++ b/lib/jena/jena.pom @@ -15,9 +15,9 @@ </licenses> <url></url> - <distributionManagement> + <!--distributionManagement> <downloadUrl></downloadUrl> - </distributionManagement> + </distributionManagement--> <!-- There is a decent pom in the Jar-file --> <!--dependencies> diff --git a/lib/osgi/osgi-core.jar b/lib/osgi/osgi-core.jar new file mode 100644 index 0000000000000000000000000000000000000000..583d4a20e3a6a16bd3fe13797995203401121390 Binary files /dev/null and b/lib/osgi/osgi-core.jar differ diff --git a/lib/osgi/osgi-core.pom b/lib/osgi/osgi-core.pom new file mode 100644 index 0000000000000000000000000000000000000000..b06339491e1b26d8ce0fc3157adba585d71675d5 --- /dev/null +++ b/lib/osgi/osgi-core.pom @@ -0,0 +1,22 @@ +<project> + <modelVersion>4.0.0</modelVersion> + + <groupId>org.osgi</groupId> + <artifactId>framework</artifactId> + <version>5.0.0</version> + <name>OSGI framework</name> + <description>OSGI core framework</description> + <packaging>jar</packaging> + <licenses> + <license> + <name>Apache License Version 2.0, January 2004</name> + <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> + </license> + </licenses> + + <url>http://www.osgi .org/</url> + <!--distributionManagement> + <downloadUrl></downloadUrl> + </distributionManagement--> + +</project> diff --git a/src/fr/inrialpes/exmo/align/service/osgi/OSGIAServProfile.java b/src/fr/inrialpes/exmo/align/service/osgi/OSGIAServProfile.java new file mode 100644 index 0000000000000000000000000000000000000000..2ccd804faeee117ca012b06ccc5af4976ae7080c --- /dev/null +++ b/src/fr/inrialpes/exmo/align/service/osgi/OSGIAServProfile.java @@ -0,0 +1,92 @@ +/* + * $Id$ + * + * Copyright (C) INRIA, 2010, 2013 + * + * 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.osgi; + +import java.util.Hashtable; +import java.util.Properties; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.osgi.framework.BundleActivator; +import org.osgi.framework.BundleContext; +import org.osgi.framework.ServiceRegistration; +import org.osgi.framework.Constants; + +import fr.inrialpes.exmo.align.service.AlignmentServiceProfile; +import fr.inrialpes.exmo.align.service.AServProtocolManager; +import fr.inrialpes.exmo.align.service.AServException; + +/** + * OSGIAServProvile: OSGI Service profile for the Alignment server + * + */ + +public class OSGIAServProfile implements AlignmentServiceProfile, BundleActivator { + final static Logger logger = LoggerFactory.getLogger( OSGIAServProfile.class ); + + private AServProtocolManager manager; + + private String myId; + private String serverURL; + private int localId = 0; + + public static BundleContext ctxt = null; + + // AlignmentServiceProfile interface + public void init( Properties params, AServProtocolManager manager ) throws AServException { + this.manager = manager; + } + + public void close(){ + // This may unregister the WSDL file to some directory + stop( ctxt ); + } + + /** + * Implements BundleActivator.start(). Registers an + * instance of a dictionary service using the bundle context; + * attaches properties to the service that can be queried + * when performing a service look-up. + * @param context the framework context for the bundle. + **/ + public void start( BundleContext context ) { + ctxt = context; + logger.debug( "{} starting... ", ctxt.getBundle().getHeaders().get(Constants.BUNDLE_NAME) ); + // I am not sure that my goal is to create a new one... we have it already, right? + //manager = new AServProtocolManager(); + Hashtable<String,String> serviceProperties = new Hashtable<String,String>(); + serviceProperties.put( "lang", "EN-uk" ); // an example + ServiceRegistration reg = ctxt.registerService( Service.class.getName(), manager, serviceProperties ); + } + + /** + * Implements BundleActivator.stop(). Does nothing since + * the framework will automatically unregister any registered services. + * @param context the framework context for the bundle. + **/ + public void stop( BundleContext context ) { + logger.debug( "{} stoping... ", ctxt.getBundle().getHeaders().get(Constants.BUNDLE_NAME) ); + ctxt = null; + } + +} + diff --git a/src/fr/inrialpes/exmo/align/service/osgi/Service.java b/src/fr/inrialpes/exmo/align/service/osgi/Service.java new file mode 100644 index 0000000000000000000000000000000000000000..d904310235ddd6a38c23d75fee8a081de0f5be6d --- /dev/null +++ b/src/fr/inrialpes/exmo/align/service/osgi/Service.java @@ -0,0 +1,123 @@ +/* + * $Id$ + * + * Copyright (C) INRIA, 2013 + * + * 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.osgi; + +import java.util.Set; +import java.util.Collection; +import java.net.URI; + +import org.semanticweb.owl.align.Alignment; + +import fr.inrialpes.exmo.align.service.msg.Message; + +/** + * So far, AServProtocol implements directly this service interface + * No additional code is necessary. + * However, it may be more useful to provide an implementation that + * decodes all messages in Java objects. + * This may be necessary as a second step. + */ +public interface Service { + + public Set<String> listmethods (); + + public Set<String> listrenderers(); + + public Set<String> listservices(); + + public Set<String> listevaluators(); + + public Collection<Alignment> alignments(); + + public Collection<URI> ontologies(); + + public Collection<Alignment> alignments( URI uri1, URI uri2 ); + + public String query( String query ); + + public String serverURL(); + + public String argline(); + + /********************************************************************* + * Basic protocol primitives + *********************************************************************/ + + public Message load( Message mess ); + + public Message align( Message mess ); + + public Message existingAlignments( Message mess ); + + public Message findCorrespondences( Message mess ); + + public Message find( Message mess ); + + public Message translate( Message mess ); + + public Message render( Message mess ); + + /********************************************************************* + * Extended protocol primitives + *********************************************************************/ + + public Message store( Message mess ); + + //public Message erase( Message mess ); + + public Message metadata( Message mess ); + + /********************************************************************* + * Extra alignment primitives + * + * All these primitives must create a new alignment and return its Id + * There is no way an alignment server could modify an alignment + *********************************************************************/ + + public Message trim( Message mess ); + + public Message harden( Message mess ); + + public Message inverse( Message mess ); + + public Message meet( Message mess ); + + public Message join( Message mess ); + + public Message compose( Message mess ); + + public Message eval( Message mess ); + + public Message diff( Message mess ); + + public boolean storedAlignment( Message mess ); + + /********************************************************************* + * Network of alignment server implementation + *********************************************************************/ + + /********************************************************************* + * Utilities: reaching and loading ontologies + *********************************************************************/ + + //public LoadedOntology reachable( URI uri ); + +}