GithubHelp home page GithubHelp logo

quangis / quangis-web Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 2.51 MB

The web interface that brings the different components of the QuAnGIS project together.

Python 9.96% CSS 1.19% JavaScript 38.71% HTML 50.14%

quangis-web's Introduction

quangis-web

The web interface that brings all the different components of the QuAnGIS project together into a single pipeline.

  1. Overview
  2. Usage

Overview

Workflow generator

The workflow repository contains possible GIS workflows that might solve a user's task. At the moment, it contains only example workflows. However, eventually, the workflow-synthesis module will be used to pre-generate workflows. This module interfaces with the Automated Pipeline Explorer via apey to discover sensible workflows. It does this by matching core concept data types of the GIS tools' inputs and outputs.

(The workflow specifier would find meaningful combinations of input/output CCD types for the transformation algebra query at hand, suggesting that workflows are also generated on-the-fly.)

Algebra abstractor

Each workflow in the workflow repository is enriched with a transformation graph. This is a directed acyclic graph with core concepts of geographical information encoded as CCT types at the nodes. The edges represent transformations between these concepts.

These graphs are constructed automatically. We have manually annotated the tools with CCT expressions that capture the underlying conceptual transformation. A workflow connects individual tool applications, each of them now associated with a CCT expression that is parsed into a subgraph by the transformation-algebra library. The library then stitches the subgraphs together, using type inference to find the most specific type at every node.

Query formulator

A web interface presents users with a constrained natural language, using blockly. The interface passes the user's question on to the rest of the pipeline. At the end of the pipeline, it presents a set of workflows to the user as possible solutions to their task. The implementation is in this repository, quangis-web.

Query translator

The user's natural language question is parsed into a tree and then further into a transformation query, which is essentially a transformation graph that represents only parts of the workflow. Leaf nodes may have keywords, to be matched with possible data sources. This is implemented in the geo-question-parser module.

Query executor

The transformation query is matched against the transformation graphs in the workflow repository. To this end, the transformation query is converted to a SPARQL query via the transformation-algebra library and sent to a triple store such as MarkLogic or the open-source Apache Jena Fuseki. This yields a set of workflows that may solve the user's task.

Data reifier

To be implemented. Finds suitable input data sources to concretize the queried workflow. The data repository contains sources that are manually or automatically annotated with text descriptions and CCD/CCT types.

Usage

Setting up the environment

There are myriad ways to manage Python packages and environments. We have chosen Miniconda; also see instructions for Linux. After installing it, create and activate the quangis environment:

conda env create --file environment.yml
conda activate quangis

After the environment is set up, make sure that you have downloaded relevant data files:

python -m spacy download en_core_web_sm
python -m nltk.downloader averaged_perceptron_tagger omw-1.4

Setting up JavaScript libraries

We use the blockly, cytoscape and klay JavaScript libraries. For now, these are just bundled as static JS files; we will need a maintainable front-end workflow in the future. (Also, klay is deprecated.)

npm install
cp  node_modules/blockly/blockly.min.js \
    node_modules/cytoscape/dist/cytoscape.min.js \
    node_modules/cytoscape-klay/cytoscape-klay.js \
    node_modules/klay/klay.js \
    blocklyUI/static/blocklyUI/js/

Loading data

The cct repository contains example workflows. These can be augmented with their transformation graphs using the transformation-algebra command-line tool. For example, to produce a TriG file containing all graphs, you could use:

python -m transformation_algebra graph -L cct -T tools/tools.ttl \
    workflows/*.ttl -o transformations.trig

To additionally upload these graphs to a graph store, additionally pass arguments such as these:

-b marklogic -u "<user>:<pass>" -s "https://<host>:<port>"

Running the server

During debugging, we can use the built-in Django test server. However, do set environment variables with the appropriate secrets:

DJANGO_KEY=… TDB_USER=… TDB_PASS=… python manage.py runserver 3000

Or, on Windows:

set DJANGO_KEY=… & TDB_USER=… & TDB_PASS=… & python manage.py runserver 3000

quangis-web's People

Contributors

e-nyamsuren avatar nsbgn avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.