Giter VIP home page Giter VIP logo

graphinout's People

Contributors

lilladiamantisz avatar rasbab avatar trukacsa avatar xamde avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

reynoldsm88

graphinout's Issues

Verify DOT -> Gio

Add test file which tries to use all DOT features, (or use multiple files), then verify via e.g. mocks that data from file ended up correctly in Gio stream (calls to GioWriter)

Add validation to Gio..objects like GioNode

add validation to the GioNode/GioEdge/etc. objects themselves

maybe a ValidatingGioWriter is not needed. -> is required to check interplay of objects

Every stream of valid/creatable GioObjects should be handled by GioWriter,
delegates to GraphMLWriter -- and the ValidatingGraphmlWriter catches all wrongly nested/ordered elements.

Closable InputSource/OutputSink ?

  • let them both extends AutoCloseable and do .. whatever needs to be done?
  • in our impl: implement close correclty
  • - [ ] in our code: use try-with-resources to close them

Add ValidatingGioWriter

  • ValidatingGioWriter implements GioWriter
  • each method does checks, as far as possible regarding the gio stream, and delegates to base.
  • ensure GioData.key refers to defined GioKey.id
  • ensure GioEdge.Endpoint.node has been defined in a GioNode.id (do at the end of graph)
  • ensure GioEdge.Endpoint.port has been defined in a GioNode.Port.name (do at the end of graph)
  • ensure all IDs used in Gio are completely unique in document

Validate reader-dot

Test reader-dot in-depth:

  • for each .dot sample file -- each testing only one feature of DOT (as short as possible)
    • Read to GioWriter
    • Validate calls to GioWriter contain all data from source file
  • test subgraph feature
  • test directed / undirected edges
  • ports in DOT syntax: how are they handled by JGraphT DOTImporter?

XML self-closing tags

If the XmlWriterImpl receives start & end element with no other content in between,
it should emit a self-closing tag.

E.g. instead of
<node id="node1"></node>
it should generate
<node id="node1" />

Read g6/s6/d6 format

  • sparse6Reader
  • digraph6Reader

Spec: https://users.cecs.anu.edu.au/~bdm/data/formats.txt

  • text based
  • only printable ASCII characters
  • one line per graph

graph6

undirected graphs
ext: ".g6"
support: no loops, no multi-edges

sparse6

undirected graphs
more space-efficient for large, sparse graphs
ext: ".s6"
support: loops, multi-edges

digraph6

directed graphs
ext: ".d6"

Usage

Format is used, e.g., by "House of Graphs", a graph test data repository.
E.g. here https://houseofgraphs.org/meta-directory/nut

See also https://houseofgraphs.org/help#format_g6

TODO

Decide if JGraphT can be used (EPL 2.0, many dependencies)

Import DOT Text

  • find DOT text files from the wild internet
  • integrate into GioReader interface
  • have a Junit test which reads TGF and write GraphML (depends on GraphML stuff, of course)
  • have more JUnit tests at least for simple cases

Add graphml sample file

Download the graphml files sing the download button ON the page, dont download the HTML PAGE :-)

Import TGF format

https://en.wikipedia.org/wiki/Trivial_Graph_Format

  • find TGF files from the wild internet
  • have a Junit test which reads TGF and write GraphML (depends on GraphML stuff, of course)
  • add some simple tests (parse several files and verify validation errors are found)
  • Adapt to new finding: edges are optional, even empty graph is valid

GXL reader

Test nested ports

Nested ports are not correctly writtein to graphml

  • Create graphml test file to have nested ports
  • Use generic AbstractReaderTest to verify

Add reader-graphml

  • write all incoming data to GioWriter
  • respect XML namespaces, if they are defined, e.g. if root element defined "ns0:svg-something..." we needs this pair "ns0:svg-something" in the resulting XML -> can be used as custom extended attributes
  • default to GraphML namespace, if none defined
  • Use any custom attributes, such as "yfile.type" -- and don't skip them, in fact, make sure they are in the resulting graphMl
  • parse non-Graphml-XML (such as SVG) as String content into surrounding element (e.g. in data/key)
  • use streaming SAX parsing

Fix graphml:data elements

  • add GioWriter.data( GioData data )
  • remove GioElementWithData
  • adapt all tests & verifiers to this change

Validate reader-tgf

Test reader-tgf in depth:

  • for each .tgf sample file:

    • Read to GioWriter and produce GraphML/XML in memory (via MemoryOutputSink)
    • Validate produced content via DTD validation (or XMLSchema if that is easier, for GraphML both is available)
    • Read produced graphml via reader-graphml (base project needs a dependency on reader-graphml, scope test), then write the read graphml to graphml.xml again
  • read once: file.tgf =reader-tgf (->gio->graphml)=> file.graphml

  • read again: file.graphml =reader-graphml (->(gio->graphml)=> file2.graphml

  • now file.graphml should be byte-identical to file2.graphml (no need to use real files, just in-memory byte-buffers)

show warn/error from content parsing in log output

first iteration:
simply stream incoming content errors to a Logger.log and render them somewhat readable
(no stack, no file, no ..)
we can map our Level ERROR to ERROR, WARN to WARN

remember: all normal logging in the code happens in all normal levels as usual to Logger as well

no central messages

Create REST API

--Using AWS Lambda.-- -> Contabo or similar

Functionality:

  • validate Graphml
  • parse anything into Graphml

GET /status
response: "OK"

POST /validate (upload file)

POST /read (upload file)

  • optional queryParam "inputType" with values "json", "tgf", "dot", "graphml"
    we can auto-detect input type -> GioEngine

  • result is a zip file named "result.zip" which contains
    -- result.graphml
    -- log.txt

  • create a first swagger doc for the API

  • create initial impl with at least "GET /status"

    • creating streaming zip response in memory, no files written to disk
  • add more functionality

Verify TGF -> Gio

Add test with e.g. 3 nodes and 2 edges (with and without label), verify that this goes into Gio-stream -> mock

code quality

no unused imports

all files auto-formatted

all interface types

  • documented
  • tested

"most interface methods documented, where not clear"
each major feature has a JUnit test (each reader-read, reader find validation error)

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.