Constructing a View of the Data (View Step)

This topic provides guidance on configuring a View Step to create a custom view of the data that does not change the graphmart or necessarily materialize any new data. View steps contain SPARQL CONSTRUCT queries to create a view definition in AnzoGraph. Follow the steps below to create a View.

  1. Go to the graphmart for which you want to add a step and then click the Data Layers tab.
  2. On the Data Layers tab, find the layer that you want to add the step to. Click the menu icon () for that layer and select Add Step/View. The Add Step/View dialog box is displayed with the New tab selected.

  3. To create a new View step, select View and then click OK. If you want to clone an existing view, click the Existing Views tab, select the view that you want to clone, and then click OK. Anzo creates or clones the view and displays the Details tab:

  4. On the Details tab, configure the following options as needed:
    • Title: The required name of the step.
    • Description: An optional short description of the step.
    • Materialize the view when activated, otherwise at runtime: This option controls whether a copy of the data the view creates is saved in the graphmart (materialized) or whether this is a virtual view where the data is recreated each time the view runs. If you are creating a view against an extremely large data source or a source that changes often, typically the view should not be materialized. If you want to store a copy of the data that the view creates, select the Materialize the view when activated... check box. When this option is disabled Anzo creates a virtual view where only the view definition is stored in memory and not a copy of the data.
    • Enabled: When creating a new step, the Enabled option is selected by default, indicating that the step is enabled and will run when the layer is loaded or refreshed. If you want to disable the step so that it is not processed, clear the Enabled checkbox.
    • Source: The source data that this step should act upon. Steps can build upon the data generated by steps in other layers or can be self-contained, applying changes that relate only to the data defined in the layer that contains this step. You can select any number of the following options:
      • Self: This option is selected by default and means that the step runs against only the data that is generated in the layer this step belongs to.
      • All Previous Views Within Layer: This options means that the step runs against the data that is generated by all of the previous views in the same layer.
      • Previous View Within Layer: This options means that the step runs against the data that is generated by the previous view in the same layer.
      • All Previous Layers Within Graphmart: This option means that the step runs against the data that is generated by all of the successful layers that precede the layer this step is in. Any failed layers are ignored.
      • Previous Layer Within Graphmart: This option means that the query runs against only the data that is generated by the one layer that precedes the layer this step is in.
    • Data models: This required field specifies the model or models that you want to create this view against. The list displays all of the available models. By default, the field is set to Exclude System Data (). If you want to choose a system model, click the toggle button on the right side of the field to change it to Include System Data (). When system data is included, the drop-down list displays the system models in addition to the user-generated models.
  5. When you have finished configuring the Details tab, click the Query tab. This tab contains the query to use to create the view.

  6. Edit the provided template to compose the CONSTRUCT query the step should run. For information about CONSTRUCT queries, see CONSTRUCT in the W3C SPARQL 1.1 Query Language specification.

    Do not include a GRAPH keyword in the CONSTRUCT clause. Anzo uses the view's URI as the graph URI for the constructed triples. In addition, Anzo uses the configured Source options from the Details tab to automatically replace the ${fromSources} parameter with the appropriate FROM clauses when the query runs.

    You can click the Open in Query Builder button to open the query in the Query Builder, where you can perform practice runs to see results without having to refresh the graphmart or layer.

    If your query connects to a source that requires input of connection and authorization information, Cambridge Semantics recommends that you do not include the connection and authorization values directly in the query. Instead, replace those values with Context Variables from a Query Context. You can access Context Providers for each data source from the step's Query Context tab. For detailed information about query contexts and referencing variables in a query, see Using Query Contexts in Queries.

    If your view query employs the Graph Data Interface, be sure to use the following DataToolkitView service call in the query:

    SERVICE <http://cambridgesemantics.com/services/DataToolkitView>(${targetGraph})

    For more information, see GDI Query Syntax.

  7. Click Save to save the step configuration.

Once the Details tab is configured and the query is written, the step can be run. For information about running this step conditionally by setting up an execution condition, see Defining Execution Conditions. For details about the advanced Hi-Res Analytics settings that control how the view affects dashboards, see Hi-Res Analytics Tab below.

Hi-Res Analytics Tab

The Hi-Res Analytics tab contains advanced settings that control how the layer is exposed to and affects Hi-Res Analytic dashboards.

Changing these settings can have unexpected consequences, and Cambridge Semantics recommends that you do not modify them unless you understand the repercussions.

Display data outputted by the view in Hi-Res Analytics dashboards

This setting controls whether the data accessed by the view is available to query and display in dashboards:

  • When the setting is enabled (the default value), the view data is available to dashboards.
  • When the setting is disabled, other data layers in the graphmart can use the view's data, but the data is not available to use Hi-Res Analytics dashboards.

Display View in Data Layers Facet in Hi-res Analytics

This setting controls whether the view name is displayed in the Data Layers panel on dashboards. The image below shows an example Data Layers panel:

  • When the setting is enabled (the default value), the view is listed in the Data Layers panel.
  • When the setting is disabled, the view's data is always used in dashboards for this graphmart but users do not see the view listed in the Data Layers panel.

User can both view and hide the data outputted by the view

This setting controls whether users have the option to show and hide the view in the Data Layers panel on dashboards:

  • When the setting is enabled (the default value), the view is listed in the Data Layers panel and users have the option to show and hide the layer.
  • When the setting is disabled, whether the view shows up in the Data Layers panel depends on the By default, the data outputted by the view is visible setting. If the view is visible in the Data Layers panel ("By default, the data outputted by the view is visible" is enabled), users cannot toggle it on and off.

By default, the data outputted by the view is visible

This setting controls whether the data generated by the view is visible in dashboards:

  • When the setting is enabled (the default value), the view is listed in the Data Layers panel in dashboards and is selected by default.
  • When the setting is disabled, the view shows up in the Data Layers panel but is not selected. To include the view's data in a dashboard, the user must select the view.

Is Dynamic

Typically this option is used only for Graph Data Interface (GDI) connections where a remote data source is accessed and that source data changes dynamically. If the source is dynamic and you want Anzo to automatically refresh the view of the data at certain internals, select the Is Dynamic checkbox. Then set the Dynamic Refresh Interval (described below).

Dynamic Refresh Interval

If the Is Dynamic option is enabled, this setting configures the interval at which Anzo queries the data source to retrieve any updated view data. Specify the number of milliseconds to wait between refreshes of the data.

Hide from Other Layers/Views

This setting controls whether the other layers in the graphmart can act upon the data in this view.

  • When the setting is disabled (the default value), this view is available as a choice in the Source drop-down list when a step is configured.
  • When the setting is enabled, this view is not listed as a choice in the Source list.

Related Topics