PRA3006-SPARQL

countingChEMBLAssays.rq

Database ChEMBL
SPARQl endpoint https://chemblmirror.rdf.bigcat-bioinformatics.org/sparql
License CC-BY-SA 3.0 Unported

Code examples: curl

SPARQL

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX dbpedia2: <http://dbpedia.org/property/>
PREFIX dbpedia: <http://dbpedia.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX cco: <http://rdf.ebi.ac.uk/terms/chembl#>
PREFIX chembl_molecule: <http://rdf.ebi.ac.uk/resource/chembl/molecule/>

SELECT (count(?assay) as ?assayCount)
WHERE {
  ?activity a cco:Activity ;
                cco:hasMolecule chembl_molecule:CHEMBL294873 ;
                cco:hasAssay ?assay .

  ?assay cco:hasSource ?source .
}

Run or Edit

Output

assayCount
6

Code examples

curl

curl -o countingChEMBLAssays.rq https://raw.githubusercontent.com/BiGCAT-UM/PRA3006-SPARQL/master/sparql/countingChEMBLAssays.rq
curl -H "Accept: text/tab-separated-values" -G https://chemblmirror.rdf.bigcat-bioinformatics.org/sparql --data-urlencode query@countingChEMBLAssays.rq

This SPARQL query is available under CCZero.