You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we have the ability to serialize the abstract acset schemas and concrete acset instances.
For example, we can define and serialize this abstract schema:
@presentSchFriends(FreeSchema) begin
(Person,Friendship)::Ob
(friender,friendee)::Hom(Friendship,Person)
(Name, Age)::AttrType
name::Attr(Person,Name)
age::Attr(Person,Age)
endwrite_json_acset_schema(SchFriends, "SchFriends.json")
And we can define and serialize this concrete instance:
@acset_typeFriends(SchFriends, index=[:friender,:friendee])
friends =@acset Friends{String,Int} begin
Person =3
Friendship =3
friender = [1,2,2]
friendee = [2,1,3]
name = ["Alice", "Bob", "Carol"]
age = [20, 30, 40]
endwrite_json_acset(friends, "friends.json")
However, even when taking both of them together, there is some type information missing. Specifically, what is currently missing is a way to serialize the concrete schema (i.e. Friends{String,Int}) for a given acset instance. The information is only implicitly/dynamically available in the JSON, which only works for the primitive types natively supported by JSON.
Which will output the same as the abstract schema, except it will also include the concrete type substituted in the friends instance for each of the the AttrTypes, i.e. it would produce something like:
The real problem is that we have our schema in Catlab and it's generic over the actual types populating the AttrTypes to create a concrete acset type. Thus we'd like to serialize a schema with fixed AttrTypes, probably both on its own and along with the serialization of an instance. We mainly just need primitive types.
Currently, we have the ability to serialize the abstract acset schemas and concrete acset instances.
For example, we can define and serialize this abstract schema:
And we can define and serialize this concrete instance:
However, even when taking both of them together, there is some type information missing. Specifically, what is currently missing is a way to serialize the concrete schema (i.e.
Friends{String,Int}
) for a given acset instance. The information is only implicitly/dynamically available in the JSON, which only works for the primitive types natively supported by JSON.What I would like is an overload like this:
Which will output the same as the abstract schema, except it will also include the concrete type substituted in the
friends
instance for each of the theAttrTypes
, i.e. it would produce something like:This is related to issue: #45
The text was updated successfully, but these errors were encountered: