Skip to main content

Query Editor

The Query Editor is a tool for creating advanced queries that return curated data from the metagraph model. The Query Editor can be run as stand alone tool, but the functionality is also integrated in many inorigo® modules, such as the Metagraph Builder and Knowledge Set Builder.

Overview


Video tutorial on the query function



The Query Editor is found from the Workbench under the Launcher Menu. The Query functions can also be utilized when editing a filter in Knowledge Set Builder, applying a filter to columns in the Data Source Editor or querying the model in the Model Builder.

Creating a Query

The Query function lets you build a search query by selecting criteria connected through the logical operators AND and OR. As you build your query through the Query Editors' interface, it will summarize the whole query into a single string that is visible at the top of the page.

You can hover over any sub-query in the query string to highlight it in the query builder.

When the Query Editor is opened, you will be presented with a start-up dialog. From here it is possible to quickly access recently opened and bookmarked queries, as well as all available queries in the environment.


At the top of the dialog select Create New.

Data Type

Before building a query, you must first select a Data Type. This determines the kind of data your query will target and what results it will return. By default, the Data Type is set to Association, but you can choose from other available types depending on your needs.


Match Condition

The Match Condition dropdown decides if the main query should use the logical operator AND or OR. They decide how criterions in your query are combined—whether all conditions must be met or any condition.


Matches All (AND Logical Operator)

When you select Matches All, the query will only return results that satisfy every condition you've defined. All criteria must be true for a record to be included. This narrows your results.

Example:
Find associations where the definition is Person AND has their name starts with the letter A.


Matches Any (OR Logical Operator)

When you select Matches Any, the query will return results that satisfy at least one of the conditions. This broadens your results.

Example:
Find associations where the definition is either an Employee OR a Temporary employee



Adding Criterion


To build your query, you’ll need to add one or more criteria — these are the specific conditions that the data must meet. Think of it as a assembling the pieces of a filter. A Criterion typically consist of a Criterion Type (Such as Definition) And Criterion Operator (For example Equals) and a Value (The specific item - for instance a specific definition).

Click the plus icon (+) to open the menu. From there, you can choose to add a Criterion or create a Subclause. For now, we’ll focus on adding criteria. (Subclauses are covered in a later section.)

The list of available criteria is dynamic — only the criteria that are relevant to the selected Data Type will appear in the menu. This ensures that all options you see are valid for your current query setup.


Removing Criterion

To remove a criterion simply press the minus icon (-) in front of the Criterion. The icon will become red and the criterion will get an outline to preview what is going to be removed from the query. To confirm press the red minus icon (-) once more.



Default Criterion

When the Data Type is set to Association (the default), the Query Editor will automatically add the first criterion, set to Definition. This is since an association always requires a definition.

You can then continue to add more criteria as needed, adjusting each one to refine your query results.


Criterion Type

When adding a criterion you have a number of Criterion Types to choose from the menu. (Depending on the Data Type selected) - Attribute, Definition, Instance, Reference and Relation.


Criterion Operators

Once a criterion has been added, you’ll need to define how it should be evaluated. Each criterion includes a configurable condition, which determines how the query compares data.

We refer to these choices as Operators.

The available operators varies dependent on the Criterion type but include:

  • Equals
  • Not Equals
  • Has Any Value
  • Has No Value
  • Kind Of
  • Not Kind Of
  • In
  • Not In
  • Starts With
  • Ends With
  • Contains

Each operator serves a specific purpose—for example, Equals checks for an exact match, while Kind Of includes results that belong to a classification.

The operator defaults to Kind Of but If you know that your definition doesn’t have any sub classes it’s adviced to change the criterion to Equals. This way the system won’t make unnecessary searches, making it more efficient.

The list of available operators may vary slightly depending on the type of criterion you've selected.


Selecting a Value

After selecting both a criterion (such as Definition) and an operator (such as Equals), the number of matched items will be shown and you can select a value to complete the condition.
You can either select an item from the dropdown menu or search for it.
Note that the dropdown only shows the 100 first matches to optimize the performance.



Subclauses

subclause is a nested query used within a criterion.


Subclauses are useful when you want your condition to be based on the results of another query, rather than a static value.

For example:

If you're using the operator In on a Definition criterion, a subclause lets you say,
"Include all items whose definition is in the result of this other query."


Subclauses behave like regular queries—they have their own Match Condition, and set of Criteria—but they are scoped to feed into a specific part of their parent query.

Creating a Subclause

To create a subclause press the (+) icon and select New Subclause() from the menu. This will give you the option to select a new Match Condition (AND or OR) and you can then build your criterion.

Selecting the In or Not In Operator will also create a subclause.


A subclause can be collapsed into a aggregated string by pressing the black arrow icon in front of it.


Running A Subclause

Subclauses can be run independently from the main query. To do so right click on the subclause and select "Run Subquery" from the menu. To show the whole query again, press "Close Subquery" from the Result Table.



Previewing the Result

To see the result of the query first toggle on the Result Table icon from the toolbar. This will toggle a panel that appears from the bottom of the window.

The Result Table Panel can be resized to your preferences.

To test the query press Run and the table will return all matches to your query.
By Default the result table will display the ID of the matching items, to see the presentation string, simply toggle the Show Prestentations on.


You can right-click an item in the table to open it, bookmark or copy its info.





Attribute

When you add an Attribute criterion, a dialog will open with the available attributes.




The available attributes are determined by the selected Definition or Kind Of operator you've already added to your query. The system looks at the selected data type and narrows down which attributes are relevant based on the definitions involved.


Here’s how it works:
  • If your query includes one or more Definition or Kind Of conditions the attribute list will include all attributes defined on those definitions and their superclasses, even if there are no current instances using them.

• If your query doesn't include any Definition or Kind Of conditions, the system will only show class-level attributes that are generally available across the data type.


Options:

Show Abstract Attributes: Toggle this on to see attributes inherited from a parent

Show Disabled Attributes: From the [...] menu, enable this on to see any attributes that has been disabled.


Attribute Operators

OperatorDescription
EqualsMatches items where the attribute value is exactly equal to the specified value
Has Any ValueMatches items where the attribute has any value set
Has No valueMatches items where the attribute is empty or not set
Not EqualsMatches items where the attribute value is different from the specified value
Starts WithMatches values that begin with the specified text
Ends WithMatches values that end with the specified text
ContainsMatches values that contain the specified text anywhere
Not Starts WithMatches values that do not begin with the specified text
Not Ends WithMatches values that do not end with the specified text
Not ContainsMatches values that do not contain the specified text



Definition

When you add a Definition criterion, a dropdown menu will appear with the Kind Of operator selected by default. The input field will list the total number of Definitions available but the list will only show the 100 first matches.



Definition Operators

OperatorDescription
EqualsMatches items where the definition name is exactly equal to the specified definition
Not EqualsMatches items that have a different definition than the one specified
Has Any ValueMatches items that have any definition set
Has No valueMatches items that have no definition set.
Kind OfMatches associations whose definition is the specified definition or any of its children
Not Kind OfMatches associations whose definition is not the specified definition or any of its children
InMatches items whose definition is found within the result of a subclause
Not InMatches items whose definition is not found in the result of a subclause



Reference

When you add a Reference criterion, a dialog will open with the available references.
The available references are determined by the Definition or Kind Of filters already present in your query. These filters provide the context needed to decide which reference will be available.


Reference Operators

OperatorDescription
EqualsMatches items where the definition name is exactly equal to the specified definition
Not EqualsMatches items that have a different definition than the one specified
Has Any ValueMatches items that have any definition set
Has No valueMatches items that have no definition set
InMatches items whose definition is found within the result of a subclause
Not InMatches items whose definition is not found in the result of a subclause



Relation

When you add a Relation criterion, the available relations are determined by the Definition or Kind Of filters already present in your query. These filters provide the context needed to decide which relations should be available.

Here's how it works:
  • If your query includes one or more Definitions, the Relation list will include all relations defined on those definitions and their superclasses—regardless of whether there are currently any instances using those relations.

  • If your query does not include a Definitions, the system falls back to only showing class-level relations that are generally available across the selected data type.



Deep

When configuring a Relation criterion, you can enable a setting called Deep. This allows the query to match not only directly related definition, but also items connected through a recursive chain of the selected relation.

For example

If the relation is "Classified by", enabling Deep will include the definition's parent, the parent’s parent, and so on up the hierarchy.

If the relation is "Is a kind of", enabling Deep will include the definition's children, their children, and so on down the hierarchy.



The deep function is available when creating a criterion based on a Relation. After an relation and definition has been selected, hover anywhere over the row to reveal a […] menu at the end of the criterion. From here it is possible to select Deep. When enabled an icon looking like it's "drilling down" is shown.

Relation Operators

OperatorDescription
EqualsMatches items where the definition name is exactly equal to the specified definition
Not EqualsMatches items that have a different definition than the one specified
Has Any ValueMatches items that have any definition set
Has No valueMatches items that have no definition set
InMatches items whose definition is found within the result of a subclause
Not InMatches items whose definition is not found in the result of a subclause






Parameters in Queries

Parameters in Queries are currently only supported when creating a filter from the Knowledge Set Builder.


Overview



A good example is to create a parameter with the variable {NOW}, which always returns the current date and time, this allows us to set up queries that always use the current date, rather than a fixed one in a query. Another example is to let users change the content of a column by setting another defining unit over the API. We can then use the knowledge set as a foundation for interactive, custom built solutions for the end users.


Adding a Parameter

Add parameters through the menu that appears at the end of the criterion. Press the […] icon that is revealed when hovering over the criterion, and select New Parameter…


Re-using Parameters

You can reuse a previously created parameter from the same menu by selecting "Select Parameter".
Parameters are only reusable for the Knowledge Set they were created.
Note that editing the parameter will affect all criterion using it.

Edit & Remove Parameters

Once a parameter has been created you can Edit and Remove it from the same […] menu.



Parameter NameThe name of the Parameter. This is important to identify and reuse it later.
Data TypeThe class of the parameter. inorigo® defaults to correct Data Type.
ParameterThe expression that is executed when the query is run. Parameters are written within {braces}. For a complete list of functions that can be used for parameters, check out the section on Expressions.



© 2025 Inorigo AB. All rights reserved.