Set up Modeling Tool and Generate Graph from SysML Model

Return to the Top of the Tutorial (⇧) or Go back to the Prior part of the Tutorial (⇦)

  1. If you are performing this exercise while referencing a Neo4j graph that already has Nodes and Edges, then:
    1. Confirm that you have the right to alter that graph's content
    2. "Drop" all content from that graph (to make it easier to understand what content is getting created by Syndeia) 
      1. Go to the Neo4j browser and enter this Cypher to delete all nodes and edges in the graph.
        MATCH (n) DETACH DELETE (n);
      2. Review the Cypher reference card for the details on this and other Cypher queries.
  2. If the modeling tool is not yet installed or if the Syndeia Plugin is not yet installed, revisit the tool installation guides.
    1. Installation - Syndeia for MagicDraw | Cameo
  3. Obtain a local copy of the sample model used for this tutorial
    1. Retrieve UAV_Graph.mdzip from SysML Models, Profiles and Mappings
      1. after completing the tutorials, you may attempt this process with your own models but the tutorial assumes that the models have the necessary Profiles referenced.
  4. In the modeling tool,
    1. Select File::Open Project... 
    2. Open the model UAV_Graph.mdzip.
  5. Observe that the System package in the model includes child packages named Activity, Interactions, Requirements, State Machines, Stereotypes, Structure, and Use Cases, as shown in the figure below.



    The UAV structure is shown in the SysML BDD "UAV Structure".
    Packages include behavior, structure, and requirement representations of the example UAV system. The elements in these packages are interconnected. You will run Neo4j queries that illustrate the interconnections in the next section.
  6. Enter the Connection settings for the Neo4j service (from Download, Install, and Setup Neo4j) in Syndeia's Settings dialog:
    1. Select any element in the Containment Browser on the left (for this step, it does not matter which one is chosen)
    2. Right click on that element and select Syndeia > Settings from the context menu.
    3. Specify the settings to connect to Neo4j, as shown below
      1. Use graph service: Checkmark Enabled
      2. Select graph database: Neo4j
      3. Protocol: bolt
      4. Hostname: hostname of the server running Neo4j service (e.g. "localhost" or "my.host.com" or similar. Note that the scheme and port are excluded here)
      5. Port: network port of the Neo4j service (e.g. 7687, without the shown comma)
      6. Username: the Neo4j username (not your PC or MagicDraw identity unless they happen to be the same)
      7. Password: the Neo4j password for the Neo4j username
        1. The default password is neo4j (unless you changed it during Neo4j installation).
    4. Click outside any of the changed Settings, then click Apply to save the new Settings values
      1. For troubleshooting: these settings are saved to your user settings file "syndeia.settings"
    5. Save your work, exit the modeling tool, restart it, reopen the saved model, and resume with the next steps.
      1. This reinitializes the Syndeia Plugin to use the newly set connection settings.
  7. Right click on the A_without_connections::System package in the MagicDraw containment tree and select Syndeia > Utils > Neo4j Utils > SysML → Neo4j to to recursively visit all supported SysML elements (recursively) and to export an appropriate collection of Neo4j Nodes and Edges into the Neo4j graph.

  8. Click Yes when prompted to confirm. 



    1. Choose No or Cancel if you prefer not to complete this exercise and to alter the target Neo4j graph.
  9.  After processing completes, a graph will be available in the Neo4j graph database. You will see a confirmation message as below. Click OK.



Return to the Top of the Tutorial (⇧) or Continue to the Next part of the Tutorial (⇨)