-
Notifications
You must be signed in to change notification settings - Fork 3
/
idr_r2rml.ttl
65 lines (56 loc) · 2.7 KB
/
idr_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
PREFIX rr: <http://www.w3.org/ns/r2rml#>
PREFIX uniprotkb: <http://purl.uniprot.org/uniprot/>
PREFIX taxon: <http://purl.uniprot.org/taxonomy/>
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/>
<#project>
rr:logicalTable [ rr:tableName 'project' ] ;
rr:subjectMap [ rr:template "http://example.org/project/{id}" ;
rr:class <http://schema.org/Project> ] ;
rr:predicateObjectMap [
rr:predicate rdfs:label ;
rr:objectMap [ rr:template "{name}" ;
rr:termType rr:Literal ;
rr:language "en" ]
] .
<#project_annotation_join>
rr:logicalTable [ rr:sqlQuery """select
p.id as project_id,
a.id as annotation_id
from project p
left outer join projectannotationlink pal on p.id = pal.parent
left outer join annotation a on pal.child = a.id""" ] ;
rr:subjectMap [ rr:template "http://example.org/project/{project_id}" ] ;
rr:predicateObjectMap [
rr:predicate rdfs:seeAlso ;
rr:objectMap [
rr:template "http://example.org/annotation/{annotation_id}"
]
] .
<#annotation>
rr:logicalTable [ rr:tableName 'annotation' ] ;
rr:subjectMap [ rr:template "http://example.org/annotation/{id}" ;
rr:class up:Annotation ] . #Wrong but just to get something
<#annotation_mapvalue_uniprot_join>
rr:sqlQuery """select an.id as id, anmv.value as value from annotation_mapvalue anmv, annotation an where anmv."name" = 'UniProt ID' and an.id = anmv.annotation_id""" .
<#annotation_mapvalue_to_uniprot>
rr:logicalTable <#annotation_mapvalue_uniprot_join> ;
rr:subjectMap [ rr:template "http://example.org/annotation/{id}" ] ;
rr:predicateObjectMap [ rr:predicate rdfs:seeAlso ;
rr:objectMap [ rr:template "http://purl.uniprot.org/uniprot/{value}" ;
rr:class up:Protein ]
] .
<#annotation_mapvalue_from_uniprot>
rr:logicalTable <#annotation_mapvalue_uniprot_join> ;
rr:subjectMap [ rr:template "http://purl.uniprot.org/uniprot/{value}" ;
rr:class up:Protein ] .