# How create local copy of Wolfram Data Repository resource

**URL:** <https://community.wolfram.com/t/how-create-local-copy-of-wolfram-data-repository-resource/13849>\
**Category:** Questions\
**Tags:** mathematica, curated-data, import-and-export\
**Created:** [March 29, 2019, 9:01pm UTC](https://community.wolfram.com/t/how-create-local-copy-of-wolfram-data-repository-resource/13849 "2019-03-29T21:01:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![murray](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/murray/32/39879_2.png) [@murray](https://community.wolfram.com/u/murray)\
**Post date:** [March 29, 2019, 9:01pm UTC](https://community.wolfram.com/t/how-create-local-copy-of-wolfram-data-repository-resource/13849/1 "2019-03-29T21:01:25Z")

</div>

I know how to search [https://datarepository.wolframcloud.com](https://datarepository.wolframcloud.com) and how to copy and then evaluate an expression such as:

```
ResourceObject["General Topology EntityStore"]

```

But how can I keep a local copy of such a resource to use subsequently?

(I have the feeling that this has been asked here before, possibly by me, and answered, but I cannot find the post.)

---

<div class="post-metadata">

**Author:** ![kapioletto](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/kapioletto/32/10262_2.png) [@kapioletto](https://community.wolfram.com/u/kapioletto)\
**Post date:** [March 30, 2019, 7:45am UTC](https://community.wolfram.com/t/how-create-local-copy-of-wolfram-data-repository-resource/13849/2 "2019-03-30T07:45:20Z")

</div>

Do you mean you want it automatically cached and Mathematica then know it and upon consequent calls it would go to a local copy without internet for example? Otherwise you could just `Put`, `Export`, etc…

---

<div class="post-metadata">

**Author:** ![murray](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/murray/32/39879_2.png) [@murray](https://community.wolfram.com/u/murray)\
**Post date:** [March 30, 2019, 8:35pm UTC](https://community.wolfram.com/t/how-create-local-copy-of-wolfram-data-repository-resource/13849/3 "2019-03-30T20:35:38Z")

</div>

How (and where) should I save the `ResourceObject` locally for subsequent use?

How do I then make its data available at a subsequent Mathematica session?

---

<div class="post-metadata">

**Author:** ![bobs](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/bobs/32/24995_2.png) [@bobs](https://community.wolfram.com/u/bobs)\
**Post date:** [April 2, 2019, 1:02pm UTC](https://community.wolfram.com/t/how-create-local-copy-of-wolfram-data-repository-resource/13849/4 "2019-04-02T13:02:09Z")

</div>

When you use a `ResourceObject`, it is automatically cached locally in a dedicated directory in your `$DefaultLocalBase`. The first time you retrieve the content of the resource object - data in this case - it is also cached locally.

Clear local cache

```
In[94]:= ResourceRemove[ResourceObject["General Topology EntityStore"]]

Out[94]= "15ef2946-102d-4814-b321-77286cfc41a6"

```

Download

```
In[97]:= AbsoluteTiming[ByteCount@ResourceData["General Topology EntityStore"]]

Out[97]= {0.926332, 13423880}

```

Reuse the cached version

```
In[98]:= AbsoluteTiming[ByteCount@ResourceData["General Topology EntityStore"]]

Out[98]= {0.036689, 13423880}

```

In a new session

```
In[99]:= Quit

In[1]:= ResourceData; (* there is some initialization that would inflate the timing *)

```

The first use is slightly slower because it resolves the resource name and validates the metadata cache.

```
In[2]:= AbsoluteTiming[ByteCount@ResourceData["General Topology EntityStore"]]

Out[2]= {0.429235, 13423880}

In[3]:= AbsoluteTiming[ByteCount@ResourceData["General Topology EntityStore"]]

Out[3]= {0.034282, 13423880}

```

Keep in mind this cache is on-disk. There is not automatically a kernel-level cache, but you can use `Once[ResourceData[...]]` to effectively cache in the kernel session.

If you want more control (formatting, file location, etc.) then of course you can use standard `Export` operations directly on the data.
