Lisp dumping sometimes puts use of properties before their declaration

Issue #70 resolved
Yves created an issue

I'm using the Java API with a .fpp-options file containing simply:

[Tuning]
dumpOntology = 1

I pipe the standard output in a file to get the lisp expressions so I can read them afterwards, see https://bitbucket.org/dtsarkov/factplusplus/issues/69/way-to-save-load-a-set-of-facts.

However sometimes the output I get is like:

(range http://www.semanticweb.org/ywen/ontologies/2016/10/untitled-ontology-31#hasName (string))
(defdatarole http://www.semanticweb.org/ywen/ontologies/2016/10/untitled-ontology-31#hasName)

where defdatarole happens after data role use. And this fails to parse. Since the grammar is not context free, if hasName is used before it is declared, then parsing fails with a "Error at input line 1: unknown concept constructor".

Comments (4)

  1. Dmitry Tsarkov repo owner

    Thanks for the report. The old version used to print the data roles upfront. Seems like it had been lost at some point. I'll look to restore the correct functionality.

  2. Dmitry Tsarkov repo owner

    As a workaround you can simply sort the output file. This way all the definitions will go before all other axioms

  3. Log in to comment