Preskoči na glavno vsebino

Objave

Prikaz objav, dodanih na december, 2021

Convert function and conversion dialect

A very important element of Rye language is it's Validation dialect. It's related to idea of having a very dynamic, but at the same time also more "certain", if I dare not say safer language. It makes checking for input, or expected data, quicker and cleaner. It also reduces and systematizes a lot of otherwise ad-hoc and ugly code, that is usually spread out around your "business logic" code, making it less visible, but is mostly even not written. Another part of equation is the Conversion dialect. I think a lot of code is just there for mangling and preparing data, or converting it from one to another format, renaming fields between them. Conversion dialect tries to make this more compact and less ad-hoc. Below is a short demo from the REPL. Both validation and conversion dialects can be invoked directly with a function, but they are a crucial part of other mechanisms in Rye. Rye has "kinds", which on creation by default invoke validation and co

Off Topic: Exploring the Cayley Graph Database (part 2)

  We ended the last blog-post just as things were starting to get somewhat interesting. Has function First of all. We used Is to get to the initial node until now. There is also a Has path function which can be used to get to the first node(s) and to filter out specific nodes once we are well on our path. graph.V() .Has( "<type>" , "</people/person>" ) .Has( "<name>" , "Jackie Chan" ).All() { "result" : [ { "id" : "</en/jackie_chan>" } ] }   Few more hops Let's find all the actors that Mr. Jackie Chan worked with as a director. graph.V().Has( "<name>" , "Jackie Chan" ) .In( "</film/film/directed_by>" ) .Out( "</film/film/starring>" ) .Out( "</film/performance/actor>" ) .Unique() .Out( "<name>" ).All() { "result" : [ { "id" : "Sammo Hung"