Git Product home page Git Product logo

semanticflowgraph's Introduction

Semantic flow graphs

Build Status DOI

Create semantic dataflow graphs of data science code.

Using this package, you can convert data science code to dataflow graphs with semantic content. The package works in tandem with the Data Science Ontology and our language-specific program analysis tools. Currently Python and R are supported.

For more information, please see our research paper on "Teaching machines to understand data science code by semantic enrichment of dataflow graphs".

Command-line interface

We provide a CLI that supports the recording, semantic enrichment, and visualization of flow graphs. To set up the CLI, install this package and add the bin directory to your PATH. Invoke the CLI by running flowgraphs.jl in your terminal.

The CLI includes the following commands:

  • record: Record a raw flow graph by running a script.
    Requirements: To record a Python script, you must install the Julia package PyCall.jl and the Python package flowgraph. Likewise, to record an R script, you must install the Julia package RCall.jl and the R package flowgraph.
  • enrich: Convert a raw flow graph to a semantic flow graph.
  • visualize: Visualize a flow graph using Graphviz.
    Requirements: To output an image, using the --to switch, you must install Graphviz.

All the commands take as primary argument either a directory, which is filtered by file extension, or a single file, arbitrarily named.

CLI examples

Record all Python/R scripts in the current directory, yielding raw flow graphs:

flowgraphs.jl record .

Convert a raw flow graph to a semantic flow graph:

flowgraphs.jl enrich my_script.py.graphml --out my_script.graphml

Visualize a semantic flow graph, creating and opening an SVG file:

flowgraphs.jl visualize myscript.graphml --to svg --open

semanticflowgraph's People

Contributors

cclauss avatar epatters avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

semanticflowgraph's Issues

Ingesting julia programs

Based on my reading of the docs and paper, this project currently supports ingesting R and Python scripts but not Julia scripts. Is there a roadmap for julia support? I think that representing Julia scripts would be relatively straightforward with Base.Meta.parse. and MacroTools.

Move integration tests to flowgraphs repo

Move the integration tests that operate on Python and R raw flow graphs to the new flowgraphs repository.

The current testing situation for this package is not ideal because it expects the Python and R program analysis packages to be installed. The self-contained unit tests for semantic enrichment and other functionality will remain in this package.

Preserve observed elements in semantic enrichment

Some time ago, I changed the convention about elements (values observed at runtime): previously, they were stored on wires, now they are stored on ports. The Python and R flow graphs have been updated to reflect this convention, but semantic enrichment has not yet been updated. Currently the elements are simply discarded.

Migrate to Julia v0.7

Julia v0.7 and v1.0 were just released, a big milestone for the project marking a stable API. We should migrate to Julia v0.7. It should be easy enough, except that all our dependencies, including Catlab, must also be ported.

Run integration tests on Travis

I've disabled the integration tests on Travis, because they require the raw flow graphs produced by pyflowgraph and rflowgraph. On a local system we can just assume everything is properly installed, but that won't fly on Travis. To make it work on Travis, we need to connect the builds to each other. I'm not experienced in this area but maybe Travis' build artifacts can help.

Command-line interface

Create a CLI for the major functionality of this package and its sister packages:

  • Convert raw flow graph to semantic flow graph
  • Convert flow graphs to Graphviz and TikZ for visualization
  • Convert Python code to raw flow graph (via pyflowgraph and PyCall.jl)
  • Convert R code to raw flow graph (via rflowgraph and RCall.jl)

Add property for concept utilization to RDF/OWL export

The RDF/OWL export should include a property, called something like usesConcept, that holds whenever an annotation uses a concept anywhere in its (possibly compound) definition. This will make certain common queries easier to make.

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.