@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix ex: <https://bigcat-um.github.io/sparql-examples/WikiPathways/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema: <https://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix spex: <https://purl.expasy.org/sparql-examples/ontology#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

ex:023 a sh:SPARQLExecutable,
       sh:SPARQLSelectExecutable ;
    rdfs:label "Total Lipid Classes"@en ;
    rdfs:comment "Counts the number of individual lipids in a specific LIPID MAPS subclass across human pathways. Change the FILTER value to query different subclasses (FA, GL, GP, SP, ST, PR, SL, PK). This example uses the default values (Species \"Homo sapiens\", LIPID MAPS Class \"FA\"); the WikiPathways SNORQL UI lets you change them."@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX wp: <http://vocabularies.wikipathways.org/wp#>

SELECT (count(DISTINCT ?lipidID) as ?IndividualLipidsPerClass)
WHERE {     ?metabolite a wp:Metabolite ;
    dcterms:identifier ?id ;
    dcterms:isPartOf ?pathwayRes ;
    wp:bdbLipidMaps ?lipidID . #Metabolite DataNodes need to have a LIPID MAPS ID, for this query to count correctly (some lipids might be missed due to missing Xrefs)
  ?pathwayRes a wp:Pathway ;
              wp:organismName "Homo sapiens"; #Filter for a species (ommit when querying all pathways available for all species)
    dcterms:identifier ?wpid ;
    dc:title ?title .
  FILTER regex(str(?lipidID), "FA" ). #Filter for a LIPID MAPS ID subclass: 'FA' Fatty Acids ; 'GL' Glycerolipid ; 'GP' Glycerophospholipid ; 'SP' Sphingolipids ; 'ST' Sterol lipids ; 'PR' Prenol Lipids ; 'SL' Saccharolipids ; 'PK' Polyketides
}""" ;
    schema:target <https://sparql.wikipathways.org/sparql> ;
    schema:keywords "communities", "lipids", "LIPID MAPS" ;
    dcterms:source <https://github.com/wikipathways/SPARQLQueries/blob/f9de718ebdcca57dadb773d47fa4e342cf386857/B.%20Communities/Lipids/LipidClassesTotal.rq> ;
    dcterms:modified "2026-11-10"^^xsd:date ;
    dcterms:license <https://www.gnu.org/licenses/gpl-3.0.html> .
