Graph Studio Java SDK

This topic provides instructions for setting up an Graph Studio development environment using the Graph Studio software development kit (SDK) and Eclipse integrated development environment (IDE). The sample instructions below deploy the Graph Studio SDK in a Windows environment with Eclipse IDE for Java Developers Version 4.12.0. Graph Studio SDK and Eclipse can also be deployed on Linux and Mac operating systems.

Requirements

Make sure that the Graph Studio development server meets the requirements in Graph Studio Server Requirements. In addition, install the following programs for working with the Graph Studio Java SDK:

  • Eclipse for Java Developers Version 4.7.3+: Install the Eclipse IDE for Java Developers or Eclipse IDE for Enterprise Java Developers.
  • Java Runtime Environment Version 8: Eclipse and the Graph Studio SDK require JDK version 8. Cambridge Semantics tests with jdk1.8.0_181.

Deploying the Graph Studio SDK with Eclipse

Follow the instructions below to import the Graph Studio Java SDK to Eclipse and configure and test the environment.

  1. Download the Graph Studio SDK .zip file to the host server. Do not unpack the file.
  2. In Eclipse, click the File menu and select Import. Eclipse opens the Import dialog box. For example:

  3. In the Import dialog box, expand the General folder and select Existing Projects into Workspace and click Next. Eclipse opens the Import Projects dialog box. For example:

  4. Select the Select archive file radio button and then browse to and select the Graph Studio SDK .zip file. Eclipse loads the .zip file and lists the contents in the Projects field. For example:

    The Graph Studio SDK contains three projects:

    • com.cambridgesemantics.anzo.sdk: This core project is required for creating solutions. It contains the Graph Studio libraries that provide the Graph Studio APIs and extension points as well as the libraries that enable Graph Studio to run in the development environment.
    • com.cambridgesemantics.anzo.sdk.server This core project is required for creating solutions. It contains configuration files for running Graph Studio as well as a launcher for starting the Graph Studio server.
    • com.cambridgesemantics.anzo.sdk.api: This is an example project that contains sample Java programs that illustrate several aspects of the Graph Studio client APIs. Each program is a simple example that demonstrates how to communicate with the Graph Studio server to read, write, and query data. See the comments in each example for an explanation of what each one demonstrates.
  5. Click Finish to import the Graph Studio SDK .jar files. The process may take a few minutes. When the import is complete, Eclipse opens the workspace. At this point in the process, expect to see several errors in the workspace. For example:

  6. Import your Graph Studio license:
    1. Make sure that you have a copy of the Graph Studio license on the server. If necessary, you can view and download a copy from the Cambridge Semantics Support Center.
    2. Rename the license file so its file extension is .lic. For example, license.lic.
    3. In the Eclipse Package Explorer, right-click com.cambridgesemantics.anzo.sdk.server and select Import.
    4. In the Import dialog box, expand the General folder and select File System. Then click Next. Eclipse opens the File System Import dialog box. For example:

    5. Click the Browse button next to the From directory field and select the directory that contains the license file. Eclipse displays the directory and its contents.

    6. Select the license file in the right pane, and then click Finish.
  7. Install the Eclipse Plugin Development Tools:
    1. Click the Help menu and select Install New Software. Eclipse opens the Install dialog box.
    2. In the Install dialog box, click the Work with drop-down list and select All Available Sites. In the search field below the Work with field, type "PDE" and wait for Eclipse to find the plugin tools. Select the checkbox next to Eclipse Plugin Development Tools, including Eclipse PDE Plug-in Developer Resources. For example:

    3. Click Next and accept the license agreement, then click Finish. Eclipse installs the software and then prompts you to restart the application.
  8. After restarting Eclipse, load the Graph Studio SDK Target Platform:
    1. Click the Window menu and select Preferences.
    2. In the Preferences dialog box, expand Plug-in Development and select Target Platform.
    3. In the Target Platform definitions, select the Anzo SDK Devel Target checkbox. For example:

    4. Click Apply and Close. Eclipse loads the Graph Studio SDK Target Platform.
  9. Test the environment:
    1. In the Eclipse workspace, click the Run menu and select Run Configurations. Eclipse opens the Run Configurations dialog box.
    2. On the left side of the dialog box, expand the OSGi Framework folder and select Anzo (SDK). For example:

    3. Click Run to run the Graph Studio SDK target platform. A Console tab opens in Eclipse and shows the status messages. When Graph Studio starts, the console displays the message "All Currently Registered Services started." For example:

      If Graph Studio fails to start, one of the common reasons for the failure is that one or more of the Graph Studio ports are in use by other software. See Firewall Requirements for information about the ports that Graph Studio uses.

To explore the sample Java programs that are included in the Graph Studio SDK, expand the com.cambridgesemantics.anzo.sdk.api package in the Package Explorer. In the package, expand the src directory and then the com.cambridgesemantics.anzo.sdk.api directory to see the list of sample programs. For example:

To run a program, right-click the .java file and select Run As > Java Application. For more information about using the Graph Studio SDK, see the Graph Studio Java SDK Guide.pdf that is distributed in the SDK .zip file.