Publishing and Distributing Wolfram Language Content with the New Resource System

Bob Sandheinrich, Wolfram Research

Join the Conversation #WolframTechConf

Agenda

Resource System Overview

Repositories, Resources and their parts

Submissions and Publisher Accounts

A tour of repositories

Data

NeuralNet

Demonstration

Function

Formula

Creating your own resources

Future repositories and features

APIs

Paclets

Marketplace

Resource System Overview

The resource system is divided into repositories of different content types

Repositories typically have the following features

A website with a dedicated page for each resource

Functions for integrating with the Wolfram Language

Repository-specific metadata

Each repository is made of individual resources

Resources are represented by ResourceObject

resource=ResourceObject["Meteorite Landings"]

A resource has metadata and content

resource["ContentSize"]

resource["Details"]

resource["ContentElements"]

For data resources, the content is retrieved with ResourceData

meteors=ResourceData[resource,"Dataset"];
RandomSample[meteors,5]

The Resource System is open to submissions

Submitting to the resource system requires a publisher account.

Request one here:

One publisher can submit to any repository

Many users can be authorized to use a single PublisherID

A user can be authorizeed to use many PublisherIDs

Requests for PublisherIDs and resource submissions are manually reviewed by people at Wolfram.

Currently, publisher accounts are managed manually. There are online tools in development.

A Tour of Current and Upcoming Repositories

Data Repository

Released in April 2017

Content is data (essentially any static Wolfram Language expression)

Neural Net Repository

RELEASED RIGHT NOW!

More Information:

Meghan Rieu-Werden and Matteo Salvarezza
	Fantastic Neural Networks and Where to Find Them
 	8:30 AM - 9:00 AM, Friday October 20 2017
 	Spartan/Golden Gopher

Website:

WL example:

imageDepth=ResourceObject["Relative Depth Hourglass Net Trained on Depth in the Wild Data"]

imageDepth["Details"]

imageDepth["ContentElements"]

net=ResourceData[imageDepth]

adam=First@WebImageSearch["Michaelangelo's David","Images","MaxItems"->1]

depthMap=net[adam]

ListPlot3D[-depthMap,PlotStyle->Texture[ImageReflect[adam]],PlotTheme->{"Minimal","NoAxes"}]

Demonstration Repository

Released 2007, integrated into WL RIGHT NOW!

The Demonstrations project has been around for ten years and has over ten thousand demonstrations.
They are now easier to find and use in the Wolfram Language.

We are still in the process of making all the demonstrations available.

WL example:

engine=ResourceObject["Demonstrations Project: Radial Engine"]

engine["Details"]

engine["AuthoringInformation"]

engine["SymbolsUsed"]

ResourceData[engine]

Formula Repository

FormulaData has existed since version 10 (July 2014) and has over 1000 formulas, it will be part of the resource system very soon.

Future location:  http://resources.wolframcloud.com/FormulaRepository

In the coming weeks

WL example (this is nothing new):

gravity=ResourceObject["Gravitational Acceleration"]

FormulaData[gravity]

FormulaData[gravity,"QuantityVariableTable"]

FormulaData[gravity,<|"M"->(Entity["Moon", Entity["PlanetaryMoon","Moon"], "Entity[\"PlanetaryMoon\", \"Moon\"]", "planetary moon"])[(EntityProperty["mass", EntityProperty["PlanetaryMoon","Mass"], "EntityProperty[\"PlanetaryMoon\", \"Mass\"]"])],"r"->(Entity["Earth", Entity["Planet","Earth"], "Entity[\"Planet\", \"Earth\"]", "planet"])[(EntityProperty["average radius", EntityProperty["Planet","Radius"], "EntityProperty[\"Planet\", \"Radius\"]"])]|>]

More metadata

gravity["Categories"]

gravity["SourceMetadata"]

Website (private development page)

Function Repository

Future location:  http://resources.wolframcloud.com/FunctionRepository

In the coming weeks

Choose functions from the repository to extend the Wolfram Language

resource=ResourceObject["Lookup Sequence"]

resource["Description"]

LookDeeply=ResourceFunction[resource]

data=<|"People"->
<|"Suzanne"-><|"Hobbies"->{"Fishing","Trumpet","Poker"}|>,
"Fred"-><||>|>|>;

LookDeeply[data,{"People","Suzanne","Hobbies"},"BORING!"]

↓LookupSequence[data,{"People","Fred","Hobbies"},"BORING!"]

One more

symbolGraph=ResourceObject["Symbol Dependency Graph"]

ResourceFunction[symbolGraph]

Clear[a,b,c];
a[x_]:=b[c[x]];
b[x_]:=c[x^2];
c[1]:=1;

ResourceFunction[symbolGraph][a]

Use the symbol for this resource

With[{sym=Symbol[symbolGraph["SymbolName"]]},
ResourceFunction[symbolGraph][sym,VertexLabels->Placed["Name",Tooltip]]
]

Put ‘em together

FormulaData[
ResourceObject["Gravitational Acceleration"],
ResourceFunction[ResourceObject["LookupSequence"]][
Normal@ResourceData["Sample Data: Solar System Planets and Moons"],
{"Jupiter","Moons","Europa"}
]
]

Wolfram|Alpha agrees

(Entity["Europa", Entity["PlanetaryMoon","Europa"], "Entity[\"PlanetaryMoon\", \"Europa\"]", "planetary moon"])[(EntityProperty["gravity", EntityProperty["PlanetaryMoon","Gravity"], "EntityProperty[\"PlanetaryMoon\", \"Gravity\"]"])]

UnitConvert[%,"Meters"/"Seconds"^2]

Create your own resource

With a notebook

CreateNotebook["DataResource"]

Programmatically

findACelebrity[img_]:=Module[{rectangles, celebs,clickNames},
rectangles=FindFaces[img];
celebs=Classify["NotablePerson"][ImageTrim[img,#]&/@rectangles];
rectangles=Rectangle@@@rectangles;
clickNames=With[{name=CommonName[#]},
ClickPane[Style[name,Yellow,18],Print[First@TextSentences[WikipediaData[name]]]&]
]&/@celebs;
HighlightImage[img,{rectangles,
Thread[Text[clickNames,RegionCentroid/@rectangles]]}]
]

findACelebrity[]

findACelebrity[CurrentImage[]]

myResource=ResourceObject[<|"Name"->"Find A Celebrity",
"ResourceType"->"Function",
"Function"->(findACelebrity[#]&),
"Description"->"Try to find a celebrity in a picture"|>]

ResourceFunction[myResource]

Add more metadata and deploy it to a cloud object

withDetails=ResourceObject[<|"Name"->"Find A Celebrity",
"ResourceType"->"Function",
"Function"->(findACelebrity[#]&),
"Description"->"Try to find a celebrity in a picture",
"Details"->"Use Wolfram Languages image processing and Classification to highlight and label faces in an image with celebrity look-a-likes.",
"SourceMetadata"-><|"Creator"->"Bob Sandheinrich","Date"->Today|>|>]

withDetails["ExampleNotebook"]

Deploy it to share

co=CloudDeploy[withDetails,Permissions->"Public"]

ResourceObject[co]

Submit your own resource for publication

ResourceSubmit[withDetails,PublisherID->"Wolfram"]

Reviewers at Wolfram will review your resource and either accept it or contact you with suggestions.

The Future

Repositories

API resources
Paclet resources
Device Connections
Service Connections

The Wolfram Marketplace

Make money for your creations!

Thank You - Q&A

bobs@wolfram.com

`