-
Notifications
You must be signed in to change notification settings - Fork 1
/
transl_to_rdf_cc.sh
executable file
·84 lines (50 loc) · 1.62 KB
/
transl_to_rdf_cc.sh
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
#!/bin/bash
source ./scripts/env.sh
if [ ! -e $SAXON ] ; then
./scripts/update_extlibs.sh
fi
if [ ! -e $PDBML_XSD ] || [ ! -e $CC2RDF_XSL ] ; then
( cd resource; ./update_pdbx_xsd.sh; ./update_pdbx_owl.sh )
fi
err=pdbx2cc2rdf.err
if [ ! -e $PDBX_PRIMITIVE_TYPE_MAPPING_XML ] ; then
java -jar $SAXON -s:$PDBML_XSD -xsl:$XSD2PRIMITIVE_TYPE_MAPPING_XSL -o:$PDBX_PRIMITIVE_TYPE_MAPPING_XML 2> $err || ( cat $err ; exit 1 )
rm -f $err
echo
echo Generated: $PDBX_PRIMITIVE_TYPE_MAPPING_XML
fi
if [ ! -e $CC2RDF_XSL ] ; then
java -jar $SAXON -s:$PDBML_XSD -xsl:$PDBX2CC2RDF_XSL -o:$CC2RDF_XSL 2> $err || ( cat $err ; exit 1 )
rm -f $err
echo
echo Generated: $CC2RDF_XSL
fi
#if [ ! -d $PDBML_CC ] ; then
# ./scripts/update_cc.sh
#fi
if [ ! -d $XML_CC ] ; then
./scripts/update_cc.sh
fi
mkdir -p $RDF_CC
last=`find $RDF_CC -maxdepth 2 -name '*.rdf.gz' | wc -l 2> /dev/null`
#total=`find $PDBML_CC -maxdepth 1 -name '*.xml.gz' | wc -l 2> /dev/null`
total=`find $XML_CC -maxdepth 1 -name '*.xml' | wc -l 2> /dev/null`
err=`find $RDF_CC -maxdepth 1 -name '*.err' | wc -l 2> /dev/null`
if [ $err != 0 ] || [ $total != $last ] ; then
echo
echo Translating PDBML to chem_comp/RDF...
pdbml_file_list=pdbml_to_rdf_cc_file_list
#find $PDBML_CC -maxdepth 1 -name '*.xml.gz' > $pdbml_file_list
find $XML_CC -maxdepth 1 -name '*.xml' > $pdbml_file_list
for proc_id in `seq 1 $MAXPROCS` ; do
./scripts/transl_to_rdf_cc_worker.sh -d $RDF_CC -l $pdbml_file_list -n $proc_id"of"$MAXPROCS -t $total &
done
if [ $? != 0 ] ; then
echo $0 aborted.
exit 1
fi
wait
echo
rm -f $pdbml_file_list
fi
echo $RDF_CC is up-to-date.