How queries and views work together

Queries are different from find and search operations. Although these operations find and retrieve artifacts from the index, queries can be customized to populate views with artifacts.

Queries gather context-specific groups of artifacts. Use the artifacts to populate views and query result pages.

When you create a query for shared use, first create it in My Queries so you can test and refine the query privately.

Build and run a query to gather artifacts to see if you want to use the query to populate a view. For example, you might want to create and run a query to build a parts list for your product hierarchy, as the following image shows.

The image shows the SPARQL query source for a custom "Flat parts list" query.

After you create the query, click Run. The query retrieves data from the index and displays the results. Check the results to be sure that the query gathered the correct set of artifacts. Modify the query and test the results until you achieve your quality standard.

The following image shows a sample of the results for a custom Flat parts list query.

The image shows the artifacts that are gathered by a custom "Flat parts list" query.

If you are satisfied with the results, copy the query code.
  1. In the My/Shared Views page, find a view that you want to embed a query in and copy the view to My Views.
  2. In My/Shared Views, hover over the appropriate view and click the Edit icon on the right.
  3. In the Views editor, in the Page Properties editor on the right, in the Queries section, click Add....
  4. In the Edit Query dialog box, paste the query in the SPARQL query area, and then click OK.

    To view a table of date, enumeration, and system parameters, and sample output for each, see Predefined query parameters.

  5. Save the changes to the query and close the views editor by clicking Save.

Run the updated view. Fully test and refine the view before you share the view with a team.

If you need to make refinements to the query in the view, you can edit the query again by using the Queries section in the Page Properties editor.

When you are satisfied that the query and view are working together to gather the right set of information for your team, share the view.


Feedback