I’ve downloaded a DataResourceEntityStore from the Wolfram Data Depository, specifically, the ResourceObject["General Topology EntityStore"], in the form of the package General-Topology-EntityStore.wl`.
I know how to use $EntityStores to use this EntityStore within a given Mathematica session.
But exactly how do I use the Wolfram Language, within Mathematica, to make this EntityStore into a local persistent object?
If you’ve already downloaded the file “General-Topology-EntityStore.wl” linked to from here, then all you need to do in your notebook is run this command
store = << "~/Downloads/General-Topology-EntityStore.wl"; (* or wherever you downloaded the data to *)
AppendTo[$EntityStores, << store]
and then you can access all the data via EntityValue
@Murray Eisenberg First you need to figure out why you get $Failed when trying to Get the file (<<).
Do you get True from FileExistsQ["~/Downloads/General-Topology-EntityStore.wl"]? What happens when you try to use Import instead of Get?
As to the persistence - I think that is just the way $EntityStores was designed. If you solve the problem above and are able to read in the store using Get, then you could add the line AppendTo code above to your “~/Library/Mathematica/Kernel/init.m” file and it would be available via EntityValue every time you start a kernel
I don’t believe there is a way to make the new store permanent, I think at startup the $EntityStores is empty by design.
But you can add the relevant code to your .init file, where you can keep any code you want executed when the kernel starts. I have tons of stuff in my init file, little helper functions I find to be useful.
and get the result. There isn’t a way to have the “Activate” code run beforehand, since the EntityValue framework is loaded after the init.m file is read.
Yes, I do understand how to add code to init.m so as to load files automatically.
What I obviously do not understand, and the Documentation Center has been of very little help on this, is how to utilize the new(er) LocalObject, LocalObjects, LocalCache, etc. I note that $LocalBase points to my folder:
~/Library/Wolfram/Objects
My expectation is that there must be some way to make “General-Topology-EntityStore” available there, for call on demand, without my having to modify init.m.