@prefix cito: <http://purl.org/spar/cito/> .
@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#> .

ex:075 a sh:SPARQLExecutable,
       sh:SPARQLSelectExecutable ;
    rdfs:label "Metabolites with InChIKeys from Wikidata"@en ;
    rdfs:comment "Lists metabolites in WikiPathways with their Wikidata identifier and fetches their InChIKey from Wikidata. Limited to 50 metabolites. Uses a federated SERVICE call; may be slow depending on endpoint availability."@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """PREFIX wp: <http://vocabularies.wikipathways.org/wp#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>

SELECT ?metabolite ?wikidata ?inchikey WHERE {
  {
    SELECT ?metabolite ?wikidata WHERE {
      ?metabolite a wp:Metabolite ;
        wp:bdbWikidata ?wikidata .
    } LIMIT 50
  }
  SERVICE <https://query.wikidata.org/sparql> {
    ?wikidata wdt:P235 ?inchikey .
  }
} LIMIT 50""" ;
    schema:target <https://sparql.wikipathways.org/sparql> ;
    schema:keywords "Wikidata", "InChIKey", "metabolite" ;
    spex:federatesWith <https://query.wikidata.org/sparql> ;
    cito:usesMethodIn <https://www.wikipathways.org/federated.html> .
