{"id":16891207,"url":"https://github.com/vadyushkins/kotgll","last_synced_at":"2025-04-11T13:11:11.824Z","repository":{"id":151791900,"uuid":"617518633","full_name":"vadyushkins/kotgll","owner":"vadyushkins","description":"Simple and fast Kotlin implementation of GLL parsing algorithm","archived":false,"fork":false,"pushed_at":"2024-05-22T02:47:13.000Z","size":198,"stargazers_count":5,"open_issues_count":3,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-25T09:21:48.488Z","etag":null,"topics":["cfpq-algo","context-free-grammar","gll","gll-parser","graph-algorithms","graph-theory","kotlin"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vadyushkins.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-22T14:58:18.000Z","updated_at":"2024-05-31T05:17:13.000Z","dependencies_parsed_at":"2025-02-19T11:42:43.666Z","dependency_job_id":null,"html_url":"https://github.com/vadyushkins/kotgll","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vadyushkins%2Fkotgll","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vadyushkins%2Fkotgll/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vadyushkins%2Fkotgll/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vadyushkins%2Fkotgll/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vadyushkins","download_url":"https://codeload.github.com/vadyushkins/kotgll/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248405210,"owners_count":21097933,"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":["cfpq-algo","context-free-grammar","gll","gll-parser","graph-algorithms","graph-theory","kotlin"],"created_at":"2024-10-13T17:06:05.031Z","updated_at":"2025-04-11T13:11:11.771Z","avatar_url":"https://github.com/vadyushkins.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kotgll\n[![Build](https://github.com/vadyushkins/kotgll/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/vadyushkins/kotgll/actions/workflows/build.yml)\n[![Test](https://github.com/vadyushkins/kotgll/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/vadyushkins/kotgll/actions/workflows/test.yml)\n\n* [About](https://github.com/vadyushkins/kotgll#about)\n* [Usage](https://github.com/vadyushkins/kotgll#usage)\n  * [From sources](https://github.com/vadyushkins/kotgll#from-sources)\n  * [Using JAR](https://github.com/vadyushkins/kotgll#using-jar)\n  * [CFG Format Example](https://github.com/vadyushkins/kotgll#cfg-format-example)\n  * [RSM Format Example](https://github.com/vadyushkins/kotgll#rsm-format-example)\n* [Performance](https://github.com/vadyushkins/kotgll#performance)\n  * [Graphs](https://github.com/vadyushkins/kotgll#graphs)\n  * [Grammars](https://github.com/vadyushkins/kotgll#grammars)\n  * [Results](https://github.com/vadyushkins/kotgll#results)\n  * [More results](https://github.com/vadyushkins/kotgll#more-results)\n\n\u003e Note: project under heavy development!\n\n## About\n**kotgll** is an open-source project for implementing the GLL algorithm and its modifications in Kotlin\n\n## Usage\n\n### Command Line Interface\n\n```text\nUsage: kotgll options_list\nOptions: \n    --input -\u003e Input format (always required) { Value should be one of [string, graph] }\n    --grammar -\u003e Grammar format (always required) { Value should be one of [cfg, rsm] }\n    --sppf [ON] -\u003e Sppf mode { Value should be one of [on, off] }\n    --inputPath -\u003e Path to input txt file (always required) { String }\n    --grammarPath -\u003e Path to grammar txt file (always required) { String }\n    --outputPath -\u003e Path to output txt file (always required) { String }\n    --help, -h -\u003e Usage info\n```\n\n### From sources\n\n#### Step 1. Clone repository\n\n`git clone https://github.com/vadyushkins/kotgll.git`\n\nor \n\n`git clone git@github.com:vadyushkins/kotgll.git`\n\nor \n\n`gh repo clone vadyushkins/kotgll`\n\n#### Step 2. Go to the folder\n\n`cd kotgll`\n\n#### Step 3. Run the help command\n\n`gradle run --args=\"--help\"`\n\nYou will see the [\"Options list\"](https://github.com/vadyushkins/kotgll#command-line-interface) message.\n\n#### Example\n\n```text\ngradle run --args=\"--input graph --grammar rsm --sppf off --inputPath src/test/resources/cli/TestGraphReadWriteCSV/dyck.csv --grammarPath src/test/resources/cli/TestRSMReadWriteTXT/dyck.txt --outputPath ./result.txt\"\n```\n\n### Using JAR\n\n#### Step 1. Download the latest JAR\n\n```text\ncurl -L -O https://github.com/vadyushkins/kotgll/releases/download/v1.0.0/kotgll-1.0.0.jar\n```\n\n#### Step 2. Run JAR with Java\n\n```text\njava -jar kotgll-1.0.0.jar --input graph --grammar rsm --sppf off --inputPath src/test/resources/cli/TestGraphReadWriteCSV/dyck.csv --grammarPath src/test/resources/cli/TestRSMReadWriteTXT/dyck.txt --outputPath ./result.txt\n```\n### CFG Format Example\n\n```text\nStartNonterminal(\"S\")\nNonterminal(\"S\") -\u003e Terminal(\"subClassOf_r\") Nonterminal(\"S\") Terminal(\"subClassOf\")\nNonterminal(\"S\") -\u003e Terminal(\"subClassOf_r\") Terminal(\"subClassOf\")\nNonterminal(\"S\") -\u003e Terminal(\"type_r\") Nonterminal(\"S\") Terminal(\"type\")\nNonterminal(\"S\") -\u003e Terminal(\"type_r\") Terminal(\"type\")\n```\n\n### RSM Format Example\n\n```text\nStartState(id=0,nonterminal=Nonterminal(\"S\"),isStart=true,isFinal=false)\nState(id=0,nonterminal=Nonterminal(\"S\"),isStart=true,isFinal=false)\nState(id=1,nonterminal=Nonterminal(\"S\"),isStart=false,isFinal=false)\nState(id=4,nonterminal=Nonterminal(\"S\"),isStart=false,isFinal=false)\nState(id=3,nonterminal=Nonterminal(\"S\"),isStart=false,isFinal=true)\nState(id=2,nonterminal=Nonterminal(\"S\"),isStart=false,isFinal=false)\nState(id=6,nonterminal=Nonterminal(\"S\"),isStart=false,isFinal=true)\nState(id=5,nonterminal=Nonterminal(\"S\"),isStart=false,isFinal=false)\nTerminalEdge(tail=0,head=1,terminal=Terminal(\"subClassOf_r\"))\nTerminalEdge(tail=0,head=4,terminal=Terminal(\"type_r\"))\nTerminalEdge(tail=1,head=3,terminal=Terminal(\"subClassOf\"))\nNonterminalEdge(tail=1,head=2,nonterminal=Nonterminal(\"S\"))\nTerminalEdge(tail=4,head=6,terminal=Terminal(\"type\"))\nNonterminalEdge(tail=4,head=5,nonterminal=Nonterminal(\"S\"))\nTerminalEdge(tail=2,head=3,terminal=Terminal(\"subClassOf\"))\nTerminalEdge(tail=5,head=6,terminal=Terminal(\"type\"))\n```\n\n## Performance\n\nThe GLL algorithm has been modified to support graph input.\nThe proposed modification has been evaluated on several real graphs for the scenario of finding all pairs of reachability.\n\n**Machine configuration**: PC with Ubuntu 20.04, Intel Core i7-6700 3.40GHz CPU, DDR4 64Gb RAM.\n\n**Enviroment configuration**: \n* Java HotSpot(TM) 64-Bit server virtual machine (build 15.0.2+7-27, mixed mode, sharing).\n* JVM heap configuration: 55Gb both xms and xmx.\n\n### Graphs\n\nThe graph data is selected from [CFPQ_Data dataset](https://formallanguageconstrainedpathquerying.github.io/CFPQ_Data).\n\nA detailed description of the graphs is listed bellow.\n\n#### RDF analysis graphs\n\n| Graph name   |   \\|*V*\\| |     \\|*E*\\| |  #subClassOf |      #type |  #broaderTransitive |\n|:------------|----------:|------------:|-------------:|-----------:|--------------------:|\n| [Enzyme](https://formallanguageconstrainedpathquerying.github.io/CFPQ_Data/graphs/data/enzyme.html#enzyme)       |    48 815 |      86 543 |        8 163 |     14 989 |               8 156 |\n| [Eclass](https://formallanguageconstrainedpathquerying.github.io/CFPQ_Data/graphs/data/eclass.html#eclass) |   239 111 |     360 248 |       90 962 |     72 517 |                   0 |\n| [Go hierarchy](https://formallanguageconstrainedpathquerying.github.io/CFPQ_Data/graphs/data/go_hierarchy.html#go-hierarchy) |    45 007 |     490 109 |      490 109 |          0 |                   0 | \n| [Go](https://formallanguageconstrainedpathquerying.github.io/CFPQ_Data/graphs/data/go.html#go)           |   582 929 |   1 437 437 |       94 514 |    226 481 |                   0 |\n| [Geospecies](https://formallanguageconstrainedpathquerying.github.io/CFPQ_Data/graphs/data/geospecies.html#geospecies)   |   450 609 |   2 201 532 |            0 |     89 065 |              20 867 |  \n| [Taxonomy](https://formallanguageconstrainedpathquerying.github.io/CFPQ_Data/graphs/data/taxonomy.html#taxonomy)     | 5 728 398 |  14 922 125 |    2 112 637 |  2 508 635 |                   0 |\n\n### Grammars\n\nAll queries used in evaluation are variants of same-generation query.\nThe inverse of an ```x``` relation and the respective edge is denoted as ```x_r```.\n\n\u003cbr/\u003e\n\nGrammars used for **RDF** graphs:\n\n**G\u003csub\u003e1\u003c/sub\u003e**\n```\nS -\u003e subClassOf_r S subClassOf | subClassOf_r subClassOf \n     | type_r S type | type_r type\n```\n\nThe representation of **G\u003csub\u003e1\u003c/sub\u003e** context-free grammar in the repository can be found [here](https://github.com/vadyushkins/kotgll/blob/main/src/test/resources/cli/TestCFGReadWriteTXT/g1.txt).\n\nThe representation of **G\u003csub\u003e1\u003c/sub\u003e** context-free grammar as recursive automaton in the repository can be found [here](https://github.com/vadyushkins/kotgll/blob/main/src/test/resources/cli/TestRSMReadWriteTXT/g1.txt).\n\n### Results\n\nThe results of the **all pairs reachability** queries evaluation on graphs related to **RDF analysis** are listed below.\n\nIn each row, the best mean time in seconds is highlighted in **bold**.\n\n| Graph        \t|  [CFG](https://github.com/vadyushkins/kotgll/tree/main/src/main/kotlin/org/kotgll/cfg/graphinput/withoutsppf)  \t|    [RSM](https://github.com/vadyushkins/kotgll/tree/main/src/main/kotlin/org/kotgll/rsm/graphinput/withoutsppf)    \t| [GLL4Graph](https://github.com/FormalLanguageConstrainedPathQuerying/GLL4Graph) \t|\n|--------------\t|:-----:\t|:---------:\t|:---------:\t|\n| [Enzyme](https://formallanguageconstrainedpathquerying.github.io/CFPQ_Data/graphs/data/enzyme.html#enzyme)       \t| 0.107 \t| **0.044** \t|      0.22 \t|\n| [Eclass](https://formallanguageconstrainedpathquerying.github.io/CFPQ_Data/graphs/data/eclass.html#eclass)       \t|  0.94 \t|  **0.43** \t|       1.5 \t|\n| [Go hierarchy](https://formallanguageconstrainedpathquerying.github.io/CFPQ_Data/graphs/data/go_hierarchy.html#go-hierarchy) \t|   4.1 \t|   **3.0** \t|       3.6 \t|\n| [Go](https://formallanguageconstrainedpathquerying.github.io/CFPQ_Data/graphs/data/go.html#go)           \t|   3.2 \t|  **1.86** \t|      5.55 \t|\n| [Geospecies](https://formallanguageconstrainedpathquerying.github.io/CFPQ_Data/graphs/data/geospecies.html#geospecies)   \t|  0.97 \t|  **0.34** \t|      2.89 \t|\n| [Taxonomy](https://formallanguageconstrainedpathquerying.github.io/CFPQ_Data/graphs/data/taxonomy.html#taxonomy)     \t|  31.2 \t|  **14.8** \t|      45.4 \t|\n\n#### More results\n\nMore results, but in raw form, can be found in repository [kotgll_benchmarks](https://github.com/vadyushkins/kotgll_benchmarks/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvadyushkins%2Fkotgll","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvadyushkins%2Fkotgll","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvadyushkins%2Fkotgll/lists"}