sparql-examples

A set of SPARQL examples that are used in different TGX resources

View the Project on GitHub BiGCAT-UM/sparql-examples

001

rq turtle/ttl

Show 100 small molecules with their chemical structure depicted from their SMILES representation and from their image from the database.

Use at

PREFIX chembl: <http://rdf.ebi.ac.uk/terms/chembl#>
PREFIX cheminf: <http://semanticscience.org/resource/>
PREFIX chembl_mol: <http://rdf.ebi.ac.uk/resource/chembl/molecule/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX schema: <https://schema.org/>

Select ?identifier ?image ?smilesDepict where{
  
  ?s a chembl:SmallMolecule.
  ?s chembl:chemblId ?identifier.
  ?s foaf:depiction ?image.
  ?s cheminf:SIO_000008 [ a cheminf:CHEMINF_000018; 
                            cheminf:SIO_000300 ?smilesDepict].
} LIMIT 100
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v2("?identifier"):::projected 
  v3("?image"):::projected 
  v1("?s")
  v4("?smilesDepict"):::projected 
  a1((" "))
  c5(["cheminf:000018"]):::iri 
  c2([http://rdf.ebi.ac.uk/terms/chembl#SmallMolecule]):::iri 
  v1 --"a"-->  c2
  v1 --http://rdf.ebi.ac.uk/terms/chembl#chemblId-->  v2
  v1 --"foaf:depiction"-->  v3
  a1 --"a"-->  c5
  a1 --http://semanticscience.org/resource/SIO_000300-->  v4
  v1 --http://semanticscience.org/resource/SIO_000008-->  a1