User:Gilbert189/Stratta
- This article is just a draft. See User:Gilbert189#Drafts for more info.
The idea for Stratta came from how we decided to represent how computers "talk" in most creative works. Instead of the more or less canonical V.34 or some other/similar standard on the ITU-T V-Series Recommendations, we decided to represent them with random beeps of differing frequencies, usually in chromatic scale. Don't get me wrong, I don't hate this way of signifying communication. If it communicates its user "oh, the computer is talking/calculating something", then it has fulfilled its purpose.
The concept of communication using beeps of broad frequencies isn't exactly fictional. If you're into ham radio, you might know about Olivia, a MFSK communication protocol. Like the acronym implies, it uses beeps of differing frequencies, in a range of 250 or 500 or 1000 Hz in case of Olivia. Nevertheless, an idea went into my head to somehow make this into a language; not a programming language, but a language that computers could use to converse by statements and questions with other computers, much like how humans does it... or something idk.
Statements
Stratta statements are essentially RDF triples. Each statement consists of three terms: the subject, the predicate, and the object. Stratta uses Wikidata as the main knowledge base (explaining the list of prefixes on the term struct), though other IRIs are allowed.
They are represented with the prefix name and term name separated by :
. IRIs are placed between angle brackets:
wd:Q188709 <http://docs.python.org/3/>
Terms could refer to a known or unknown term. This is called a pro-term (or a variable). Using it is mandatory as Stratta doesn't have recursion (in the linguistic sense).
Pro-terms are represented with an identifier with a ?
prefix, like how it's done in SPARQL. However, the identifier would be encoded as a number when it is "spoken".
?music
Terms
The term struct is as such:
- A single bit, denoting the component type:
- If it's set, it's a variable; a pro-term.
They have the following fields:- The identifier index, encoded with Fibonacci coding.
The number 1 (encoded as 11) is reserved for the last triple's subject.- Example
1 011
- ?2
- The identifier index, encoded with Fibonacci coding.
- If it's clear, it's a normal term.
They have the following fields:- 5 bits for the node prefix/type, as such:
- (00000) rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
- (00001) xsd: <http://www.w3.org/2001/XMLSchema#>
- (00010) ontolex: <http://www.w3.org/ns/lemon/ontolex#>
- (00011) dct: <http://purl.org/dc/terms/>
- (00100) rdfs: <http://www.w3.org/2000/01/rdf-schema#>
- (00101) owl: <http://www.w3.org/2002/07/owl#>
- (00110) wikibase: <http://wikiba.se/ontology#>
- (00111) skos: <http://www.w3.org/2004/02/skos/core#>
- (01000) schema: <http://schema.org/>
- (01001) cc: <http://creativecommons.org/ns#>
- (01010) geo: <http://www.opengis.net/ont/geosparql#>
- (01011) prov: <http://www.w3.org/ns/prov#>
- (01100) wd: <http://www.wikidata.org/entity/>
- (01101) data: <https://www.wikidata.org/wiki/Special:EntityData/>
- (01110) wds: <http://www.wikidata.org/entity/statement/>
- (01111) wdref: <http://www.wikidata.org/reference/>
- (10000) wdv: <http://www.wikidata.org/value/>
- (10001) wdt: <http://www.wikidata.org/prop/direct/>
- (10010) wdtn: <http://www.wikidata.org/prop/direct-normalized/>
- (10011) p: <http://www.wikidata.org/prop/>
- (10100) ps: <http://www.wikidata.org/prop/statement/>
- (10101) psv: <http://www.wikidata.org/prop/statement/value/>
- (10110) psn: <http://www.wikidata.org/prop/statement/value-normalized/>
- (10111) pq: <http://www.wikidata.org/prop/qualifier/>
- (11000) pqv: <http://www.wikidata.org/prop/qualifier/value/>
- (11001) pqn: <http://www.wikidata.org/prop/qualifier/value-normalized/>
- (11010) pr: <http://www.wikidata.org/prop/reference/>
- (11011) prv: <http://www.wikidata.org/prop/reference/value/>
- (11100) prn: <http://www.wikidata.org/prop/reference/value-normalized/>
- (11101) wdno: <http://www.wikidata.org/prop/novalue/>
- (11110) _: <local://>
- (11111) (special term)
- The term data index.
- For terms with Wikidata item and property prefixes, use their item/property index numbers.
- Example
0 01100 011
- wd:Q2
- For the prefixes wds:, wdv:, and wdref:, use a number as their identifier index.
- Example
0 10000 000001001001000001010000010000100101010011
- wdv:15defea7
- For the prefixes rdf:, rdfs:, xsd:, owl:, skos:, schema:, prov:, geo:, and wikidata:, use a string that is an unambiguous subsequence of the valid terms.
- Example
0 00000 0101001001111
- rdf:t → rdf:type
- Only for the prefix rdf:, the number 1 (encoded as 11) followed by a number denotes a membership index.
- Example
0 00100 11011
- rdf:_2
- Special terms have the following fields:
- A single bit to denote the type:
- If it's set, it's an IRI.
- If it's clear, it's a literal.
- The string of this term.
- Iff the term is a literal, an additional 2 bits to denote:
- (10) The next term will be an datatype IRI for this literal.
- (01) After this flag, there will be another string to denote the language tag.
- (00) Nothing special; the literal will be of type <http://www.w3.org/2001/XMLSchema#string>.
- Example
0 11111 0 00101000110010001001100100010011010101000110000010001111 00
- "Apple"
- A single bit to denote the type:
- For the preceding cases, their datatypes are encoded as such:
- Numbers are encoded with Fibonacci coding.
- Strings are encoded with a 1-terminated sequence of numbers, each corresponding to their Unicode character codepoints (plus 1).
- Example
(_:) 00100100011 10100100011 11
- _:hi
- For terms with Wikidata item and property prefixes, use their item/property index numbers.
- 5 bits for the node prefix/type, as such:
- If it's set, it's a variable; a pro-term.
- A single bit, denoting continuation of this triple:
- If it's set, the next term will share the same subject and predicate as the current one.
- If it's clear, this triple ends, and the next term will be the next triple's subject.
- These have no meaning for terms other than objects.
Modulating into beeps
To modulate the data into beeps, split the resulting bitstream into 5 bits. Padding is put on the LSB, so 10
becomes 10111
. With an accumulator A initially set to 0, add the 5 bits (plus 1 to avoid two beeps having the same frequency) in order, modding it by 33. In each addition, beep in the frequency of 512+(32×A) Hz. Beeps can be as long as you want, but 20 beeps per second is recommended. It's recommended to taper the beeps to reduce clicking. Don't let beeps collide with each other; it's even better if you space them out. A single beep cannot be any shorter than 0.01 seconds.
Examples
Is it true? ?thing wdt:P31 wd:Q7949. 10110 010001010010110 001100100101010010001000110 10110010001010010110001100100101010010001000110
Me and my brother like to eat on The Jazz Café. wd:Q18086706 wdt:P3373 ?brother; p:P3373 wds:1. wds:1 rdf:type wikibase:Statement; ps:P3373 ?brother; pq:P1039 wd:Q10861465. ?group rdf:type rdf:Bag. wd:Q18086706 rdf:_1 ?group. ?brother rdf:_2 ?group. ?group wdt:P1034 wd:Q6168202. wd:Q18086706 wdt:P3373 ?2. ?1 p:P3373 wds:1. wds:1 rdf:t wikibase:Stm. ?1 ps:P3373 ?2. ?1 pq:P1039 wd:Q10861465. ?3 rdf:t rdf:B. wd:Q18086706 rdf:_1 ?3. ?2 rdf:_2 ?3. ?3 wdt:P1034 wd:Q6168202. 0011000000010101000000001010001000101000110 0100011000000100100100110 10110 1110 0100111000000100100100110 001110110 001110110 00000001010010011110 00011000001010110101001001100000010011110 1110 0101001000000100100100110 10110 1110 0101110001010100000011 10110 00110010001010001000100101000101000100011 100110 00000001010010011110 0000001010100011110 0011000000010101000000001010001000101000110 0000001111 100110 10110 00000011011 100110 100110 01000100000101000000110 00110010100001000000010010100010100000110 001100000001010100000000101000100010100011001000110000001001001001101011011100100111000000100100100110001110110001110110000000010100100111100001100000101011010100100110000001001111011100101001000000100100100110101101110010111000101010000001110110001100100010100010001001010001010001000111001100000000101001001111000000010101000111100011000000010101000000001010001000101000110000000111110011010110000000110111001101001100100010000010100000011000110010100001000000010010100010100000110
You can hear this Stratta statement with this fish script:
for x in 6 7 18 2 4 13 31 7 0 4 5 15 20 14 9 28 10 11 30 7 25 20 24 14 15 21 26 24 28 29 18 7 12 4 7 23 5 16 25 28 5 12 2 31 22 25 13 15 10 14 19 30 2 12 21 9 18 14 6 7 28 15 7 9 20 28 13 30 0 21 22 0 5 16 23 24 7 27 6 7 14 10 4 17 2 3 24 26 11 30 14 31 1 12 18 19 14 sox -n -t f32 -r 48000 - synth 0.035 sine (math 512 + $x x 32) fade q 0.01 -0 0.01 pad 0 0.015 end | play -t f32 -r 48000 -
[[Category:Non-textual]]