Widoco icon indicating copy to clipboard operation
Widoco copied to clipboard

LODE error: empty sequence is not allowed in $descriptions

Open seralf opened this issue 3 years ago • 3 comments

Describe the bug In some case (see example) if the ontology is missing informations, LODE gives an error while parsing.

To Reproduce

  1. Start widoco by CLI or GUI, using NIF ontology as example source. (source on github)

  2. The error will be similar to the following one:


[main] INFO widoco.CreateResources - - ontology IRI: http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core#
Error on line 35 of structural-reasoner.xsl:
  XTTE0570: An empty sequence is not allowed as the value of variable $descriptions
  in variable disjoints
  at f:getDisjoints() (file:///.../extraction.xsl#1190)
  at xsl:call-template name="get.entity.disjoint" 
  ...in built-in template rule
[main] ERROR lode.LODEGeneration - Error while applying LODE. Error while applying the XLS file: An empty sequence is not allowed as the value of variable $descriptions
[main] ERROR widoco.gui.GuiController - Error while generating the documentation: An empty sequence is not allowed as the value of variable $descriptions
; SystemID: file:/.../structural-reasoner.xsl; Line#: 35; Column#: -1
net.sf.saxon.trans.XPathException: An empty sequence is not allowed as the value of variable $descriptions

Expected behavior In case there are information missing, they sholud be populated by the default (for example while transforming from .ttl format to .rdf format). This way we can still have all the warning from the external dependency (LODE), and we'll miss those information in HTML, but still we can avoid breaking the compilation of ontology documentation

Screenshots

Desktop (please complete the following information):

  • OS: win 10

Additional context Add any other context about the problem here.

seralf avatar Jun 09 '21 11:06 seralf

In the example about NIF ontology, the problem seems to be related on how the disjiointed classes are written:

[] a owl:AllDisjointClasses ; 
	owl:members nif:RFC5147String, nif:ContextHashBasedString , nif:OffsetBasedString ,  nif:CStringInst .

this may turn in RDF/XML in something similar to:

  <owl:AllDisjointClasses rdf:nodeID="genid8">
    <owl:members rdf:resource="http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core#RFC5147String"/>
    <owl:members rdf:resource="http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core#ContextHashBasedString"/>
    <owl:members rdf:resource="http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core#OffsetBasedString"/>
    <owl:members rdf:resource="http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core#CStringInst"/>
  </owl:AllDisjointClasses>

and it seems to be essentially related to how those information are handled by default by LODE itself: https://github.com/essepuntato/LODE/blob/master/src/main/webapp/structural-reasoner.xsl#L33-L35

seralf avatar Jun 09 '21 11:06 seralf

Thanks. If you have a suggestion for this issues I would appreciate it @seralf Otherwise, it may have to wait a bit until I get the time to look it up in detail

dgarijo avatar Jun 10 '21 10:06 dgarijo

Hi @dgarijo I'm not sure how to fix it... I was thinking about opening an issue on the LODE codebase itself, but that expect an RDF/XML source, that is generated before sending to it. So I suppose it coulbe be possible to write the owl:members nodes in a different way. I imagine two possible options, at least:

  1. open an issue on LODE, asking / contributing to support handling rdf:resource as well (this seems to be the problem, looking at the XSLT, but I might be wrong)
  2. prepare the RDF/XML in a different way, for example adding blank nodes or similar placeholders, that are already handled by LODE. This workaround maybe could work looking at other ontologies that don't have this problem, and should be removed in case the support in LODE is extended, as in point 1.

seralf avatar Jun 14 '21 16:06 seralf