@prefix ex: <https://sparql.swisslipids.org/.well-known/sparql-examples/> .
@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#> .

ex:4 a sh:SPARQLExecutable,
        sh:SPARQLSelectExecutable ;
    rdfs:label "Potential lipid structures for lipid classes"@en ;
    rdfs:comment """For a given (list of) lipid classes (e.g. SWISSLIPID:000399814 (Ceramide) SWISSLIPID:000000007 (Sphingomyelin (iso-d17:1(4E))), return a list of the corresponding Isomeric subspecies. 
The query should return the lipid recommended names (?name) as well as identifiers (?id).
Recapitulates the “browse lipid classes” function of the website (in batch)."""@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """PREFIX SWISSLIPID: <https://swisslipids.org/rdf/SLM_>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

# Example 4
SELECT ?startId ?startName ?id ?name
WHERE
{
  VALUES ?startId { SWISSLIPID:000399814 SWISSLIPID:000000567}
  ?startId SWISSLIPID:rank SWISSLIPID:Class .
  ?startId rdfs:label ?startName .
  ?id rdfs:subClassOf+ ?startId .
  ?id SWISSLIPID:rank SWISSLIPID:Isomeric_Subspecies ;
	  rdfs:label ?name .    
} 
ORDER BY ?startId""" ;
    schema:target <https://sparql.swisslipids.org/sparql/> .

