-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget-uberon-lifecycles.sh
More file actions
executable file
·48 lines (41 loc) · 1.57 KB
/
get-uberon-lifecycles.sh
File metadata and controls
executable file
·48 lines (41 loc) · 1.57 KB
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
#!/usr/bin/env bash
set -e
cd "$(dirname "$0")"
mkdir -p out
curl 'https://www.ebi.ac.uk/ols/api/select?ontology=uberon&fieldList=iri,label,description&rows=60&wt=xml&childrenOf=http://purl.obolibrary.org/obo/UBERON_0000105&q=?' \
| python -m json.tool \
| grep --no-group-separator -A 1 '"iri": "http://purl.obolibrary.org/obo/UBERON_' \
| perl -p -e 's/(UBERON_[0-9]+",)\n/$1/' \
| sed -r 's/^.*"iri": "(.+)",.*"label": (".*")$/ <\1> rdfs:label \2 ./' \
> out/uberon-lifecycle-labels.ttl
(
echo "@prefix : <http://purl.org/nanopub/temp/uberon-lifecycles-labels/> ."
echo "@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> ."
echo "@prefix np: <http://www.nanopub.org/nschema#> ."
echo "@prefix dct: <http://purl.org/dc/terms/> ."
echo "@prefix xsd: <http://www.w3.org/2001/XMLSchema#> ."
echo "@prefix orcid: <https://orcid.org/> ."
echo "@prefix npx: <http://purl.org/nanopub/x/> ."
echo "@prefix prov: <http://www.w3.org/ns/prov#> ."
echo ""
echo ":Head {"
echo " : np:hasAssertion :assertion ;"
echo " np:hasProvenance :provenance ;"
echo " np:hasPublicationInfo :pubinfo ;"
echo " a np:Nanopublication ."
echo "}"
echo ""
echo ":assertion {"
cat out/uberon-lifecycle-labels.ttl
echo "}"
echo ""
echo ":provenance {"
echo " :assertion prov:wasDerivedFrom <https://www.ebi.ac.uk/ols/api> ."
echo "}"
echo ""
echo ":pubinfo {"
echo " : dct:creator orcid:0000-0002-1267-0234 ."
echo "}"
) > out/uberon-lifecycle-labels.trig
./np sign out/uberon-lifecycle-labels.trig
./np check out/signed.uberon-lifecycle-labels.trig