-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy path08_01_tree.ttl
98 lines (93 loc) · 4.33 KB
/
08_01_tree.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
@base <http://www.openphacts.org/api#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix uniprot: <http://purl.uniprot.org/core/> .
@prefix api: <http://purl.org/linked-data/api/vocab#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix ops: <http://www.openphacts.org/api#> .
@prefix dcterms: <http://purl.org/dc/terms/>.
<#tree> a api:API ;
rdfs:label "Concept Class Hierarchies"@en ;
api:sparqlEndpoint <http://alpha.openphacts.org:8890/sparql/> ;
api:contentNegotiation api:parameterBased ;
api:variable _:hierarchy ;
api:dataset <http://www.ebi.ac.uk/chembl> ;
api:dataset <http://purl.uniprot.org/enzyme/> ;
api:vocabulary rdfs: ;
api:vocabulary skos: ;
api:vocabulary uniprot: ;
api:description "An API configuration to return information about concept class based on hierarchical structures. Currently supported hierarchies are the BioAssay Ontology, the Enzyme Classification, the ChEMBL Target Tree, the ChEBI ontology, the Disease Ontology and the Gene Ontology" ;
api:endpoint [
a api:ItemEndpoint ;
api:name "Hierarchies: Root Nodes" ;
api:description "A representation of the root classes in each hierachy. The BioAssay Ontology, the ChEBI Ontology, the Disease Ontology, the Gene Ontology, the Enzyme Classification, and the ChEMBL Target Tree are currently supported." ;
api:itemTemplate "http://www.openphacts.org/api#conceptHierarchy" ;
api:variable <http://purl.uniprot.org/enzyme> ;
api:variable <http://www.ebi.ac.uk/chembl/target> ;
api:variable <http://www.ebi.ac.uk/chebi> ;
api:variable <http://www.geneontology.org> ;
api:variable <http://www.bioassayontology.org> ;
api:variable <http://purl.obolibrary.org/obo/doid> ;
api:uriTemplate "/tree" ;
api:exampleRequestPath "/tree";
api:viewer <#treeRootViewer> ;
api:defaultViewer <#treeRootViewer> ] .
<http://www.ebi.ac.uk/chembl> api:label "ChEMBL - RDF" .
<http://purl.uniprot.org/enzyme/> api:label "Enzyme Classification" .
<http://www.ebi.ac.uk/chembl/target> api:name "chembl" .
<http://purl.uniprot.org/enzyme> api:name "enzyme" .
<http://www.ebi.ac.uk/chebi> api:name "chebi" .
<http://www.geneontology.org> api:name "go" .
<http://www.bioassayontology.org> api:name 'bao' .
<http://purl.obolibrary.org/obo/doid> api:name 'disease' .
_:hierarchy api:name "root" ;
api:label "root" ;
api:value "Restrict results by hierarchy. Currently one of 'bao', 'chembl', 'chebi', 'disease', 'enzyme', 'go'" ;
api:filterVariable "?g_short" ;
rdfs:subPropertyOf api:graphFilter ;
a rdf:Property .
<#treeRootViewer> a api:Viewer ;
api:name "treeRootViewer";
api:template "ops:conceptHierarchy dcterms:hasPart ?g_short .
?g_short ops:rootNode ?root_node .
?root_node skos:prefLabel ?name .
<http://purl.uniprot.org/enzyme> skos:prefLabel 'Enzyme Classification' .
<http://www.ebi.ac.uk/chembl/target> skos:prefLabel 'ChEMBL Target Hierarchy' .
<http://www.ebi.ac.uk/chebi> skos:prefLabel 'ChEBI Ontology' .
<http://www.geneontology.org> skos:prefLabel 'GeneOntology' .
<http://www.bioassayontology.org> skos:prefLabel 'BioAssayOntology' .
<http://purl.obolibrary.org/obo/doid> skos:prefLabel 'Human Disease Ontology' .
";
api:where "{
SELECT DISTINCT ?root_node ?g_short WHERE {
VALUES ?g {
<http://purl.uniprot.org/enzyme/direct>
<http://www.ebi.ac.uk/chembl/target/direct>
<http://www.ebi.ac.uk/chebi/direct>
<http://www.geneontology.org>
<http://www.bioassayontology.org>
<http://purl.obolibrary.org/obo/doid>
}
GRAPH ?g {
[] rdfs:subClassOf ?root_node .
MINUS {
?root_node rdfs:subClassOf ?super .
FILTER( ?super != ?root_node && ?super != <http://purl.uniprot.org/core/Enzyme> )
}
FILTER ( isURI(?root_node) )
BIND (IF(?g = <http://purl.uniprot.org/enzyme/direct>, IRI(<http://purl.uniprot.org/enzyme>) ,
IF(?g = <http://www.ebi.ac.uk/chembl/target/direct>, IRI(<http://www.ebi.ac.uk/chembl/target>) ,
IF(?g = <http://www.ebi.ac.uk/chebi/direct>, IRI(<http://www.ebi.ac.uk/chebi>) ,
IF(?g = <http://www.geneontology.org>, IRI(<http://www.geneontology.org>) ,
IF(?g = <http://www.bioassayontology.org>, IRI(<http://www.bioassayontology.org>) ,
IF(?g = <http://purl.obolibrary.org/obo/doid>, IRI(<http://purl.obolibrary.org/obo/doid>), 'Error')))))) AS ?g_short )
}
}
}
{
?root_node rdfs:label ?name
}
UNION {
?root_node skos:prefLabel ?name
}
MINUS { ?root_node uniprot:obsolete true }
" .