Main»How To Make Queries

How To Make Queries

How to make queries

RDFScape provides different ways to query the content of ontologies. The ones presented here do not require, in principle, Cytsoscape. Other interactive and visual ways of exploring ontologies are presented in How to browse ontologies , How to define with visual queries ? and How to work with visual queries?.


Four modalities are supported:

  • RDQL queries

  • SPARQL queries

  • String based queries

  • Class based queries

We will show in detail the whole query process only for RDQL queries, as in the other cases this remain constant, while the way the query is formulated is different

RDQL queries

0 Select the "Browser" panel. Query functinalities are presenetd here becouse they are the staring point to browse ontologies (see How to browse ontologies).

1 Query modality selection. Choose here which query system you want to use (RDQL, SPARQL, Class based, String based). Default is RDQL, that is also shown in this example. For details on RDQL syntax please consult specifications and a tutorial. Note that RDQL is obsoleted by SPARQL.

2 Enter your query. The text provided here is a template, defined based on available namespaces. You have to edit this text and complete your query. Note that if default namespace are present, you will also need to update the namespace block. You need to select "Clear Query" to update the namespace block to include the actual list of namespaces present in the ontologies.

3 Perfom the query. In case of sytntax errors, an error message will report them.

4 After a query a list of the results will be presented here (see image below). Colors and prefixes of namespaces are syncrhonized with the settings shown in Selecting namespaces (except that all namespaces are always active here).

5 If no graph in Cytoscape is available, this creates a new graph. While it is possible to add elements from the ontology to any graph in Cyotoscape, integration of ontologies and other biological graphs is more complex than just ading nodes to the same "graph". Consult Linking graphs in Cytoscape and ontologies to understeand how to realize this integration.

6 Plot the selected portion of the results into the current Cytoscape Graph (see image below). Only Resources are plotted (blank nodes and properties are filtered), this is becouse these queries don't allow to distingish the role of URIs. More complex ways to extract and visualize the content of ontologies in Cytoscape are povided in How to work with visual queries?. The visualization of results in a Cytoscape Graph is subject to some settings and transformations as illustrated in How to browse ontologies and How to tune visualization options (note that a yCircle layout is automatically performed when elements are plotted to the network this way).

7 Reset the query (elements visualized in Cytoscape are not affected).

Note that all the queries are relative to ontologies enriched by customizable inferential process (see How to use inference).

SPARQL queries

SPARQL queries are expressed in the SPARQL query language. Only queries that returns variable bindings are accepted here. For more information on SPARQL consult SAPRQL specifications or a tutorial.

String based queries

String based queries requires you to specify a string, and wether the system should loof for an exact of partial match (checking "Approx" corresponds to partial matches). Partial mathes looks for words that "contains" the string provided by the user. The system will look at URI and other properties of URI such as rdfs:label.

For istance if the query string is "P53" and the ontology contains an assertion like: rdfs:label "P53"

The system will return:

Class based queries

Shows a list of all classes (named classes) known by the system. The query consists in teh selection of one class, and the results is the list of all instances of this class.

Note that the behaviour of this query, and expecially the ability to list classes, may depend on the reasoning systm used (more in How to use inference).