Get Started with Soley Studio

This article gives a quick step-by-step guide on how you can build your first project in Soley Studio. For the beginning, just follow the steps 1-14 sequentially. Once your start-up project is set up, you can iteratively extend the metamodel and your analyses. To get started quickly with Soley Studio, also check out demo videos on Youtube. Click here for the English Version or here for the German Version.
In the following step by step guide, you will find links to the corresponding section of the Demo videos. Let´s get started!

1) Create a Node Metamodel

At first, we want to create a new Metamodel which defines which node and edge classes should become part of our data model. In the Metamodel, we define how our data model is structured. Let´s first focus on how to set up a node Metamodel. To do this, we create a new project (by clicking on “Create a new project…” on the start page or under File –> New –> Project).  Then select the folder Metamodel in the Solution Explorer (on the left side of the Soley Studio window) and pick the file Nodes.gm.  In this file, you define the node instances, their hierarchical relations, and their attributes. Simply copy paste the example code from below in the file to create a node class called BomNode which extends the supra-class IdentifiableNode.

node class Product extends IdentifiableNode{}

Every time you add code to your project, compile it afterward to avoid errors. Therefore, click on the green arrow (build button) in the top section.
Click here to get to the section of the Youtube video describing how to start a new project and create a metamodel.

2) Assign Attributes to Nodes

To later carry out data analyses we don’t just want to model nodes, but also enrich them with decision-relevant information such as sales data, cost or weight. Therefore, we have to add attributes to the node class. As attributes, all primitive data types are allowed. In the code example, string, double and integer attributes are defined. To add the attributes name, sales price, id, quantity, demand, and margin to the node class Product defined as defined in 1), we extend the code snippet from 1) by the attribute names and their data type. Make sure you don´t forget the semi-colon between the attributes.

node class Product extends IdentifiableNode{
name:string;
salesprice:double;
id:string;
quantity:int=1;
demand:int;
margin:double;
}

Click here to get to the section of the Youtube video describing how to add attributes to the metamodel.

3) Import Nodes from Excel or a Database

To import data, you can use the Data Center, the (outdated) Import Dialog or automated import functions.

Import functions are ready-made elements from a library which allow for an automated import of data tables. The following code example shows how to create a simple import sequence using an import function. Let’s assume you have an Excel table called “ImportData.xlsx” with a sheet called “Product_Sales_Data” and the following column structure.

We want to import the whole table starting with row number 3. Open the Ruleset.grg file in the solution explorer. To create node instances of the node type Product for each row of the Excel table, copy + paste the code below into Ruleset.grg.

sequence importProducts_Input{ data_importNodesFromTable("..\\..\\Data\\ImportData.xlsx", 3, 1, -1, -1, "Product_Sales_Data","", "Product", map<int, string>{
1 -> "id",
2 -> "name",
3 -> "demand",
4 -> "salesprice",
5 -> "margin"
}
)
}

This code block is now able to automatically import your data if the location of the source data is equivalent to the defined path, i.e. in the Soley Project folder –> Data. You can find a function for this and many more import types – even for imports from databases – with an explanation in the Libraries Pad.
Have a look at this article for detailed information.  To execute this sequence, right-click on importProducts_Input and select Send to Build and Run. In the Build and Run Pad on the right side, in the section Workflow, just click on Run. After the execution, click on Save to File to store the imported data as a graph.

Click here to go to the section of the Youtube video describing how to import data from Excel, CSV files or databases.

4) Visualize Your Data as Graph

Let’s have a look at our data now. In the solution explorer in the folder Graphs, we find the newly created graph01.slg file. By double-clicking on it, the Open View Dialog gets opened. Click on OK in the Open View Dialog to open the graph file as a graph (and not as a chart or table etc.). After the data import, each imported node instance contains the attribute names defined in the Metamodel and the respective attribute values from the import data file. If you click on a node in the graph, the Properties Pad on the left side of the window shows all information contained in the node instance.

Node with attributes
A node with attributes as visualized in a graph

You can also drag and drop the nodes around and rearrange them in different layouts with the buttons on the left side of the view window.

Click here to get to the section of the Youtube video describing how to visualize the data graph and edit the properties in the Properties pad.

5) Use Mappings and Filters

To visualize more information in a graph view, we can map attributes of nodes to the size of a node or its color. To do so, open the Mapping Pad via Tools –> Mapping in the upper menu bar. It will appear on the right side. You first have to define the node class the mapping should be applied to and which attribute (property) should be mapped. To apply your mapping settings to the graph, click on Map. In our case let’s apply a size mapping of the attribute demand to All Elements as well as a color mapping of the attribute margin. Let´s rearrange the nodes afterward.

Selection in Mapping Pad
Selection in Mapping Pad

Click here to get to the section of the Youtube video describing how to use the Mapping Tool to visualize data in the graph.

We can also choose just to show nodes with attributes of a certain value (or range). To do so, open the Smart Selector Pad (via the tabs on the bottom right side). In this Pad, you can combine Boolean operators to create a selection. For instance, let’s select All Elements and add a condition by clicking once on the Or and then on the “+” symbol. As we would like to select nodes with a demand higher than 500 units, we set the condition to: demand (select from the left dropdown) + isGreaterThan + 500. Now click on Select. You should now see three products selected. This tool offers many more useful features which are. Click here for more details. If you just want to see these products in your graph, click on Invert Selection and then on the Hide Symbol (Hide Symbol) in your graph view.

Selection in Smart Selector Pad
Selection in Smart Selector Pad

Click here to get to the section of the Youtube video describing how to use the Smart Selector to filter out specific elements.

 You have accomplished your first session. Scroll further if you want to read more!

6) Create an Edge Metamodel

Your next step in becoming a data magician will be to create relations between nodes with edges. The first step to realize this is to model your edges in the Edges.gm file in your Metamodel folder. It works exactly like creating the metamodel for nodes. To define an edge class “Relation” with the attribute quantity of type int and the default value of 1, add the following code snipped to the Edges.gm file:

directed edge class Relation extends DirectedEdge{
quantity:int = 1;
}

7) Rule Basics

A rule is a code element (just like a function) which you might know from other coding languages. It represents the main code segment you will use with Soley Studio (for the beginning). A rule consists of a Left-Hand Side (LHS) and Right-Hand Side (RHS). On the LHS, you can define a certain graph pattern (e.g. a node of type Product) which should be identified in the graph. On the RHS, you define how you would like to transform the found pattern (e.g. calculate an attribute, delete the instance or create an edge between two nodes etc.). The RHS is initialized with the modify statement. For further information on the usage of rules, please click here. Step 8) shows an example of a rule which creates an edge between two nodes.

8) Create Edges Using a Rule

Product Nodes connected with edge

To create an edge between two Products, we create a rule which looks for two nodes of type Product and then builds an edge between them. We can also add conditions to define when an edge should be built. In our case, let’s say we want to build an edge between the product with the name attribute BMX Unisex and the product called MTB Fully Unisex. This is realized with the code below:

rule buildRelation{
product1:Product;
product2:Product;
if{product1.name == "BMX Unisex" & product2.name == "MTB Fully Unisex" ;}
modify{
product1 -:Relation-> product2;
}
}

Run the rule just as the import sequence in chapter 3 by right clicking on the rule name “buildRelation” and the select Send to Build and Run. Choose graph01.slg as input file (Tick Selected in the Build and Run Pad and select graph01.slg from the dropdown), click Run and save the output graph again.

Click here to get to the section of the Youtube video describing how to write a rule connecting the nodes.

9) Visual Graph Exploration

Open the latest saved graph, arrange the nodes and right click on one of the nodes that are connected with the edge. In the right-click menu, you can select neighbors and reachable elements of the selected element(s) or elements of the same class to navigate through a highly branched graph. You can also hide unnecessary data to focus on a specific subset. Try it out! You can also use the Modeling Elements Pad to add more edges and nodes to your model.

 You have accomplished your second session. Scroll further if you want to read more!

10) Customize views with the View Manager

The visualization of graphs can be customized in multiple ways.  The key to these customizations is the View Manager. This tool can be opened via Tools –> View Manager. It will pop up on the right side. It shows all defined node and edge classes of the metamodel. To adapt the appearance of the product nodes, click on the Product Node Series. The Properties Pad will now show the attributes of this view series. In the properties pad, you can change the color, the position of the labels, the shape and much more. To save these settings, extract the View as a View Template (.slvt) with the Extract button (Extract Button and save it in the folder View Templates which will pop up automatically). Your saved view templates are ready to be reused by selecting them in the Open View Dialog. To find a visualization for your data graph, open the graph file (.slg), open the Open View Dialog and select one of your predefined view templates or a default template. Click here to get an overview of all view types in Soley Studio and Soley Desk.

11) Create Different Views of Your Data

Sometimes a graph can appear too complex to extract any information from it. Thus, it can be useful to reduce the visualized data and create a chart from a graph. Let’s create a Bubble Chart as an example. To do so, click on one of the view buttons in the top section to open the Open View Dialog again.

View Buttons
View Buttons

Select Bubble in the Create New section of the Open View Dialog and adjust the dropdowns as depicted in the table below. Afterward, confirm with OK. Further attributes can be adjusted in the View Manager and the Properties Pad as above.

Data Set All nodes
Category name
Value demand
Bubble Size margin

Now you can extract some new information from your data graph. But still, a lot of information remains hidden which could be unveiled by adding other visualizations. Extract a view template again to use it in the next step.

Click here to get to the section of the Youtube video describing how to create different visualizations.

12) Combine Multiple Views in a Dashboard

To combine different visualizations and to maximize the insights in your data we can create a dashboard. To do so, navigate again to the Open View Dialog as in chapter 9, select Dashboard and confirm with OK. Next click on the + symbol and select the file “Graph View.slg” in the folder View Templates in the Open View Dialog. Thus, your previously created graph view template is added to the dashboard. Afterward, click on the little + symbol next to the view icons in the toolbar to add the bubble chart view template. Now you can move the windows around to adjust their positioning (more information on Dashboard View here) and finally extract them as a View Template again.

13) Use the Export and Re-Import Functions

If you want to adapt Data in Excel you can export *.slg files to an Excel table with the Export button () in the toolbar. On the other hand, the Import Button () opens the Import Dialog which allows to import or reimport data from Excel. In the case of a reimport in which you did not change the structure of the export excel file, you can simply confirm this dialog with OK. Otherwise, have a look at this article.

Congratulation! You have accomplished your last session. You have learned all the basic features of Studio. You can continue to scroll further to learn more advanced features.

Advanced

14) Create Analyses Using Sequences and Rules

In chapter 3 and 8, we created two different code building blocks. In general, it is most efficient for your analysis to automatically execute different code segments sequentially without sending each rule to the Build and Run Pad manually. Sequences make it possible to run multiple rules or other sequences in a defined sequence. Let’s create a sequence which executes the node import and builds the edge between the two nodes. This is realized by the following code segment:

sequence doAll {
importProducts_Input ;> [buildRelation]
}

Paste this code again in the Ruleset.grg file. If you execute the doAll sequence via the Build and Run Pad, it will first execute the importProducts_Input sequence and afterwards execute the buildRelation rule for all found matches due to the square brackets. There are different ways to execute rules and different operators such as  ;> which define the order in which the code segments are executed.

15) Workflows

As you might have already experienced with Soley Desk, you can automize your analyses in an UI friendly way with workflows. You can create a workflow for the doAll sequence from the last chapter following the description in this article.

Click here to get to the section of the Youtube video describing how to create workflows.

16) App-Deployment

If you have a Soley Studio Professional license, you can share your analyses with your colleagues who use Soley Desk by creating an app. To create the app right-click on your project in the Solution Explorer and choose Assemble Soley App. Details on how to set an icon and the description of the app can be found here.

Click here to get to the section of the Youtube video describing how to create an app out of your Soley Studio project.

Your next steps

Please visit the Soley Studio – Getting Started section of our homepage where you will find self-service material that will let you get started with Soley Studio in no time. You can watch tutorial videos, download a tutorial, a manual and code examples (solution kits).

Was this article helpful?

Related Articles