vivo-project / VIVO

VIVO is an extensible semantic web application for research discovery and showcasing scholarly work
http://vivoweb.org
BSD 3-Clause "New" or "Revised" License
206 stars 129 forks source link

Replacement of language comparisons using '=' by the 'langMatches' #3789

Closed michel-heon closed 1 year ago

michel-heon commented 2 years ago

Issue #3767 Problems associated with the use of sparqlContentTripleSource in the applicationSetup.n3 configuration file:

What does this pull request do?

This PR fixes the language context management issue in the Capability Map when using VIVO which uses AWS-Neptune TripleStore

What's new?

As described in the issue, VIVO's CapabilityMap using AWS-Neptune as a TripleStore is not working properly. The malfunction is related to the disfunction of the expertise search bar. The cause of this malfunction is that, unlike the other triple stores, the linguistic value of the tags is stored in lower case. For example: the term "Label"@en-CA is actually stored in AWS-Neptune as "Label"@en-ca. The solution is to modify the SPARQL queries in the Java code so that the filters process the language parameters regardless of case sensitivity.

Here is a code sample to be replaced

FILTER (LANG(?orgLabelSecondary) = '" + language + "') \n" +

Replacement code example

FILTER (langMatches(lang(?orgLabelSecondary), '" + language+"' ) ) \n"

How should this be tested?

VIVO installation using AWS-Neptune

  1. Installing AWS-Neptune To reproduce the BUG, it is absolutely necessary to install an instance of AWS-Neptune. The following documentation Setting up Neptune allows to install a Neptune instance.

    1. Installing VIVO (master branch)
      • Extract and compile VIVO
      • Install a VIVO-home according to the specifications indicated by VIVO's documentations:

Using web-based triple stores Fuseki as alternate triple store

  1. Run VIVO and load Sample Data After starting VIVO, you can download the sample data contained at: -VIVO Sample data Repo Upload files:

sample-data-i18n-de_DE.ttl sample-data-i18n-en_CA.ttl sample-data-i18n-en_US.ttl sample-data-i18n-fr_CA.ttl sample-data-i18n-fr_FR.ttl sample-data-i18n.ttl

  1. Observe the problem Browse the CapabilityMap and try to search for an expertise. You will see that it is not possible to perform a search.
  1. Evaluate the RP
    • Stop VIVO; extract the code from the PR, compile VIVO; and start VIVO
    • Browse the CapabilityMap and try to search for an expertise. You will see that it is possible to perform a search.

Additional Notes:

see also:

Interested parties

@VIVO-project/vivo-committers

michel-heon commented 2 years ago

@wwelling You're absolutely right that the old WEBPAGE_QUERY_ that I left in place to facilitate the review should be removed. This page was difficult for me to review since I could not identify the use case for this part of the code. I made the changes, I validated the syntax of the SPARQL code but I could not launch its execution