GitXplorerGitXplorer
I

Solarman

public
4 stars
0 forks
0 issues

Commits

List of commits on branch solarman-agparser.
Verified
52ce13cfcb00bcfc73b6c739a0b35ec1f358fc1f

Make Results showable for direct query interface

IInBetweenNames committed 4 years ago
Verified
c3e4e0e195f34fed60d31dfa332a0c31b717aee1

Quick fixup of Interactive

IInBetweenNames committed 4 years ago
Verified
6aaf9d5cbcaf85de95055636f4790a3187c89900

Add refractor_telescope_5 to vocabulary

IInBetweenNames committed 4 years ago
Verified
797bb6a372173e7d9648004e5fa1fdccddd84c2f

Add "three"

IInBetweenNames committed 4 years ago
Verified
c41ab1de42c4500c1c0ce2974c48b92af01f047f

Fixup triples for telescopes

IInBetweenNames committed 4 years ago
Verified
a4a962e027e5f1900f6acff44b1beed1b6bb6bed

Fixed "to"

IInBetweenNames committed 4 years ago

README

The README file for this repository.

Solarman with Semantic Web Triplestore Backend

Files:

  • AGParser.hs -- Need this for parsing (it's from Solarman 1)

  • TypeAG.hs -- Datatypes for above

  • NatLangSemApplication.hs -- Most recent official version of Solarman

  • Getts.hs -- Library for doing Triple Store stuff, mostly identical to what is discussed in paper. Avoids semantics.

  • SolarmanTriplestore.hs -- Solarman with triple store backend

  • InteractiveGenerator.hs -- Generates Interactive.hs based on dictionary

  • Interactive.hs -- An interface suitable for running queries over the internet in a safe environment. Uses SafeHaskell and NoImplicitPrelude to prevent arbitrary code from running. This should be run as an isolated user just in case!

New progress:

  • Added more sets of adjectives to the triple store

  • Added a convenience function to the old solarman to convert sets to triples (setsToTriples)

  • Can construct queries using combinators: try this in GHCi "a moon (orbited (a planet))" it works!

  • Reached full compatibility with old test cases on "main function"

TypeAG2 and AGParser2 are the versions of the parser and semantics that the new solarman uses

How to use

To use SolarmanTriplestore just load it up in GHCi and use the "main" function.

main "which moons were discovered by hall"

=>[phobos deimos]

To use the natural language frontend, a CGI version is provided in Main.hs which can be compiled to an executable (solarman.cgi) which is conformant to the CGI standard

To do web queries directly with the combinators, Interactive.hs can be used. Interactive.hs allows for direct queries to be performed using "-e" and has convenient variables for each thing in the dictionary. For instance, the following is possible:

ghci util/Interactive.hs -package XSaiga -e ":set -XSafe" -e ":t discover"

This module uses SafeHaskell to export only "safe" functions suitable for use in a web query. That is, to our best knowledge, Interactive.hs cannot be used to execute arbitrary code on a server. Only the provided combinators may be used, and in addition the ($) and (.) operators.

Note that a workaround is in place until this commit lands into a proper GHC release. Once that is done, it should be possible to directly do:

ghci util/Interactive.hs -package XSaiga -XSafe -e ":t discover"

Disabling the implicit prelude and enabling XSafe ensures that no System.IO* functions are available to the query.

To use Interactive.hs, you should install this package and move it to a different directory.

Building

To build, use cabal v2-build or alternatively use stack build.

If you want to use Interactive.hs, make sure you have write-ghc-environment-files: always set in your cabal.project.local before building.

Note that the Interactive.hs instructions will change once the previously mentioned GHC bug is fixed in a release.

For cross-compilation, see CROSSBUILD.md.

Note that for GHC 8.8.1, you will need to use --allow-newer and use patched versions of dependencies that have instances for MonadFail where needed, as fail inside Monad was officially removed with this release. This is not a bug with XSaiga or Solarman, it's just something the Haskell ecosystem will have to work through until it's all fixed.