Home / Companies / SurrealDB / Blog / Post Details
Content Deep Dive

Using SurrealDB to understand how Buffalo buffalo buffalo Buffalo buffalo

Blog post from SurrealDB

Post Details
Company
Date Published
Author
Dave MacLeod
Word Count
1,114
Language
English
Hacker News Points
-
Summary

The text explores the complexity of the sentence "Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo," using SurrealDB to demonstrate the interactions between buffaloes from Buffalo and those from other places. It explains the linguistic intricacies of the word "buffalo," which can serve as a noun, a verb, and be pluralized, creating a grammatically correct yet perplexing sentence. The text illustrates this concept through SurrealQL by creating a database of buffaloes, simulating interactions where buffaloes can "buffalo" other buffaloes. It details the process of setting up these interactions using CREATE statements, random selection, and relationships within the database to show which buffaloes are buffaloing others and which are being buffaloed. The text further explores a scenario where buffaloes from Buffalo retaliate against other buffaloes from Buffalo, establishing a rule-based interaction model. Visualization using Surrealist's graph feature provides a clearer understanding of these complex interactions, revealing a denser network of connections among buffaloes from Buffalo compared to those from elsewhere.