Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Feb 17, 2023

Conversation

michel-heon
Copy link
Member

@michel-heon michel-heon commented Oct 30, 2022

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.

  2. 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.

  2. 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

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use of langMatches looks good and make sense. However, we shouldn't keep the commented-out lines and not sure the value of keeping the old WEBPAGE_QUERY_. Removing the commented-out lines and replacing WEBPAGE_QUERY instead of adding a new query would better represent the changes and make for clear review.

@michel-heon
Copy link
Member Author

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants