BlueBrain / nexus-forge

Building and Using Knowledge Graphs made easy
https://nexus-forge.readthedocs.io
GNU Lesser General Public License v3.0
38 stars 19 forks source link

EXACT_CASEINSENSITIVE_MATCH not resolving #276

Closed lecriste closed 1 year ago

lecriste commented 1 year ago

The EXACT_MATCH strategy is resolving a label that EXACT_CASEINSENSITIVE_MATCH is not:

forge.resolve("PV+", scope="ontology", target="terms", strategy="EXACT_MATCH")
Resource(_last_action=None, _validated=False, _synchronized=False, _store_metadata=None, id='https://bbp.epfl.ch/ontologies/core/bmo/PV+', type=['NeuronMolecularType', 'Class'], label='PV+', _inner_sync=False, isDefinedBy='https://bbp.epfl.ch/ontologies/core/bmo', subClassOf='bmo:NeuronMolecularType')

forge.resolve("PV+", scope="ontology", target="terms", strategy="EXACT_CASEINSENSITIVE_MATCH")
crisely09 commented 1 year ago

There is a problem with special characters, I need to find a way to identify them and pass the correctly to the SPARQL Filter or other solution

lecriste commented 1 year ago

I found two cases in which the returned resource is not the expected one:

  1. 'Mc' is resolved to Olfactory Bulb Main Mitral Cell instead of Neocortex Martinotti Cell
  2. 'Bac' is resolved to Mesh of Bed nucleus of the anterior commissure instead of Burst accommodating electrical type

As we discussed in person, we may want to apply a resolving priority among label, prefLabel, altLabel, notation, ...

The 'Mc' issue is probably due to a swap between label and altLabel in the registered resource.

eleftherioszisis commented 1 year ago

This issue has also been encountered in cell composition registration:

Different case-insensitive resolved label: input 'bAC', resolved 'Bed nucleus of the anterior commissure'
MFSY commented 1 year ago

Hi here. Is this resolved ?

MFSY commented 1 year ago

Two solutions are available here:

The following case has to do with two cell types having the exact notation MC. So we should avoid and test that we do not have the same notation used more than one time in the same ontology. I recommend to use OBMMC for Olfactory Bulb Main Mitral Cell and keep MC for Martinotti Cell.