Skip to content
Joachim Neubert edited this page Aug 20, 2015 · 56 revisions

Amalgame: a SKOS vocabulary alignment tool http://semanticweb.cs.vu.nl/amalgame/

Table of Contents

Reference alignments

Amalgame supports two kinds of intellectually verified, so-called "reference alignments": The alignments created by (possibly multiple) manual evaluation processes, and alignments loaded from files.

Evaluation results

Amalgame seems to collect results of all manual evaluation steps in a graph named "manual_reference_alignment1" connected to the strategy.

Mapping files

Reference alignments can be loaded from files containing skos mappings (e.g., in Turtle syntax).

From the Amalgame main screen, choose "upload existing/reference alignment", and upload the file. The resulting graph gets a name like "http://localhost/ns/reference_alignment2". After the loaded graph has made known to the system (and is recognized as of rdf:type amalgame:LoadedMapping), it seems like it can be updated via "Repository -> Load local file", setting the aforementioned base URI. This could be used to aggregate alignments in a text file, and to update the graph after every addition to the file.

Once you have uploaded at least one such a graph, you should see an extra "Matcher" component called "import/preloaded" in the builder interface, which you can use to associate the uploaded file with your strategy.
To do so, use the interface to match the source/target concepts in the preloaded alignments in the file with the source/target concepts in the vocabularies of your strategy. This will make sure that correspondences between concepts from other vocabularies are ignored in further computations. If your alignment contains only such correspondences, it is a no-op that at least nicely integrates the preloaded correspondences in your strategy workflow.
Once you have the preloaded alignment in your strategy, you can either use it as just another in input in your strategy, and/or mark it with the new status "reference" in case it will be used to compute the reference statistics along with any manual evaluation graph that you will have created and also marked as having the "reference" status. In case you want to reuse manual evaluation graphs from previous versions: just mark them with status reference and you should be fine. (Email by Jacco, 2014-07-09)

Setup

Register namespaces

On the prolog command line:

  rdf_db:rdf_register_prefix('zbwext', 'http://zbw.eu/namespaces/zbw-extensions/').
  rdf_db:rdf_register_prefix('sdmx', 'http://purl.org/linked-data/sdmx/2009/subject#').

Add missing skos:inScheme properties

Amalgame needs them to know which resources are part of a scheme.

  /* Fourth parameter in assert must match the graph name given when loading sdmx */
  
  /* add top concepts to scheme */
  findall(T,
    rdf_db:rdf(sdmx:subjectMatterDomain, skos:hasTopConcept, T),
    Triples),
  forall(member(T, Triples),
    rdf_db:rdf_assert(T, skos:inScheme, sdmx:subjectMatterDomain, 'http://purl.org/linked-data/sdmx/2009/subject#')
  ).
  
  /* add concepts to scheme, which have broader concepts in scheme */
  /* (not transitive - repeat!) */
  findall(N-B,
    ( rdf_db:rdf(N, skos:broader, B),
      rdf_db:rdf(B, skos:inScheme, sdmx:subjectMatterDomain)
    ),
    Triples
  ),
  forall(member(N-B, Triples),
    rdf_db:rdf_assert(N,skos:inScheme,sdmx:subjectMatterDomain, 'http://purl.org/linked-data/sdmx/2009/subject#')
  ).  

Installation on Redhat/CentOS

Amalgame is based on ClioPatria, which is requires the latest version of SWI-Prolog.

Install SWI Prolog

SWI-Prolog pl-devel (7.1.x) on CentOS 6.5

1) Dependencies are installed as described below for SWI-Prolog 6.6.5

2) The installation procedure for 7.1.x requires autoconf >= 2.66, which doesn't seem to be available via yum (at least not in rpmforge or epel). Therefore build and install a recent version of autoconf to /root/bin:

  cd /tmp
  wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
  tar xzfv autoconf-2.69.tar.gz
  cd autoconf-2.69
  ./configure --prefix=/root
  make
  make install
  export PATH=/root/bin:$PATH

3) Clone pl-devel

  cd /tmp
  git clone git://www.swi-prolog.org/home/pl/git/pl-devel.git

and follow http://www.swi-prolog.org/build/unix.html

Set in build

  PREFIX=/usr/local

or, for a parallel installation in a temporary directory,

  PREFIX=/tmp/swi-prolog

4) If installed in a temporary directory, set the shebang in ./run.pl to

  #!/tmp/swi-prolog/bin/swipl

and in /etc/init.d/swipl-httpd, set

  SWIPL=/tmp/swi-prolog/bin/swipl

SWI-Prolog 6.6.5 on CentOS 6.5

1) Install dependencies as indicated in http://www.swi-prolog.org/build/Redhat.html, plus

  gcc 
  graphviz # (optional, for graphics)
  redhat-lsb # (optional, for system startup script)

2) Follow http://www.swi-prolog.org/build/unix.html

Set in build

  PREFIX=/usr/local

CentOS 5.x

Did not work - see http://www.swi-prolog.org/bugzilla/show_bug.cgi?id=76 (for CentOS 5.10 and SWI-Prolog 6.6.5, too).

Install ClioPatria and Amalgame

Current description for Running ClioPatria as a service on Ubuntu.

ClioPatria can be installed with SSL support (which requires a .pem certificate at a location defined in config-enabled/https.pl). However, it may be an better option to let apache handle https and hide amalgame behind a reverse proxy (see below).

Installing multiple Amalgame instances:

  # install cliopatria in a central location
  cd /opt
  git clone https://github.com/SWI-Prolog/ClioPatria.git
  
  # install amalgame - this can be done in multiple parallel directories
  mkdir amalgame-test
  cd amalgame-test
  ../ClioPatria/configure --without-debug --with-lod --with-logging --with-020-prefixes
  
  ./run.pl
    ?- cpack_install('amalgame').

Invoke http://localhost:3020 and set password for 'admin', or copy users.db and settings.db from prior installations. Ports must be set differently, e.g. by the startup script.

Permissions

  touch settings.db users.db  

Write permission must be granted to the user referenced in the startup script for the following subtrees:

  ./RDF-store
  ./cpack/amalgame/web/alignment_results
  ./*.db

Set up Apache reverse proxy

Add to ./settings.db:

  % Prefix for all locations of this server
  setting(http:prefix, '/amalgame-test').

Create /etc/httpd/conf.d/amalgame.conf

  ProxyPass /amalgame-test http://127.0.0.1:30201/amalgame-test
  ProxyPassReverse /amalgame-test http://127.0.0.1:30201/amalgame-test

Startup script

Cliopatria debian-init-script requires the functions log_daemon_msg and log_end_msg, which are not available in RH/Centos 6.5 lsb packages (and not defined in LSB 4.1).

Workarround: Replace with log_success_msg and log_failure_msg.

Maintenance

Upgrade a package

  ?- cpack_upgrade('amalgame').
  ?- make.
  ?- rdf_db:rdf_make.

(Also cleans up temporary graphs and reloads/updates the amalgame ontology).

If installed with multiple instances as described above, update Cliopatria, too:

  git pull

in the main Cliopatria installation directory.

Clean up graphs

  ?- make.

Cleans up generated named graphs from intermediary results (+ cache).

Enhance deug level

  ?- debug(ag_expand).

Versioning, backup and recovery

  • After changes in a strategy, export via "Publish".
  • Files are saved in cpack/amalgame/web/alignment_results , and can be checked into Git. Sequence of triple seems to be preserved.
  • When the contents of the RDF-store directory becomes damaged or is lost completely, it can be recovered:
    • Clean up/move away the subdirectories of the RDF-store directory.
    • Look up the graph names which where assigned to the data files in the original load, in provBundle (e.g., strategy1/provBundle2.ttl ) as object of an "amalgame:loaded" statement.
    • Load the data files with the looked up graph names.
    • Use function "upload strategy or clone execution trace" to upload the lost strategy. The URL can be derived from the files (e.g., http://myhost/myamalgameinstance/alignment_results/strategy1/strategy1.ttl).

Weblinks