I’ve been pondering the pros and cons of schemas doing this exercise of translating SQL to Prolog, and it ties in with the Errors considered harmful thread in this group.
Ultimately, I’ve decided I’m on the side of schemas. A snag with dynamically typed languages is the initial “savings” in lines of code from not needing to declare variable types is more than lost down the line by the number of times types need to checked subsequently – and those lines of type-checking code often come at the price of bitter experience from crashes or weird results from garbage input which an SQL or other statically-typed system would have simply rejected upfront.
It seems to me that a lot of NoSQL boils down to extracting data from huge blobs of text structured into Json (queried by GraphQL), XML (queried by XPath), or whatever is currently in fashion.
Dabbling with GraphQL and Xpath has mainly helped me understand this Perlisism
The string is a stark data structure and everywhere it is passed there is much duplication of process. It is a perfect vehicle for hiding information.
My interpretation of that is that using blobs of text as a “universal compound type” leads to lots of headaches in trying to decipher other people’s (and sometimes your own) code down the line.