Catlab.jl
Catlab.jl copied to clipboard
Parameters in queries for attributes that are unions
When an AttrType
is being modeled with some union type, queries with a parameter for something pointing to that attribute type won't work (errors). I am not sure if its possible to make them work given how the spans are set up in oapply
, but I am documenting it here.
using Catlab, DataFrames
@present TestSch(FreeSchema) begin
X::Ob
A::AttrType
a::Attr(X,A)
end
@acset_type TestData(TestSch)
data = @acset TestData{Union{Int,Symbol}} begin
X=5
a=[1,2,3,:four,:five]
end
testquery = @relation (x=xid, a=attr) begin
X(_id=xid, a=attr)
end
query(data, testquery)
query(data, testquery, (attr=3, ))