Imports

The add{…} operator loads a Flora file into another. For example,

?- add{owl_trans/domain/engineering/engineering_value.flr>>main}.

However, to avoid loading the same file multiple times, we recommend a slightly different form:

?- \unless loaded(owl_trans/domain/engineering/engineering_value.flr)
   \do add{owl_trans/domain/engineering/engineering_value.flr>>main}.

In the file to import, put this fact somewhere near the top:

loaded(owl_trans/domain/engineering/engineering_value.flr).

Note that Sunflower recognizes such conditional add{…} statements as normal imports, and shows the content of the imported files in the KB Editor, Import Graph, and so on.

Filenames in Flora statements usually need to be enclosed in single-quotes. This is because they usually contain special symbols such as / and ., and Flora requires single-quotes around any names with such special characters.

Importing a file using add{…} makes all the information in the imported file available as if it was declared locally, just like the owl:imports statement in OWL.

But unlike OWL, Flora cannot import another file based on an “ontology URI” or such because Flora has no such concept. Instead, all files that need to be imported are assumed to be available under one local, top-level directory. The file paths in the add{…} statements must be relative to that directory. In Sunflower, the top-level directory is the Project directory of the Sunflower Project that contains the file. If you are using Sunflower Foundation as an API, see the Programmer’s Guide for information on how to set up this “top-level” Flora content directory so that imports can be located.