summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2015-06-29 15:25:12 +0100
committerSam Thursfield <sam.thursfield@codethink.co.uk>2015-06-29 15:25:12 +0100
commitc72e302a033ed32abbc232887b3069253b9672e0 (patch)
tree1aafd80087e5f75bc889226419a65f1590014f21
parent2835f3f170aea9154ed831802729a5777743bae3 (diff)
downloaddefinitions-c72e302a033ed32abbc232887b3069253b9672e0.tar.gz
Draft of Baserock Definitions ontology
Change-Id: I259c96364c9be6b1ccf802d664994c71c4f5cbaa
-rw-r--r--schema/baserock-owl-schema.turtle142
1 files changed, 142 insertions, 0 deletions
diff --git a/schema/baserock-owl-schema.turtle b/schema/baserock-owl-schema.turtle
new file mode 100644
index 00000000..c7c56afd
--- /dev/null
+++ b/schema/baserock-owl-schema.turtle
@@ -0,0 +1,142 @@
+# 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
+
+## Entities
+
+@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#> .
+
+:Morphology a owl:Class .
+
+:Cluster a owl:Class ;
+ rdfs:subClassOf :morphology .
+
+:SystemDeployment a owl:Class .
+
+:System a owl:Class ;
+ rdfs:subClassOf :morphology .
+
+:Stratum a owl:Class ;
+ rdfs:subClassOf :morphology .
+
+:ChunkReference a owl:Class .
+
+:Chunk a owl:Class ;
+ rdfs:subClassOf :morphology .
+
+
+## Shared properties
+
+:hasName a owl:DatatypeProperty ;
+ rdfs:domain :Morphology ;
+ rdfs:range xsd:string .
+
+:hasDescription a owl:DatatypeProperty ;
+ 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 ;
+ rdfs:domain :SystemDeployment ;
+ rdfs:range :System .
+
+:hasLabel a owl:DatatypeProperty ;
+ rdfs:domain :SystemDeployment ;
+ rdfs:range xsd:string .
+
+:hasType a owl:DatatypeProperty ;
+ rdfs:domain :SystemDeployment ;
+ rdfs:range xsd:string .
+
+:hasLocation a owl:DatatypeProperty ;
+ 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
+
+:containsStratum a owl:ObjectProperty ;
+ rdfs:domain :System ;
+ rdfs:range :Stratum .
+
+:hasArchitecture a owl:DatatypeProperty ;
+ rdfs:domain :System ;
+ rdfs:range xsd:string .
+
+:hasConfigurationExtension a owl:DatatypeProperty ;
+ rdfs:domain :System ;
+ rdfs:range xsd:string .
+
+
+## Stratum-specific properties
+
+: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 ;
+ rdfs:domain :ChunkReference ;
+ rdfs:range :Chunk .
+
+:repo a owl:DatatypeProperty ;
+ rdfs:domain :ChunkReference ;
+ rdfs:range xsd:string .
+
+:ref a owl:DatatypeProperty ;
+ rdfs:domain :ChunkReference ;
+ rdfs:range xsd:string .
+
+:unpetrifyRef a owl:DatatypeProperty ;
+ rdfs:domain :ChunkReference ;
+ rdfs:range xsd:string .
+
+:hasChunkBuildDependency a owl:ObjectProperty ;
+ rdfs:domain :ChunkReference ;
+ rdfs:range :Chunk .
+
+
+## Chunk-specific properties
+
+# build-system isn't included here, as it overlaps with the *-commands
+# fields in an unfortunate way.
+
+# FIXME: how do you do lists ??