workshops

Querying the AOP-Wiki

prev

Introduction

The AOP-Wiki SPARQL endpoint is loaded with RDF of the Adverse Outcome Pathway (AOP)-Wiki database (https://aopwiki.org/). The AOP-Wiki serves as the primary repository of qualitative information for AOPs and is a central component in the AOP development effort coordinated by the Organisation for Economic Co-operation and Development (OECD). These AOPs describe mechanistic information about toxicodynamic processes and can be used to develop effective risk assessment strategies. An AOP is initiated by a stressor (e.g. a chemical) that causes a Molecular Initiating Event, which is followed by Key Eevents (measurable, essential steps) along a pathway towards an Adverse Outcome for an organism or population. KEs are connected through Key Event Relationships (KERs), which capture the evidence supporting the AOP in a structured way.

The AOP-Wiki SPARQL endpoint is accessible on https://aopwiki.rdf.bigcat-bioinformatics.org

Figure of RDF schema

Exercises

Exercise 1 - Listing of subjects

The simplest SPARQL queries to explore RDF is to retrieve full lists of subjects of a particular type, which is frequently defined with the predicate rdfs:type or a which can be used interchangably. See the below example of listing all Key Events.

SELECT ?KE 
WHERE {
?KE a aopo:KeyEvent .
}

By looking at the RDF schema figure, you should be able to adapt the SPARQL query to answer all questions that follow.

Since the Key Event links can bring you to the AOP-Wiki for further exploration of the corresponding webpage, we can also directly request all their contents through the SPARQL query. For example, to extract the Key Event title, we add ?KE dc:title ?KEtitle to the SPARQL query. The returned table upon running the query will get wider, so you might need to scroll to the right.

SELECT ?KE ?KEtitle
WHERE {
?KE a aopo:KeyEvent .
?KE dc:title ?KEtitle .
}

Exercise 2 - Counting of subjects

This exercise is about creating simple SPARQL queries that count particular types of subjects in the RDF. See the example SPARQL query below that counts the number of Key Events in the RDF.

SELECT (count (?KE) as ?nKE) 
WHERE {
?KE a aopo:KeyEvent .
}

When copying this SPARQL query and executing it, you will find that the AOP-Wiki RDF contains 1149 KE subjects.

Slightly more complex, we count subjects that have a particular property defined.

Exercise 3 - More detailed exploration

With this exercise, the RDF will be explored a little more extensively. By combining statements in the RDF query, we can link multiple subjects and filter for content that we want to get back from the service.

Exercise 4 - Federated SPARQL query

This final exercise adds an extra level of difficulty by linking the AOP-Wiki RDF with another database through SPARQL (this is called a Federated SPARQL query). In this exercise we will explore the connection between AOP-Wiki and WikiPathways. The SPARQL query will need to contain a SERVICE function and the final query will have the following structure:

PREFIX wp: <http://vocabularies.wikipathways.org/wp#>
SELECT [variables]
WHERE {
[query AOP-Wiki]
SERVICE <https://sparql.wikipathways.org/sparql> {
[query WikiPathways]
}}

The SPARQL query will require the use of the mapped chemical IDs in AOP-Wiki using the skos:exactMatch predicate. To do this, try mapping the resources through the ChEBI IDs. In AOP-Wiki, these are defined as type cheminf:000407 and in WikiPathways these are matched to datanodes with wp:bdbChEBI (hence the PREFIX wp is defined in the SPARQL query). To do this, you might want to do the WikiPathways SPARQL endpoint tutorial first.

End

Thank you for your participation. For any feedback or questions about this section, please contact Marvin Martens (marvin.martens@maastrichtuniversity.nl).