-
Notifications
You must be signed in to change notification settings - Fork 38
/
create-ontology-ttl.sh
executable file
·159 lines (143 loc) · 4.71 KB
/
create-ontology-ttl.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
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
#!/bin/bash
write_to_file()
{
# initialize a local var
local file="Ontology.ttl"
local version=$1
if [[ -z "$version" ]] ; then
echo Warning! No version parameter supplied. >&2
echo Add version parameter to script. >&2
echo Example: $'\n\t'sh create-ontology-ttl.sh 4.1.0 $'\n'>&2
echo Exiting >&2
exit 1;
fi
# delete old content and add prefixes
cat > "$file" <<'EOF'
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix dct: <http://purl.org/dc/terms/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix ids: <https://w3id.org/idsa/core/> .
@prefix vann: <http://purl.org/vocab/vann/> .
@prefix void: <http://rdfs.org/ns/void#> .
@prefix voaf: <http://purl.org/vocommons/voaf#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix cc: <http://creativecommons.org/ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
EOF
# add meta-data
cat >> "$file" <<EOF
# Description of this ontology
# ----------------------------
ids:
a voaf:Vocabulary, owl:Ontology ;
rdfs:isDefinedBy <https://w3id.org/idsa/core/> ;
rdfs:label "IDS Information Model"@en ;
dct:title "The International Data Spaces Information Model"@en ;
rdfs:comment "This ontology defines classes and properties for describing participants, infrastructure, data and services of the International Data Spaces (formerly known as Industrial Data Space)." ;
cc:license <http://www.apache.org/licenses/LICENSE-2.0> ;
dct:creator
<https://github.com/cmader> ,
<https://github.com/jpullmann> ,
<http://sebastian.tramp.name> ;
dct:contributor
_:AndreasMueller ,
_:AnnaKasprzik ,
<https://github.com/sebbader> ,
<https://github.com/Maboeckmann> ,
<https://github.com/clange> ,
<https://github.com/HaydarAk> ,
<https://github.com/jlangkau> ,
<https://github.com/JohannesLipp> ,
<https://github.com/mkollenstart> ,
<https://github.com/lcomet> ;
dct:publisher ids:IDSA ;
dct:created "2017-09-26"^^xsd:date ;
dct:modified "$(date +%Y-%m-%d)"^^xsd:date ;
owl:versionInfo "${version}" ;
owl:versionIRI <https://w3id.org/idsa/core/${version}> ;
vann:preferredNamespaceUri "https://w3id.org/idsa/core/" ;
vann:preferredNamespacePrefix "ids" ;
rdfs:seeAlso <https://international-data-spaces-association.github.io/InformationModel/> ;
void:vocabulary
vann: ,
void: ,
voaf: ,
dct: ,
foaf: ;
.
<http://www.apache.org/licenses/LICENSE-2.0>
rdfs:label "Apache License Version 2.0, January 2004" ;
.
ids:IDSA
a dct:Agent, foaf:Organization ;
foaf:homepage <https://www.internationaldataspaces.org> ;
rdfs:label "International Data Spaces Association" ;
.
<http://sebastian.tramp.name>
a dct:Agent, foaf:Person ;
foaf:name "Sebastian Tramp" ;
.
<https://github.com/cmader>
a dct:Agent, foaf:Person ;
foaf:name "Christian Mader" ;
.
<https://github.com/jpullmann>
a dct:Agent, foaf:Person ;
foaf:name "Jaroslav Pullmann" ;
.
_:AndreasMueller
a dct:Agent, foaf:Person ;
foaf:name "Andreas Müller"
.
_:AnnaKasprzik a dct:Agent, foaf:Person ;
foaf:name "Anna Kasprzik" ;
.
<https://github.com/sebbader> a dct:Agent, foaf:Person ;
foaf:name "Sebastian Bader" ;
.
<https://github.com/HaydarAk> a dct:Agent, foaf:Person ;
foaf:name "Haydar Akyürek" ;
.
<https://github.com/JohannesLipp> a dct:Agent, foaf:Person ;
foaf:name "Johannes Lipp" ;
.
<https://github.com/clange> a dct:Agent, foaf:Person ;
foaf:name "Christoph Lange" ;
.
<https://github.com/Maboeckmann> a dct:Agent, foaf:Person ;
foaf:name "Matthias Böckmann" ;
.
<https://github.com/jlangkau> a dct:Agent, foaf:Person ;
foaf:name "Jörg Langkau" ;
.
<https://github.com/mkollenstart> a dct:Agent, foaf:Person ;
foaf:name "Maarten Kollenstart" ;
.
<https://github.com/JohannesLipp> a dct:Agent, foaf:Person ;
foaf:name "Johannes Lipp" ;
.
<https://github.com/lcomet> a dct:Agent, foaf:Person ;
foaf:name "Lina Molinas Comet" ;
.
EOF
# search for files in selected folders
echo '# ----------------------------' >> "$file"
echo '# Imports of class files' >> "$file"
echo 'ids:' >> "$file"
# search for files in selected folders (omitting metamodel/)
for class in $(find \
model/* \
taxonomies/ \
codes/ \
-maxdepth 1 -name "*.ttl")
do
if [[ -f $class ]]; then
echo " owl:imports <$class> ;" >> "$file"
fi
done
echo ". " >> "$file"
}
# execute it
write_to_file $1