Stop styling pixels. Start styling synapses.
Brainwind is a semantic markup pattern for creating Relational HTML. It provides a simple attribute convention that transforms flat prose into machine-readable knowledge graphsβno framework, no dependencies, just semantic HTML.
While Tailwind manages the Eyes and HTMX manages the Server, Brainwind manages the Mind.
Note: Brainwind is fundamentally a markup convention and RDF mapping pattern. The CSS file is entirely optionalβuse it only for development/debugging to visualize your semantic annotations.
Most web content is "dead." To a computer, a recipe, a research paper, or a financial report is just a string of characters. Even "Semantic HTML" (<article>, <section>) only describes the layout geometry, not the intellectual relationships within the text.
Traditional RDF solutions (RDFa, Microdata) are verbose, break the flow of writing, and provide no immediate value to developers or users.
-
π RDF-Compatible: Direct 1:1 mapping to Subject-Predicate-Object triples. Generate JSON-LD, Turtle, or N-Triples from your HTML.
-
π― Element-Agnostic: Works with any HTML element (
<span>,<div>,<a>, etc.). Decorate, don't encapsulate. -
π€ LLM-Friendly: Built-in Markdown syntax perfect for AI-generated content. ChatGPT, Claude, and Gemini can output Brainwind natively.
-
β‘ HTMX Ready: Designed for reactive semantic interactions. Click an entity to fetch its knowledge graph data.
-
π Standards-Based: Uses Schema.org, FOAF, and other standard vocabularies familiar to the RDF community.
Brainwind provides a set of attributes and utility classes that map directly to RDF (Resource Description Framework) semantics. It treats the DOM as a Synaptic Map.
The foundation of RDF is the Subject-Predicate-Object triple. In Brainwind:
- Subject (
.bw-node): The entity the statement is about - Predicate (
.bw-edge): The property or relationship - Object (
.bw-node): The value or target entity
Brainwind is element-agnostic. You can apply it to <span>, <div>, <td>, or any tag that fits your layout.
No installation required. Just add the attributes to your HTML.
<p class="bw-context" data-bw-vocab="https://schema.org/">
The
<span class="bw-node" data-bw-type="Product" data-bw-id="san-marzano">
San Marzano Tomatoes
</span>
are
<i class="bw-edge" data-bw-rel="grownIn">harvested from</i>
the volcanic soil of
<span class="bw-node" data-bw-type="Place" data-bw-id="mount-vesuvius">
Mount Vesuvius
</span>.
</p>What this creates:
- Subject: San Marzano Tomatoes (Product)
- Predicate: grownIn
- Object: Mount Vesuvius (Place)
| Class | Role | Description |
|---|---|---|
.bw-context |
Container | Defines a semantic context/scope |
.bw-node |
Entity | Marks an element as a "Noun" in your ontology |
.bw-edge |
Relation | Marks the "Verb" or link between two nodes |
| Attribute | RDF Equivalent | Purpose |
|---|---|---|
data-bw-vocab |
@vocab in JSON-LD |
The base vocabulary/ontology URL |
data-bw-id |
rdf:about |
Unique URI or identifier for the node |
data-bw-type |
rdf:type |
The ontological class (Person, Place, Product, etc.) |
data-bw-rel |
rdf:predicate |
The specific relationship type |
Brainwind is designed to be the data-source for HTMX. Because the HTML is self-describing, your UI can "react" to the meaning of the text.
No special setup neededβjust combine Brainwind attributes with HTMX directives:
<span
class="bw-node bw-interactive"
data-bw-type="Concept"
data-bw-id="umami"
hx-get="/api/ontology/explain/umami"
hx-trigger="click"
hx-target="#definition-panel">
Umami
</span>When a user clicks "Umami," they aren't just clicking textβthey're interacting with a concept defined in your knowledge graph.
Brainwind is 1:1 compatible with RDF. A simple crawl of a Brainwind-enabled page can generate valid JSON-LD, Turtle, or N-Triples.
<p class="bw-context" data-bw-vocab="https://schema.org/">
<span class="bw-node" data-bw-type="Person" data-bw-id="chef-rossi">
Chef Rossi
</span>
<span class="bw-edge" data-bw-rel="uses">employs</span>
<span class="bw-node" data-bw-type="Technique" data-bw-id="high-heat">
high-heat fermentation
</span>.
</p>RDF Triple Output:
@prefix schema: <https://schema.org/> .
<chef-rossi> a schema:Person ;
schema:uses <high-heat> .
<high-heat> a schema:Technique .Most LLMs output Markdown. Brainwind provides a Markdown syntax that can be easily converted to Brainwind HTML.
The [Chef Rossi](node:chef-01 "Person") prepares the
[San Marzano Tomatoes](node:tomato-99 "Product").The [Chef Rossi]{.bw-node data-bw-type="Person" data-bw-id="chef-01"}
uses {.bw-edge data-bw-rel="employsTechnique"}
[high-heat fermentation]{.bw-node data-bw-type="Technique" data-bw-id="technique-01"}.You can instruct LLMs to output Brainwind-ready content:
Output your response using Brainwind Markdown syntax.
For entities (people, places, concepts), use: [Entity Name]{.bw-node data-bw-id="unique-id" data-bw-type="Type"}
For relationships, use: {.bw-edge data-bw-rel="relationshipType"}
See examples/system-prompt.md for a complete prompt template.
Brainwind turns any "wall of text" into a navigable map. Whether you're documenting a recipe, a supply chain, a medical study, or a legal contract, the relational HTML remains the same.
<article class="bw-context" data-bw-vocab="https://schema.org/">
<p>
When
<span class="bw-node" data-bw-type="Person" data-bw-id="chef-rossi">
Chef Rossi
</span>
<i class="bw-edge" data-bw-rel="uses">applies</i>
<span class="bw-node" data-bw-type="Technique" data-bw-id="fermentation">
high-heat fermentation
</span>,
the
<span class="bw-node" data-bw-type="Chemical" data-bw-id="gluten">
gluten structure
</span>
becomes
<span class="bw-node" data-bw-type="State" data-bw-id="aerated">
highly aerated
</span>.
</p>
</article><div class="bw-context" data-bw-vocab="https://schema.org/">
The
<span class="bw-node" data-bw-type="Product" data-bw-id="lithium">Lithium</span>
is
<span class="bw-edge" data-bw-rel="sourcedFrom">extracted by</span>
<span class="bw-node" data-bw-type="Organization" data-bw-id="mining-corp">
Global Mining Corp
</span>
in
<span class="bw-node" data-bw-type="Place" data-bw-id="bolivia">Bolivia</span>.
</div>See examples/ for more demonstrations.
- Prose is Data: If it's worth writing, it's worth connecting.
- Decorate, Don't Encapsulate: Don't break the web; enhance it with
data-*attributes. - Cognitive Lift: A UI should help the user think, not just browse.
- Ontology is the New CSS: Instead of managing "Blue-500," we manage "Entity-Relationship-Confidence."
- Logic is Invisible: Your HTML should look like a document but act like a database.
Brainwind is ontology-agnostic, but here are common types used with Schema.org:
| Type | Description | Example |
|---|---|---|
Person |
Individual human | Chef, Author, CEO |
Organization |
Company, Institution | Restaurant, Fund, NGO |
Place |
Geographic location | City, Country, Region |
Product |
Physical or digital good | Ingredient, Device |
Technique |
Method or process | Cooking method, Algorithm |
Concept |
Abstract idea | Democracy, Umami |
Event |
Occurrence in time | Conference, Launch |
Chemical |
Molecular compound | Gluten, COβ |
No installation required. Brainwind is a markup pattern, not a library.
-
Add a context wrapper to define your vocabulary:
<div class="bw-context" data-bw-vocab="https://schema.org/">
-
Mark your entities with
.bw-node:<span class="bw-node" data-bw-type="Person" data-bw-id="unique-id"> Entity Name </span>
-
Connect them with
.bw-edge:<span class="bw-edge" data-bw-rel="relationshipType"> connects to </span>
That's it! Your HTML is now a queryable knowledge graph.
Want visual feedback? Add your own styling:
.bw-node { border-bottom: 1px dashed blue; cursor: help; }
.bw-edge { font-style: italic; color: gray; }Brainwind is an open framework. We welcome:
- Vocabulary mappings for specific domains (medical, legal, scientific)
- Parser implementations (JavaScript, Python, etc.)
- Integration examples with popular frameworks
- Documentation improvements
- RDF Primer: W3C RDF 1.1 Primer
- Schema.org: schema.org
- JSON-LD: json-ld.org
- HTMX: htmx.org
MIT License - See LICENSE for details.
"The web was always meant to be a knowledge graph. Brainwind just makes it visible."
Brainwind transforms the document from a static artifact into a living synapseβa connection point in the vast neural network of human knowledge.
Ready to style some synapses? Check out the examples directory to see Brainwind in action.