MEMELANG

v04 · 29 Mar 2025 · Bri Holt · info@memelang.net

Introduction

Memelang is a hybrid graph-relational query language that encodes complex relationships in a compact syntax. To get hands on, view the web demo or visit the GitHub repository.

Memes

In Memelang, pairs of R-relations are connected to A-values using an equal sign as R=A. A meme is formed from two or more pairs grouped into one line and separated by spaces.

R1=A1 R2=A2 R3=A3

For example, the memes that "Mark Hamill played Luke Skywalker in Star Wars" and "Carrie Fisher played Leia in Star Wars" can be encoded:

actor=MarkHamill role=LukeSkywalker movie=StarWars
actor=CarrieFisher role=Leia movie=StarWars

All R-relations and certain A-values representing ideas are identified by alphanumeric keys. Each key is case-insensitive unique. Each key must contain at least one a-z character. A-values may also be literal numbers or literal strings.

For numeric A-values, the double equals == operator is used:
movieReviewed=StarWars movieRating==4.5
measurement=temperature unit=Celsius quantity==-2.1
For string A-values, the string is wrapped in double quotes:
namee=MarkHamill nameType=fullName nameVal="Mark Richard Hamill"

Queries

In Memelang, a partially specified statement is interpreted as a search query. The empty part of the statement is interpreted as a wildcard. Spaces separating statements are interpreted as AND operators.

Leaving the A empty queries for all A-values for the specified relation. For example, to query all movies with Mark Hamill as an actor:

actor=MarkHamill movie=

Leaving the R empty queries for all R-relations for the specified A-value. For example, to query all relations involving Mark Hamill:

=MarkHamill

Both the A and R values can be left empty to query for all memetic R=A pairs. For example, to query all data from all memes related to Mark Hamill:

=MarkHamill =

Standard comparison operators >, >=, <, <=, and != may be used for numeric A-values:

movieRating>=4.5

Chains

Using R1[R2 allows for queries matching multiple memes where the A-value for R1 equals the A-value for R2. This is equivalent to joining in relational databases and to traversing in graph databases. The syntax is:

R1=A1 R2[R3 R4=A4 R5=A5
For example, to query for all movies in which both Mark Hamill and Carrie Fisher act together:

actor=MarkHamill movie[movie actor=CarrieFisher

To query for anyone who is both an actor and a producer:

actor[producer

To query for anyone who acted in and produced the same movie:

actor= movie[movie producer=

Memelang also has a reverse operator ] which unjoins the table or untraverses the graph. This allows for branching queries. For example, query for all actors who starred in at least one movie directed by George Lucas and at least one movie composed by John Williams:

actor= movie[movie director=GeorgeLucas] movie[movie composer=JohnWilliams

Implications

The >> implication operator states that for any meme matching the left side of the implication, the right side of the implication is true. For example:

heightMeter==1.6 >> heightFoot==5.25

The implication operator can also make implications about the ideas related to the meme. In such cases, the ideas matching the wildcard relations on the left are sequentially transposed into the wildcard relations on the right. For example, a grandparent is the parent of a parent:

child= parent[child parent= >> grandchild= grandparent=

For brevity, the equals sign can be omitted:

child parent[child parent >> grandchild grandparent

Legal

Copyright 2025 HOLTWORK LLC. Patents pending. Contact info@memelang.net.