Natural Language User Interface for InterMine models.
First, SWI Prolog needs to be installed:
$ sudo apt-get install swi-prolog
Make sure to have Node.js installed, then get the package dependencies:
$ npm install -d
The flatiron server is started on port 1115
as follows:
$ npm start
Port number can be changed in config.json
.
Mocha is used as a test runner and is configured through npm:
$ npm test
Alternatively, one can play around with the Prolog interpreter directly:
$ prolog -f ./prolog/resolve.pro -g "show_path([attr,of,company], []),halt"
The model consulted is present in ./prolog/model.pro
and is being overwriten every time the service is started with rules being taken from the config.json
file model
directive.
- anaphora resolution - "it", "he" in a self-referential query; not a problem
- modifier attachment - "genes for proteins with length x"
- conjunction, disjunction - "employees of company ACME & Initech"
- ellipsis - information missing from a statement; best guess to replace vars with variables if there is no direct match
- nominal compound problem - "gene protein"; model resolves relations
- a pattern-matching system (regex)
- syntax-based system (this)
- offers multiple possbible matches/answers for ambiguous queries
- by default only requires the model XML/JSON definition
- utilizes DCG and the backtracking power of Prolog (quick to test out)
- can be extended at runtime
- tailored and applied to a focused domain