In this project, we replicate the SGF game trees as graphs inside Neo4j, and then outsource the search through patterns to Neo4j, as it is an optimized graph database.
This project is heavily influenced and inspired by Waltheri's Go Pattern Search. In that project, its author used each game's last snapshot as a way of making comparisons with other games.
Another alternative to modeling this problem is through Regular Expressions — regexes can actually be modeled as graphs as well —, I believe. Since SGF files track move coordinates as strings, we could search patterns in strings as patterns in the game. Coincidentally, regular expressions are also used fact optimizations in my graph approach.
(Kind lost my patience with implementing a Goban, so the current one is kind of crap, sorry. Everything seemed to be working fine but then I added some sizing parameters and things went awry.)
- Pattern-Search
- Sequential Pattern-Search
- Stone-based filtering
- Contains only selected stones
- Contains selected stones
- Rotation on Searches
- Regular-search, such as player name, date, etc.
- Add text/move-comment search.
- Quadrant-based pattern search (reflections also count)
- Region-based pattern search (reflections also count)
- DB
- SGF fields for the game nodes
- Indexes
- Index on moves
- Index on edited stones
- Data
- Add large number of games (GoGod? Go4Go?)
- Add tsumegos
- Add lecture-based content (à la Yunguseng Dojang (Inseong Hwang))
- UI
- Goban Component
- Stone placement
- Stone deletion
- Move numbering
- Game Rules
- Capture
- Suicide
- Ko
- Filters
- Sequential
- Stone-based (for edited stones)
- Region-based
- Stone-based filtering
- Contains only selected stones
- Contains selected stones
- URL-based filtering for the search
- Regular-search, such as player name, date, etc.
- Add text/move-comment search.
- Goban Component
- Test it with GoGoD Games
- Seems to work fine with it, it takes a couple of seconds once you get to 1,000s of games, but I think that might be fixed with some caching.
- Include Yunguseng Dojang's files so we can index their large library.
- There's something weird about this. There's something strange about the parsing of his files, such that they get bloated and overflow Neo4j's memory???
- The same thing is happening for adding the tsumego collection.
- There's something weird about this. There's something strange about the parsing of his files, such that they get bloated and overflow Neo4j's memory???
- Webscrape 101 Weiqi for its tsumegos.
- Open Neo4j Desktop, and create a new project.
- Launch the Neo4j server.
- Create a new user with admin privileges, which will be used in the environment variables.
- Update the environment variables accordingly.
- Launch the NextJS project.
- Neo4j (Graph DBMS)
- NextJS (ReactJS) + MUI
- Sabaki's SGF Parser
- Custom Go Board HTML Canvas Component
NEXTJS_PORT=
PORT=
NEO4J_PORT=
NEO4J_USER=
NEO4J_PASSWORD=
- Sabaki's Board Editor: Shudan
- WGo.js: the editor used in Waltheri's Pattern Search.
- How to Recursively Create a Tree with Cypher (Neo4j)
- How to (Efficiently) Find Subpaths in Recursive Trees through Cypher (Graph vs Regex)
- Graphology: a JS package for dealing with graphs.
- For editing Cypher code as strings with syntax highlighting on VS Code, I'm using the following extensions:
- 101 Weiqi: Chinese website with various types of Go content. Probably the biggest tsumego database (pros create and transcribe tsumegos everyday).
- Yunguseng Dojang: In-seong Hwang 8d's online school, with extensive not-yet-index content.