@prefix ex:<https://purl.expasy.org/sparql-examples/neXtProt/> .
@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:NXQ_00258 a sh:SPARQLExecutable,
        sh:SPARQLSelectExecutable ;
    rdfs:comment "Proteins involved in diseases due to intronic variants with one selected publication"@en ;
    sh:prefixes _:sparql_examples_prefixes ;
    sh:select """PREFIX : <http://nextprot.org/rdf/>
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX ncit: <http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX sio: <http://semanticscience.org/resource/>
PREFIX so: <http://purl.obolibrary.org/obo/SO_>

SELECT DISTINCT ?entry (str(?gen) as ?gene) ?diseaseTitle ?sampleArticle WHERE {
 SERVICE <https://rdf.disgenet.org/sparql> {
 SELECT DISTINCT ?protein ?diseaseTitle (sample(?article) as ?sampleArticle) WHERE {
 ?vda sio:SIO_000628 ?variant,?disease .
	?vda sio:SIO_000772 ?article .
 ?disease a sio:SIO_010299 ; dcterms:title ?diseaseTitle . # true disease, use ncit:C7057 for traits
 ?variant a so:0001627 ; dcterms:title ?variantTitle . # intron variant
 ?variant so:associated_with ?gene .
 ?gene a ncit:C16612; sio:SIO_010078 ?protein .
 } group by ?protein ?diseaseTitle
 }
 BIND(IRI(replace(str(?protein),"purl","www")) AS ?unipage) .
 ?entry :swissprotPage ?unipage .
 ?entry :gene / :recommendedName / rdfs:label ?gen .
} order by ?entry""" ;
    schema:keywords "disease",
        "federated query",
        "publication",
        "tutorial",
        "variant" ;
    schema:target <https://sparql.nextprot.org/sparql> ;
    spex:federatesWith <https://rdf.disgenet.org/sparql> .

