jjmccollum / open-cbgm

Fast, compact, open-source, TEI-compliant C++ implementation of the Coherence-Based Genealogical Method
MIT License
29 stars 1 forks source link

Graphical user interface for open-cbgm modules #4

Closed jjmccollum closed 2 years ago

jjmccollum commented 4 years ago

Per @LarsKemmann's suggestion, I've added dedicated issues for the desired features external to the open-cbgm library. Because they are external to the core library, these features would best be maintained in their own repositories, but until someone decides to start implementing these features, these issues will serve as a convenient forum for discussion. This issue concerns the "user interface" desideratum listed at the end of the readme.

My ideas on how to go about this are a bit fuzzier than they are for issue #3, but in my preparation of the core library, I have attempted to make the open-cbgm modules as modular as possible so as to facilitate their incorporation into a web app or similar user interface. The scripts for the command-line modules typically involve the following steps:

  1. Parse user input.
  2. Query the SQLite database.
  3. Initialize instances of any necessary classes using the query results.
  4. Invoke the appropriate methods of the class instances to make the desired calculations.
  5. Organize the results in a tabular format, or, if the desired result is a graph, output a .dot file.

I designed the graphical classes with to_dot methods, so step 5 should be relatively straightforward. (Frankly, I should have implemented similar to_csv methods for tabular output, but the thought only just occurred to me. I should clean this up for the next release.) A web app that can render Graphviz (.dot) inputs and parse tables in serialized format (like .csv) would then just have to submit user-specified parameters and receive serialized representations of outputs using HTTP(S) requests and responses.

Another issue is how the initial population of the genealogical cache database would be handled. Currently, the command-line interface of the open-cbgm library populates the database with a user-specified TEI XML file representing the collation and local stemmata. (See issue #3 for details on how this would be prepared.) I wouldn't anticipate any difficulty in transmitting a user's TEI XML file from their system to the server initially, since the file is easily serialized, but more complicated use cases (e.g., loading results from an already populated database without reconstructing it with an old TEI XML file, maintaining a database that multiple users can modify) may be above my head. I'd love to hear what people have in mind!

In terms of the appearance of the interface, the CCeH user interface for the CBGM Genealogical Queries modules in Acts (web app at https://ntg.uni-muenster.de/acts/ph4/, source code at https://github.com/cceh/ntg) is a great template, but I'm open to any suggestions about how things could be improved visually.

jjmccollum commented 2 years ago

I am now closing this issue, as I consider @d-flood's criticus library (https://github.com/d-flood/Criticus/) to fulfill these desiderata.