Skosmos icon indicating copy to clipboard operation
Skosmos copied to clipboard

Skosmos is generating TextIndexParseExceptions

Open joelit opened this issue 4 years ago • 0 comments

This doesn't seem to affect end-users, but I noticed Skosmos generates a steady amount of org.apache.jena.query.text.TextIndexParseExceptions in its fuseki log. I could replicate the likely situation as a following query (part of a larger generated query):

        SELECT DISTINCT ?s ?label ?notation (?matchstr AS ?hit)
        WHERE {
          {
            {
              VALUES (?prop) { (skos:prefLabel) (skos:altLabel) (skos:hiddenLabel) }
              VALUES (?prop ?pri ?langParam) { (skos:prefLabel 1 'lang:fi*') (skos:altLabel 3 'lang:fi*') (skos:notation 5 '') (skos:hiddenLabel 7 'lang:fi*')}

              (?s ?score ?match) text:query (?prop 'NOT' 100000 ?langParam) .
              ?s ?prop ?match
              }
            OPTIONAL {
              ?s skos:prefLabel ?label .
              FILTER (LANGMATCHES(lang(?label), 'fi'))
            }
            BIND(IF(langMatches(LANG(?match),'fi'), ?pri, ?pri+1) AS ?npri)
            BIND(CONCAT(STR(?npri), LANG(?match), '@', STR(?match)) AS ?matchstr)
            OPTIONAL { ?s skos:notation ?notation }
          }
        }

The (?s ?score ?match) text:query (?prop 'NOT' 100000 ?langParam) should usually have the search term in place of that 'NOT' which prompts a warning Cannot parse '((pref:NOT) AND lang:fi*).

I couldn't find out which situations would create such a query but I could replicate the error result on a separate Fuseki with jenatext index.

joelit avatar Feb 08 '21 12:02 joelit