-
Notifications
You must be signed in to change notification settings - Fork 7
/
05_07_associationsByDisease_Count.ttl
73 lines (66 loc) · 2.9 KB
/
05_07_associationsByDisease_Count.ttl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
@base <http://www.openphacts.org/api> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix dcterms: <http://purl.org/dc/terms/>.
@prefix api: <http://purl.org/linked-data/api/vocab#> .
@prefix rel: <http://vocab.org/relationship/> .
@prefix void: <http://rdfs.org/ns/void#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix sio: <http://semanticscience.org/resource/> .
@prefix ops: <http://www.openphacts.org/api#> .
@prefix cito: <http://purl.org/spar/cito/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix ncit: <http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#> .
@prefix uniprot: <http://purl.uniprot.org/core/> .
<#assocByDiseaseCount> a api:API ;
rdfs:label "Disease"@en ;
api:sparqlEndpoint <http://alpha.openphacts.org:8890/sparql/> ;
api:contentNegotiation api:parameterBased ;
api:variable <#input> ;
api:dataset <http://rdf.imim.es> ;
api:vocabulary <http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#> ;
api:vocabulary <http://semanticscience.org/resource/> ;
api:description "An API configuration to return information about diseases" ;
api:endpoint [
a api:ItemEndpoint ;
api:name "Associations for Disease: Count" ;
api:description "A list of associations which correspond to the disease {uri}.";
api:uriTemplate "/disease/assoc/byDisease/count?uri={uri}" ;
api:itemTemplate "{uri}" ;
api:exampleRequestPath "/disease/assoc/byDisease/count?uri=http%3A%2F%2Flinkedlifedata.com%2Fresource%2Fumls%2Fid%2FC0004238" ;
api:viewer <#assocByDiseaseCountViewer> ;
api:defaultViewer <#assocByDiseaseCountViewer> . ] .
<http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#> api:label "ncit" .
<http://semanticscience.org/resource/> api:label "sio" .
<#input> api:name "uri" ;
api:label "uri";
api:value "A disease URI. e.g.: http://linkedlifedata.com/resource/umls/id/C0004238" ;
rdfs:range rdfs:Resource .
<#assocByDiseaseCountViewer> a api:Viewer ;
api:name "assocByDiseaseCountViewer" ;
api:template
"?ops_item ops:associationsCount ?count .";
api:where
"{ SELECT (COUNT(DISTINCT ?item) AS ?count) {
GRAPH <http://rdf.imim.es> {
?item rdf:type ?type ;
sio:SIO_000628 ?umls_disease_uri ;
sio:SIO_000253 ?primarySource ;
void:inDataset ?assocDataset .
?umls_disease_uri sio:SIO_000095 ?diseaseClass ;
foaf:name ?diseaseName ;
void:inDataset ?diseaseDataset .
?diseaseClass foaf:name ?diseaseClassName ;
void:inDataset ?diseaseClassDataset .
?type rdfs:label ?type_label .
?item sio:SIO_000628 ?gene_uri .
?gene_uri a ncit:C16612 ;
sio:SIO_010078 ?dg_uniprot_uri ;
void:inDataset ?geneDataset .
OPTIONAL { ?item dcterms:description ?description .}
OPTIONAL { ?item sio:SIO_000772 ?pubmed_id . }
}
}}" .