@prefix ex: <https://sparql.uniprot.org/.well-known/sparql-examples/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema: <https://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .

ex:31 a sh:SPARQLExecutable,
        sh:SPARQLSelectExecutable ;
    rdfs:comment "Find UniParc records whose sequence point to the most database entries"@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """PREFIX up: <http://purl.uniprot.org/core/>

SELECT ?sequence ?entries
WHERE
{
    SELECT 
        ?sequence 
        (COUNT(?entry) AS ?entries)
    WHERE
    {
        GRAPH <http://sparql.uniprot.org/uniparc> {
            ?sequence up:sequenceFor ?entry .
        }
    } GROUP BY ?sequence
} ORDER BY DESC(?entries)""" ;
    schema:keywords "cross-reference" , "UniParc" , "count" ;
    schema:target <https://sparql.uniprot.org/sparql/> .

