@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:050 a sh:SPARQLExecutable,
       sh:SPARQLSelectExecutable ;
    rdfs:label "Metabolites with Duplicate Wikidata Mappings"@en ;
    rdfs:comment "Detects metabolites that are mapped to more than one Wikidata identifier, listing all duplicate mappings per metabolite."@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """PREFIX wp: <http://vocabularies.wikipathways.org/wp#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>

SELECT DISTINCT ?metaboliteID (GROUP_CONCAT(DISTINCT ?wikidata;separator=", ") AS ?results) WHERE {
  ?metaboliteID a wp:Metabolite .
  ?metaboliteID wp:bdbWikidata ?wikidata .
  ?metaboliteID wp:bdbWikidata ?wikidata2 .
  FILTER(?wikidata != ?wikidata2)
} GROUP BY ?metaboliteID""" ;
    schema:target <https://sparql.wikipathways.org/sparql> ;
    schema:keywords "curation" ;
    dcterms:source <https://github.com/wikipathways/SPARQLQueries/blob/fa9e83ba0da9ac61f188219e5b7d91ea73f7a5cc/G.%20Curation/MetabolitesDoubleMappingWikidata.rq> ;
    dcterms:modified "2026-03-08"^^xsd:date ;
    dcterms:license <https://www.gnu.org/licenses/gpl-3.0.html> .
