Skip to main content
Fig. 2 | Journal of Cheminformatics

Fig. 2

From: Advanced SPARQL querying in small molecule databases

Fig. 2

SPARQL query using substructure search. This example query demonstrates how to select compounds that contain an antibiotic and an antimutagen as substructures. The first triple pattern (line 7) binds the ATB variable to compounds that are annotated as antibiotics (identified by ChEBI ID 33281). Substructure search is then used to determine compounds that contain the given ATB compounds as substructures. The procedure call is identified by the orchem:substructureSearch IRI and is represented by the triple pattern on lines 1012. The blank node used in the object position (lines 1112) represents parameters of the procedure call. The query structure is denoted by the orchem:query IRI, and its value is specified by another blank node, which represents the structure of a compound to which the ATB variable is bound. The type of the query structure is denoted by the orchem:queryType IRI. The COMPOUND variable is bound to the identified compounds. Compounds that contain an antimutagen (identified by ChEBI ID 73190) are identified in the same way (lines 1722). Because the results of both procedure calls are represented as the COMPOUND variable, the variable contains the intersection of the procedure call results at the end. The query returns the identified compounds (COMPOUND variable) together with the appropriate antibiotic (ATB variable) and antimutagen (AMG variable) as the final result (line 3)

Back to article page