Commit Graph

6 Commits

Author SHA1 Message Date
Dan Kortschak
bc349ecfab all: replace internal rand shim with math/rand/v2 2025-02-01 22:18:04 +10:30
Dan Kortschak
cf3307fa63 all: partially migrate to math/rand/v2
This is not intended to be a completed transition since it leaves the
libraries unusable to external client code, but rather as a step towards
use of math/rand/v2. This initial step allows repair of sequence change
failures without having to worry about API difference.
2025-02-01 22:18:04 +10:30
Jonathan Bluett-Duncan
bdcda9a453 graph: use slices package for sorting and reversing slices 2024-08-17 08:41:18 +09:30
Dan Kortschak
09c7f513f8 graph/formats/rdf: add Repeat and Len methods 2022-03-04 14:26:53 +10:30
Dan Kortschak
d5f7a1db26 graph/formats/rdf: add Has{All,Any}{Out,In} query methods
These methods express queries that are currently able to be expressed
with a sequence of In, Out and And queries. However, the constructed
filter approach is potentially significantly more expensive and are
more complex to reason about. For example it is often possible to make
the following re-writes,

    p.Out(cond).In(cond).And(p) => p.HasAllOut(cond')

and

    p.In(cond).Out(cond).And(p) => p.HasAllIn(cond').

The expense comes when reaching out to a commonly connected node and then
coming back; the return traversal will generate a large set of fruitless
candidates that then need to be filtered via the conjunction. This saves
that fruitless effort.
2022-03-04 14:26:53 +10:30
Dan Kortschak
820f2999af graph/formats/rdf: add a graph implementation and graph query language for RDF graphs
This is a very simplified version of a Gremlin-like language. The
simplification is in part forced by Go, but also reduces the level
of hiding complexity that is present in Gremlin.
2022-02-01 06:57:30 +10:30