forked from JervenBolleman/ensembl-r2rml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ensembl_r2rml.ttl
161 lines (151 loc) · 6.79 KB
/
ensembl_r2rml.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
PREFIX rr: <http://www.w3.org/ns/r2rml#>
PREFIX uniprotkb: <http://purl.uniprot.org/uniprot/>
PREFIX up: <http://purl.uniprot.org/core/>
PREFIX ensembltranscript: <http://rdf.ebi.ac.uk/resource/ensembl.transcript/>
PREFIX ensemblterms: <http://rdf.ebi.ac.uk/terms/ensembl/>
PREFIX ensemblprotein: <http://rdf.ebi.ac.uk/resource/ensembl.protein/>
PREFIX ensemblexon: <http://rdf.ebi.ac.uk/resource/ensembl.exon/>
PREFIX ensembl: <http://rdf.ebi.ac.uk/resource/ensembl/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX faldo: <http://biohackathon.org/resource/faldo#>
PREFIX SO: <http://purl.obolibrary.org/obo/SO_000>
PREFIX so: <http://purl.obolibrary.org/obo/so#>
PREFIX sio: <http://semanticscience.org/resource/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
<#EnsemblExon>
rr:logicalTable [ rr:tableName "exon" ];
rr:subjectMap [
rr:template "http://rdf.ebi.ac.uk/resource/ensembl.exon/{stable_id}" ;
rr:class <http://purl.obolibrary.org/obo/SO_0000147>
] ;
rr:predicateObjectMap [
rr:predicate rdfs:label ;
rr:objectMap [ rr:template "{stable_id}" ; rr:termType rr:Literal ]
] .
<#UniProtXrefView> rr:sqlQuery """
SELECT
xref.dbprimary_acc AS acc ,
translation.stable_id AS id
FROM xref
INNER JOIN object_xref ON object_xref.xref_id=xref.xref_id
INNER JOIN translation ON object_xref.ensembl_id=translation.translation_id
WHERE
xref.external_db_id = 2000
AND
object_xref.ensembl_object_type = 'Translation'
""" .
<#UniProtXrefToEnsembl>
rr:logicalTable <#UniProtXrefView> ;
rr:subjectMap [
rr:template "http://purl.uniprot.org/uniprot/{acc}";
rr:class up:Protein
] ;
rr:predicateObjectMap [
rr:predicate rdfs:seeAlso ;
rr:objectMap [ rr:template "http://rdf.ebi.ac.uk/resource/ensembl.protein/{id}" ; rr:termType rr:IRI ]
] .
<#EnsemblXrefToUniProt>
rr:logicalTable <#UniProtXrefView> ;
rr:subjectMap [
rr:template "http://rdf.ebi.ac.uk/resource/ensembl.protein/{id}"
] ;
rr:predicateObjectMap [
rr:predicate rdfs:seeAlso ;
rr:objectMap [ rr:template "http://purl.uniprot.org/uniprot/{acc}" ; rr:termType rr:IRI ]
] .
<#EnsemblTranslation>
rr:logicalTable [ rr:tableName "translation" ] ;
rr:subjectMap [
rr:template "http://rdf.ebi.ac.uk/resource/ensembl.protein/{stable_id}" ;
rr:class ensemblterms:protein
] ;
rr:predicateObjectMap [
rr:predicate rdfs:label ;
rr:objectMap [ rr:template "{stable_id}" ; rr:termType rr:Literal ]
] .
<#EnsemblTranscript>
rr:logicalTable [ rr:tableName "transcript" ] ;
rr:subjectMap [
rr:template "http://rdf.ebi.ac.uk/resource/ensembl.transcript/{stable_id}" ;
rr:class SO:0234
] ;
rr:predicateObjectMap [
rr:predicate rdfs:label ;
rr:objectMap [ rr:template "{stable_id}" ; rr:termType rr:Literal ]
] ;
rr:predicateObjectMap [
rr:predicate rdfs:comment ;
rr:objectMap [ rr:template "{description}" ; rr:termType rr:Literal ]
] ;
rr:predicateObjectMap [
rr:predicate rdf:type ;
rr:objectMap [ rr:template "http://rdf.ebi.ac.uk/terms/ensembl/{biotype}" ; rr:termType rr:IRI ]
# ] ;
# rr:predicateObjectMap [
# rr:predicate so:has_part ;
# rr:objectMap [
# rr:parentTriplesMap <#EnsemblExonTranscript> ;
# rr:joinCondition [
# rr:child "transcript_id";
# rr:parent "exon_id";
# ];
# ]
] .
# <http://rdf.ebi.ac.uk/resource/ensembl.transcript/ENSAPOT00000022055> sio:SIO_000974 <http://rdf.ebi.ac.uk/resource/ensembl.transcript/ENSAPOT00000022055#Exon_3> .
# <http://rdf.ebi.ac.uk/resource/ensembl.transcript/ENSAPOT00000022055#Exon_3> rdf:type sio:SIO_001261 .
# <http://rdf.ebi.ac.uk/resource/ensembl.transcript/ENSAPOT00000022055#Exon_3> sio:SIO_000628 <http://rdf.ebi.ac.uk/resource/ensembl.exon/ENSAPOE00000079685> .
# <http://rdf.ebi.ac.uk/resource/ensembl.transcript/ENSAPOT00000022055#Exon_3> sio:SIO_000300 3 .
<#EnsemblExonTranscript>
rr:logicalTable [ rr:sqlQuery """SELECT
transcript.stable_id AS id,
exon_transcript.rank AS rank
FROM exon_transcript
INNER JOIN transcript ON exon_transcript.transcript_id=transcript.transcript_id
"""
] ;
rr:subjectMap [
rr:template "http://rdf.ebi.ac.uk/resource/ensembl.transcript/{id}#Exon_{rank}" ;
rr:class sio:SIO_001261
] ;
rr:predicateObjectMap [
rr:predicate so:SIO_000300 ;
rr:objectMap [ rr:template "{rank}" ; rr:termType rr:Literal ]
] .
<#EnsemblGene>
rr:logicalTable [ rr:sqlQuery """SELECT
gene.stable_id AS stable_id,
gene.description AS description,
gene.biotype AS biotype,
CASE
WHEN biotype = 'protein_coding' THEN 'http://purl.obolibrary.org/obo/SO_0001217'
WHEN biotype = 'miRNA' THEN 'http://purl.obolibrary.org/obo/SO_0000276'
WHEN biotype = 'misc_RNA' THEN 'http://ensembl.org/glossary/ENSGLOSSARY_0000046'
WHEN biotype = 'piRNA' THEN 'http://purl.obolibrary.org/obo/SO_0001035'
WHEN biotype = 'rRNA' THEN 'http://purl.obolibrary.org/obo/SO_0000252'
WHEN biotype = 'sRNA' THEN 'http://purl.obolibrary.org/obo/SO_0000673'
WHEN biotype = 'snRNA' THEN 'http://purl.obolibrary.org/obo/SO_0000274'
WHEN biotype = 'siRNA' THEN 'http://purl.obolibrary.org/obo/SO_0001035'
WHEN biotype = 'snoRNA' THEN 'http://purl.obolibrary.org/obo/SO_0000275'
WHEN biotype = 'scaRNA' THEN 'http://purl.obolibrary.org/obo/SO_0002095'
WHEN biotype = 'tRNA' THEN 'http://purl.obolibrary.org/obo/SO_0000253'
WHEN biotype = 'ribozyme' THEN 'http://purl.obolibrary.org/obo/SO_0000374'
WHEN biotype = 'processed_pseudogene' THEN 'http://ensembl.org/glossary/ENSGLOSSARY_0000048'
WHEN biotype = 'pseudogene' THEN 'http://purl.obolibrary.org/obo/SO_0000336'
WHEN biotype = 'TR_C_gene' THEN 'http://purl.obolibrary.org/obo/SO_0002134'
WHEN biotype = 'TR_D_gene' THEN 'http://purl.obolibrary.org/obo/SO_0002135'
WHEN biotype = 'TR_J_gene' THEN 'http://purl.obolibrary.org/obo/SO_0002136'
WHEN biotype = 'TR_V_gene' THEN 'http://purl.obolibrary.org/obo/SO_0002137'
WHEN biotype = 'IG_C_gene' THEN 'http://purl.obolibrary.org/obo/SO_0002123'
WHEN biotype = 'IG_D_gene' THEN 'http://purl.obolibrary.org/obo/SO_0002124'
WHEN biotype = 'IG_J_gene' THEN 'http://purl.obolibrary.org/obo/SO_0002125'
WHEN biotype = 'IG_V_gene' THEN 'http://purl.obolibrary.org/obo/SO_0002126'
END rdfbiotype
FROM gene
""" ] ;
rr:subjectMap [
rr:template "http://rdf.ebi.ac.uk/resource/ensembl/{stable_id}"
] ;
rr:predicateObjectMap [
rr:predicate dc:description ;
rr:objectMap [ rr:template "{description}" ; rr:termType rr:Literal ]
] .