{"id":17875835,"url":"https://github.com/constraintautomaton/tree-document-topology-visualizer","last_synced_at":"2025-07-11T07:34:26.827Z","repository":{"id":179172325,"uuid":"617402121","full_name":"constraintAutomaton/tree-document-topology-visualizer","owner":"constraintAutomaton","description":"A software to draw the topology of a TREE view","archived":false,"fork":false,"pushed_at":"2023-07-06T13:57:43.000Z","size":241,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-01T14:36:20.153Z","etag":null,"topics":["graph","rdf","semantic-web","tree-specification","visualization"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/constraintAutomaton.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-03-22T10:14:20.000Z","updated_at":"2023-04-10T18:16:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"0b4bfe7c-3401-412c-8407-36b3a8f757c3","html_url":"https://github.com/constraintAutomaton/tree-document-topology-visualizer","commit_stats":null,"previous_names":["constraintautomaton/tree-document-topology-visualizer"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/constraintAutomaton/tree-document-topology-visualizer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/constraintAutomaton%2Ftree-document-topology-visualizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/constraintAutomaton%2Ftree-document-topology-visualizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/constraintAutomaton%2Ftree-document-topology-visualizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/constraintAutomaton%2Ftree-document-topology-visualizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/constraintAutomaton","download_url":"https://codeload.github.com/constraintAutomaton/tree-document-topology-visualizer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/constraintAutomaton%2Ftree-document-topology-visualizer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264756308,"owners_count":23659299,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graph","rdf","semantic-web","tree-specification","visualization"],"created_at":"2024-10-28T11:25:32.095Z","updated_at":"2025-07-11T07:34:26.777Z","avatar_url":"https://github.com/constraintAutomaton.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tree-document-topology-visualizer\n\nSoftware to draw the topology of a [TREE view](https://treecg.github.io/specification/).\n\n\n\u003cimg src=\"./example.svg\" alt=\"Example of a topology\" width=\"400\" height=500/\u003e \u003cimg src=\"./example_unlabeled.svg\" alt=\"Example of a topology\" width=\"400\" height=500/\u003e\n\n\n\n## How it work\nThe processing can be divided into 4 steps;\n- Query the TREE view to get the [tree:relation](https://treecg.github.io/specification/#Relation)\n- Build a graph from the `tree:relation`\n- Build a [graphviz graph](https://graphviz.org/)\n- Generate a graph file (supported file types: [`dot`, `svg`, `png`, `jpg`](https://github.com/goccy/go-graphviz))\n\nWe use the [Link Traversal Query Processessing modules of the SPARQL query engine Comunica](https://github.com/comunica/comunica-feature-link-traversal)\nto execute the following SPARQL query to collect information about the [`tree:Relation`](https://treecg.github.io/specification/#Node)\n  and the current [`tree:Node`s](https://treecg.github.io/specification/#Relation).\n\n```sparql\nPREFIX tree: \u003chttps://w3id.org/tree#\u003e\nPREFIX rdf: \u003chttp://www.w3.org/1999/02/22-rdf-syntax-ns#\u003e\n\nSELECT ?node ?nextNode ?operator ?value WHERE {\n  ?node tree:relation ?relation .\n  ?relation tree:node ?nextNode .\n  \n  ?relation rdf:type ?operator.\n  ?relation tree:value ?value .\n} LIMIT {limit}\n```\nWe then build a graph from the query response where the vertices are composed of the variables from the SPARQL query `?node` and `?nextNode` and the edges are characterized by the pair (`?node`, `?nextNode`) and are \"weighted\" with the boolean expression composes with the SPARQL variable `?operator` `?value`.\n\n\nThe graph is forwarded to the [`go-graphviz`](https://github.com/goccy/go-graphviz) library which handles the generation of the graph file.\n\n\n## Dependencies\n- [go version 1.20](https://go.dev/dl/)\n- [nodejs v16](https://nodejs.org/en)\n- [yarn](https://yarnpkg.com/getting-started/install/)\n- [Make](https://www.gnu.org/software/make/) __Optional for building__\n\n\n\n## Build\n\n\n### First use\nTo build the software for a first time\n\n\n`make build-all`\n\n\nIt will build the main source code and the `javascript` code used to instantiate Comunica.\n\n\n### Main source code\n\n\nTo only build the main source code\n\n\n`make build`\n\n\nThe binary will be located in `./build/tree-visualizer`\n\n\n### Debugging\n\n\nTo build the code and then run it with the default parameters\n\n\n`make build-run`\n\n\n## Usage\n\n\nTo run with the default parameters\n\n`make run`\n\nThe binary is located inside the `./build/tree-visualizer`.\nTo display the help prompt use `-h`.\nThe file type is inferred from the extension of the path passed to `-p`.\n\n\n```\nUsage of ./build/tree-visualizer:\n  -l uint\n        The maximum number of relations (default 18446744073709551615)\n  -p string\n        Resulting path of the graph (default \"./generated/graph.svg\")\n  -t string\n        URL of the TREE document (default \"http://localhost:3000/ldes/test\")\n  -u    Make the graph unlabeled\n```\n## Test\nTo run all the tests\n\n`make test`\n\n## TO DO\n\n\n- [ ] Make a streaming version of the program where the graph is generated has the relations are discovered.\n- [ ] Make a mode to handle simpler `tree:relation` without using optional statements in the SPARQL query has it greatly slows down the execution time.\n- [ ] Include an option to track the nodes that are traversed when executing a SPARQL query from an outsider Query engine.\n- [ ] Option to output an `html` file, with an interactive graph using JavaScript.\n- [ ] Create a web assembly binary.\n\n## Bib reference\n\n```bib\n@software{Tam_tree-document-topology-visualizer_2023,\nauthor = {Tam, Bryan-Elliott},\ndoi = {10.5281/zenodo.1234},\nmonth = {4},\ntitle = {{tree-document-topology-visualizer}},\nurl = {https://github.com/constraintAutomaton/tree-document-topology-visualizer},\nversion = {1.0.0},\nyear = {2023}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconstraintautomaton%2Ftree-document-topology-visualizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconstraintautomaton%2Ftree-document-topology-visualizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconstraintautomaton%2Ftree-document-topology-visualizer/lists"}