filak / MTW-MeSH

Medical Subject Headings (MeSH) Translation Workflow
https://github.com/filak/MTW-MeSH/wiki
MIT License
6 stars 1 forks source link

Better relevancy while searching #37

Open filak opened 10 months ago

filak commented 10 months ago

Try to use propLists

https://jena.apache.org/documentation/query/text-query.html#lists-of-indexed-properties

text:propLists (
    [ text:propListProp mesht:defQuery ;
      text:props ( 
         rdfs:label
         meshv:identifier 
         meshv:prefLabel
         meshv:altLabel
         meshv:casn1_label
         meshv:registryNumber
         meshv:relatedRegistryNumber
             mesht:identifier 
             mesht:prefLabel
             mesht:altLabel
             mesht:casn1_label
          ) ;
    ]
    [ text:propListProp mesht:includeNotes ;
      text:props ( 
         rdfs:label
         meshv:identifier 
         meshv:prefLabel
         meshv:altLabel
         meshv:casn1_label
         meshv:registryNumber
         meshv:relatedRegistryNumber
             mesht:identifier 
             mesht:prefLabel
             mesht:altLabel
             mesht:casn1_label
                mesht:translatorsNote
                mesht:annotation
                mesht:historyNote
                mesht:scopeNote
          meshv:annotation
          meshv:historyNote
          meshv:note
          meshv:onlineNote
          meshv:publicMeSHNote
          meshv:scopeNote
         ) ;
    ]
) ;

Add filter - checkbox - to the form (searchForm)

{% set prop_list = 'mesht:defQuery' %}
{% if includeNotes == 'yes' %}
    {% set prop_list = 'mesht:includeNotes' %}
{% endif %}

  {% if slang == 'target' %}
    (?s ?score) text:query ({{ prop_list }} "{{ query }}" 500 "lang:{{ lang }}") .
  {% elif slang == 'source' %}
    (?s ?score) text:query ({{ prop_list }} "{{ query }}" 500 "lang:en") .
  {% else %}
    (?s ?score) text:query ({{ prop_list }} "{{ query }}" 500) .
  {% endif %}
...
filak commented 10 months ago

propLists not working as expected - more testing is needed...

There are some issues with Jena

filak commented 8 months ago

Waiting for this to be merged https://github.com/apache/jena/pull/2121 - Done!

filak commented 7 months ago

Lets wait for the 5.0 Apache Jena release...

filak commented 4 months ago

Apache Jena 5.0 released

To be done in MTW version 1.7.0 - Jena must be upgraded - possible breaking change