google / badwolf

Temporal graph store abstraction layer.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Assert type covariance in query?

immesys opened this issue · comments

How does one use type covariance in a query? The documentation doesn't cover it.

Hi @immesys could you share a quick example to make that I can use to answer?

Well say I have

/foo/bar<baz> "pred"@[] /obj<anid>

and now I want to use the fact that /foo covariant /foo/bar in some way. Is the documentation implying this is an out-of-band convention or is there some way of using it in a query?

Yes, correct, right now there is no support for those operation in BQL. We plan to introduce filter functions first on the where clauses. When we have that in place, we will be able to add a few different ops.

Having that said, if you are manipulating nodes directly

func (t *Type) Covariant(ot *Type) bool {

Implements the functionality.