summaryrefslogtreecommitdiff
path: root/schema/baserock-owl-schema.turtle
blob: 42dafba86c70340ddd5d5d6e284e568017acc79d (plain)
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# Baserock Definitions schema, version -1

# This ontology teases out a simple formal model of the data represention
# aspect of the Baserock definitions format (v5).
#
# It's not a great example of an ontology, because it models a generic problem
# using terms and a data model tied closely to how a couple of specific tools
# work. In future we need to produce a more general-purpose model. I hope
# this schema is a useful step towards doing that.


# Things you can do with this:

# Check it is valid:
#  rapper -i turtle baserock-owl-schema.turtle
#
# Visualise it in a rubbish way:
#  rapper -i turtle -o dot baserock-owl-schema.turtle | dot -Tpng > schema.png
#
# Edit with Protégé:
#  just open it in protege, it can save to Turtle format as well but will lose
#  comments and formatting.


# Metadata

@prefix : <http://baserock.org/definitions/example-schema#> .
@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#> .

: a owl:Ontology ;
  rdfs:comment "Example schema for Baserock Definitions format version 5." .


## Entities

# Source definitions

:Morphology a owl:Class .

:Cluster a owl:Class ;
   rdfs:subClassOf :Morphology .

:System a owl:Class ;
   rdfs:subClassOf :Morphology .

:Stratum a owl:Class ;
   rdfs:subClassOf :Morphology .

:Chunk a owl:Class ;
   rdfs:subClassOf :morphology .

# Container contents

:SystemDeployment a owl:Class .

:ChunkReference a owl:Class .

# Products (for artifact split rules).

:Artifact a owl:Class .

:StratumArtifact a owl:Class ;
   rdfs:subClassOf :Artifact .

:ChunkArtifact a owl:Class ;
   rdfs:subClassOf :Artifact .


## Shared properties

:hasName a owl:DatatypeProperty , owl:FunctionalProperty ;
  rdfs:domain :Morphology ;
  rdfs:range xsd:string .

:hasDescription a owl:DatatypeProperty , owl:FunctionalProperty ;
  rdfs:domain :Morphology ;
  rdfs:range xsd:string .


## Cluster-specific properties

:containsSystemDeployment a owl:ObjectProperty ;
  rdfs:domain :Cluster ;
  rdfs:range :SystemDeployment .


## SystemDeployment-specific properties

:deploysSystem a owl:ObjectProperty , owl:FunctionalProperty ;
  rdfs:domain :SystemDeployment ;
  rdfs:range :System .

:hasLabel a owl:DatatypeProperty , owl:FunctionalProperty ;
  rdfs:domain :SystemDeployment ;
  rdfs:range xsd:string .

:hasType a owl:DatatypeProperty , owl:FunctionalProperty ;
  rdfs:domain :SystemDeployment ;
  rdfs:range xsd:string .

:hasLocation a owl:DatatypeProperty , owl:FunctionalProperty ;
  rdfs:domain :SystemDeployment ;
  rdfs:range xsd:string .

# FIXME: this is actually a key-value mapping, how do you do that?
:hasConfigurationSetting a owl:DatatypeProperty ;
  rdfs:domain :SystemDeployment ;
  rdfs:range xsd:string .


## System-specific properties

:containsStratumArtifact a owl:ObjectProperty ;
  rdfs:domain :System ;
  rdfs:range :StratumArtifact .

:hasArchitecture a owl:DatatypeProperty, owl:FunctionalProperty ;
  rdfs:domain :System ;
  rdfs:range xsd:string .

:hasConfigurationExtension a owl:DatatypeProperty ;
  rdfs:domain :System ;
  rdfs:range xsd:string .


## Stratum-specific properties

:produces a owl:ObjectProperty , rdf:Seq ;
  rdfs:domain :Stratum ;
  rdfs:range :StratumArtifact .

:hasStratumBuildDependency a owl:ObjectProperty ;
  rdfs:domain :Stratum ;
  rdfs:range :Stratum .

:containsChunkReference a owl:ObjectProperty ;
  rdfs:domain :Stratum ;
  rdfs:range :Chunk .


## ChunkReference-specific properties

:refersToChunk a owl:ObjectProperty , owl:FunctionalProperty ;
  rdfs:domain :ChunkReference ;
  rdfs:range :Chunk .

:repo a owl:DatatypeProperty , owl:FunctionalProperty ;
  rdfs:domain :ChunkReference ;
  rdfs:range xsd:string .

:ref a owl:DatatypeProperty , owl:FunctionalProperty ;
  rdfs:domain :ChunkReference ;
  rdfs:range xsd:string .

:unpetrifyRef a owl:DatatypeProperty , owl:FunctionalProperty ;
  rdfs:domain :ChunkReference ;
  rdfs:range xsd:string .

:hasChunkBuildDependency a owl:ObjectProperty ;
  rdfs:domain :ChunkReference ;
  rdfs:range :Chunk .

:prefix a owl:DatatypeProperty , owl:FunctionalProperty ;
  rdfs:domain :ChunkReference ;
  rdfs:range xsd:string .

# FIXME: actually only 'bootstrap' and 'normal' are valid values.
:buildMode a owl:DatatypeProperty , owl:FunctionalProperty ;
  rdfs:domain :ChunkReference ;
  rdfs:range xsd:string .


## Chunk-specific properties

# build-system isn't included here, as it overlaps with the *-commands
# fields in an unfortunate way.

# Note that representing lists of things in RDF is a bit of a pain.
# http://smiy.sourceforge.net/olo/spec/orderedlistontology.html might
# be worth investigating.

:produces a owl:ObjectProperty , rdf:Seq ;
  rdfs:domain :Chunk ;
  rdfs:range :ChunkArtifact .

:preConfigureCommands a owl:DatatypeProperty , rdf:Seq ;
  rdfs:domain :Chunk ;
  rdfs:range xsd:string .

:configureCommands a owl:DatatypeProperty , rdf:Seq ;
  rdfs:domain :Chunk ;
  rdfs:range xsd:string .

:postConfigureCommands a owl:DatatypeProperty , rdf:Seq ;
  rdfs:domain :Chunk ;
  rdfs:range xsd:string .

:preBuildCommands a owl:DatatypeProperty , rdf:Seq ;
  rdfs:domain :Chunk ;
  rdfs:range xsd:string .

:buildCommands a owl:DatatypeProperty , rdf:Seq ;
  rdfs:domain :Chunk ;
  rdfs:range xsd:string .

:postBuildCommands a owl:DatatypeProperty , rdf:Seq ;
  rdfs:domain :Chunk ;
  rdfs:range xsd:string .

:preInstallCommands a owl:DatatypeProperty , rdf:Seq ;
  rdfs:domain :Chunk ;
  rdfs:range xsd:string .

:installCommands a owl:DatatypeProperty , rdf:Seq ;
  rdfs:domain :Chunk ;
  rdfs:range xsd:string .

:postInstallCommands a owl:DatatypeProperty , rdf:Seq ;
  rdfs:domain :Chunk ;
  rdfs:range xsd:string .


# Artifact properties

:includes a owl:DatatypeProperty, rdf:Seq ;
  rdfs:domain :Artifact ;
  rdfs:range xsd:string .