Hello,

I have noticed that keywordLinking engine does not work with words in
quotes.
For the given text:

> I suspect that the keyword linking engine does not work with "quotes".


I get the following exception: [1].
[2] Shows the SPARQL Query and Virtuoso error message

It seems that the problem is in the SPARQL query line:

>  ?v_1 bif:contains '*"*\"quotes"' .


Stanbol sends the query to Virtuoso with both UNescaped (that should have
been removed) and escaped quote: "*%22*%5C%22quotes%22" - which translates
to *"*\"quotes". Removing the first quote -\"quotes" - solves the problem.

PS. Could you please explain me, what parameter is expected instead of
"null" in ["quotes]@[en, null]? [1]

Refs:
[1] Exception
org.apache.stanbol.enhancer.servicesapi.EngineException: Exception while
searchign for ["quotes]@[en, null]in the ReferencedSite virt
at
org.apache.stanbol.enhancer.engines.keywordextraction.impl.EntityLinker.lookupEntities(EntityLinker.java:298)
at
org.apache.stanbol.enhancer.engines.keywordextraction.impl.EntityLinker.process(EntityLinker.java:124)
at
org.apache.stanbol.enhancer.engines.keywordextraction.engine.KeywordLinkingEngine.computeEnhancements(KeywordLinkingEngine.java:392)
at
org.apache.stanbol.enhancer.jobmanager.event.impl.EnhancementJobHandler.processEvent(EnhancementJobHandler.java:279)
at
org.apache.stanbol.enhancer.jobmanager.event.impl.EnhancementJobHandler.handleEvent(EnhancementJobHandler.java:197)
at
org.apache.felix.eventadmin.impl.handler.EventHandlerProxy.sendEvent(EventHandlerProxy.java:415)
at
org.apache.felix.eventadmin.impl.tasks.SyncDeliverTasks.execute(SyncDeliverTasks.java:118)
at
org.apache.felix.eventadmin.impl.tasks.AsyncDeliverTasks$TaskExecuter.run(AsyncDeliverTasks.java:159)


[2] SPARQL Query and Virtuoso error message

Virtuoso 37000 Error XM029: Free-text expression, line 0: Unterminated
double-quoted word or phrase at


SPARQL query:
define sql:big-data-const 0
#output-format:application/rdf+xml
CONSTRUCT {
  ?id <http://www.w3.org/2000/01/rdf-schema#label> ?v_1 .
  ?id <http://www.w3.org/2000/01/rdf-schema#seeAlso> ?v_2 .
  ?id <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?v_3 .
  <http://stanbol.apache.org/ontology/entityhub/query#QueryResultSet> <
http://stanbol.apache.org/ontology/entityhub/query#queryResult> ?id .
} WHERE {
  {
    SELECT ?id
    WHERE {
      ?id <http://www.w3.org/2000/01/rdf-schema#label> ?v_1 .
        ?v_1 bif:contains '"\"quotes"' .
        FILTER(((lang(?v_1) = "en") || (lang(?v_1) = ""))) .
    }
    ORDER BY DESC ( <LONG::IRI_RANK> (?id) )
    LIMIT 10
          }
  OPTIONAL { ?id <http://www.w3.org/2000/01/rdf-schema#label> ?v_1 . }
  OPTIONAL { ?id <http://www.w3.org/2000/01/rdf-schema#seeAlso> ?v_2 . }
  OPTIONAL { ?id <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> ?v_3 . }
}

Best Regards,
Gin

Reply via email to