Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Determine if resource objects are the same
ResourceFunction["SameResourceQ"][r1,r2,…] returns True if the resources ri represent the same ResourceObject and returns False otherwise. | |
ResourceFunction["SameResourceQ"][r] represents an operator form of ResourceFunction["SameResourceQ"] that can be applied to resources. |
Specify a resource by its name and UUID and see if it is the same resource:
| In[1]:= |
| Out[1]= |
See if a ResourceFunction is the same as its underlying ResourceObject:
| In[2]:= | ![]() |
| Out[2]= |
A custom resource is not the same as one from the repository, even with the same name:
| In[3]:= | ![]() |
| Out[3]= |
Compare more than two resources:
| In[4]:= | ![]() |
| Out[4]= |
Create a matching operator:
| In[5]:= |
| Out[5]= | ![]() |
| In[6]:= |
| Out[6]= |
| In[7]:= |
| Out[7]= |
| In[8]:= |
| Out[8]= |
After creating a resource function, the developer can end up with many saved copies:
| In[9]:= |
| Out[9]= | ![]() |
Create a function to remove all but one of the deployments of a resource:
| In[10]:= | ![]() |
Clean up all but the published resource:
| In[11]:= |
| Out[11]= |
Only the published version remains:
| In[12]:= |
| Out[12]= | ![]() |
SameQ often fails for ResourceObject expressions because the metadata changes when content is downloaded. Get a new resource:
| In[13]:= |
| Out[13]= | ![]() |
The content is in the cloud:
| In[14]:= |
| Out[14]= |
After retrieving the data, the resource metadata has changed:
| In[15]:= |
| Out[15]= |
| In[16]:= |
| Out[16]= | ![]() |
SameQ gives False for the output ResourceObject compared with recreating the same object:
| In[17]:= | ![]() |
| Out[17]= |
SameResourceQ correctly matches the two:
| In[18]:= | ![]() |
| Out[18]= |
Resource names outside of an object are not supported:
| In[19]:= |
| Out[19]= |
Use objects instead:
| In[20]:= |
| Out[20]= |
| In[21]:= |
| Out[21]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License