-
Notifications
You must be signed in to change notification settings - Fork 26
/
obo-format.ru
58 lines (50 loc) · 1.88 KB
/
obo-format.ru
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
PREFIX obo: <http://purl.obolibrary.org/obo/>
PREFIX oboInOwl: <http://www.geneontology.org/formats/oboInOwl#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
# Change 'alternative term' to OBO synonym
INSERT { ?s oboInOwl:hasExactSynonym ?syn }
WHERE { ?s obo:IAO_0000118 ?syn } ;
# Change 'NIADID GSCID-BRC alternative term ' to OBO synonym
INSERT { ?s oboInOwl:hasExactSynonym ?syn }
WHERE { ?s obo:OBI_0001886 ?syn } ;
# Change 'ISA alternative term' to OBO synonym
INSERT { ?s oboInOwl:hasExactSynonym ?syn }
WHERE { ?s obo:OBI_0001847 ?syn } ;
# Change 'IEDB alternative term' to OBO synonym
INSERT { ?s oboInOwl:hasExactSynonym ?syn }
WHERE { ?s obo:OBI_9991118 ?syn } ;
# Change 'term editor' to created by (making a list to prevent OBO error)
INSERT { ?s oboInOwl:created_by ?termEds }
WHERE { SELECT (GROUP_CONCAT(?termEd;separator=", ") AS ?termEds) WHERE {
?s obo:IAO_0000117 ?termEd
} } ;
# if it has more than one definition, remove them both for now
# we need to fix versioning on imported terms
DELETE { ?s obo:IAO_0000115 ?def }
WHERE { ?s obo:IAO_0000115 ?def, ?def2 .
FILTER(?def != ?def2) } ;
# handle ientities with multiple labels by marking one precious
# indiscriminately picks which label to use (first one in group)
INSERT { ?s rdfs:label-precious ?precious }
WHERE {
{
SELECT ?s (STRBEFORE(GROUP_CONCAT(?dupLabel; separator="|"), "|") AS ?precious) WHERE {
?s rdfs:label ?label, ?dupLabel .
FILTER (?label != ?dupLabel)
}
GROUP BY ?s
}
} ;
# then removing all others and changing the 'precious' to regular label
DELETE {
?s rdfs:label-precious ?labelP .
?s rdfs:label ?label .
}
INSERT { ?s rdfs:label ?labelP }
WHERE {
?s rdfs:label-precious ?labelP .
?s rdfs:label ?label .
}