Closed miloush closed 1 year ago
There is a SerializableEntity
class used to parse dumped Wikibase entities. See [Wikibase] Working with JSON dump .
Moreover, you can use SerializableEntity.Load method to create a SerializableEntity
from IEntity
(i.e., Entity
or another SerializableEntity
). This means after converting any entity into SerializableEntity
, you can later convert it into JSON with ToJsonString
/ WriteTo
/ ToJObject
methods.
Thank you! Not sure why there is a separation of SerializableEntity
and Entity
instead of the latter just being serializable, but this seems to address my original request. Might be worth mentioning in the documentation for Entity
- I didn't check Working with JSON dump because I don't actually have any dump, my bad.
It would be useful to be able to store and load entities locally. JSON seems to be easiest option since
Entity.LoadFromJson
seems to be already there,ToJson()
or similar could be added, and the contract classes would be also helpful to have public.