Просмотр исходного кода

Add Xournal++ vocabulary and (generated) description

Joeri Exelmans 3 лет назад
Родитель
Сommit
e3e90f1309

+ 1 - 0
examples/oml/CDF/src/oml/flandersmake.be/cdf/description/bundle.oml

@@ -3,4 +3,5 @@ description bundle <http://flandersmake.be/cdf/description/bundle#> as ^bundle {
 	includes <http://flandersmake.be/cdf/description/my_statechart#>
 	includes <http://flandersmake.be/cdf/description/my_pm#>
 	includes <http://flandersmake.be/cdf/description/my_pm2#>
+	includes <http://flandersmake.be/cdf/description/my_xopp#>	
 }

Разница между файлами не показана из-за своего большого размера
+ 198 - 0
examples/oml/CDF/src/oml/flandersmake.be/cdf/description/my_xopp.oml


+ 2 - 0
examples/oml/CDF/src/oml/flandersmake.be/cdf/vocabulary/acyclic.oml

@@ -2,6 +2,7 @@ vocabulary <http://flandersmake.be/cdf/vocabulary/acyclic#> as acyclic {
 	
 	aspect element []
 	
+	// Add this type as a supertype of any relation to make it acyclic.
 	relation entity Acyclic [
 		from element
 		to element
@@ -27,6 +28,7 @@ vocabulary <http://flandersmake.be/cdf/vocabulary/acyclic#> as acyclic {
 	
 	// Workaround:
 	rule MakeTransitive [
+		// Don't know if this creates unnecessary bloat, compared to the 'transitive'-flag, but it works:
 		transitiveForward(A, B) ^ transitiveForward(B, C) -> transitiveForward(A, C)
 	]
 }

+ 25 - 10
examples/oml/CDF/src/oml/flandersmake.be/cdf/vocabulary/pt.oml

@@ -1,11 +1,31 @@
 vocabulary <http://flandersmake.be/cdf/vocabulary/pt#> as pt {
 	
+	extends <http://flandersmake.be/cdf/vocabulary/acyclic#> as acyclic
 	extends <http://flandersmake.be/cdf/vocabulary/immutable#> as immutable
 	extends <http://flandersmake.be/cdf/vocabulary/ftg#> as ftg
 	extends <http://flandersmake.be/cdf/vocabulary/object_diagram#> as object_diagram
-	extends <http://flandersmake.be/cdf/vocabulary/acyclic#> as acyclic
+
+	extends <http://www.w3.org/2001/XMLSchema#> as xsd
 	
-	aspect Event :> immutable:Thing []
+	aspect Event :> immutable:Thing [
+		restricts scalar property hasTimestamp to exactly 1
+	]
+	
+	scalar property hasTimestamp [
+		domain Event
+		range xsd:dateTimeStamp
+		functional
+	]
+	
+	relation entity HappenedAfter :> acyclic:Acyclic [
+		from Event
+		to Event
+		forward happenedAfter
+		reverse happenedBefore
+		asymmetric
+		irreflexive
+	]
+
 	aspect Artifact :> immutable:Thing []
 	
 	// InternalArtifact: All model elements exist as descriptions in the ontology, are checked for consistency with their vocabulary, and can be part of SPARQL queries.
@@ -15,7 +35,9 @@ vocabulary <http://flandersmake.be/cdf/vocabulary/pt#> as pt {
 	concept ExternalArtifact :> Artifact []
 	
 	concept StartEvent :> Event []
-	concept EndEvent :> Event []
+	concept EndEvent :> Event [
+		restricts relation ended to exactly 1
+	]
 	
 	// We use 'past tense' for all relations on events, because they are historical in nature.
 	
@@ -51,13 +73,6 @@ vocabulary <http://flandersmake.be/cdf/vocabulary/pt#> as pt {
 		to Artifact
 		forward produced
 		reverse wasProducedBy
-	]
-	
-	relation entity HappenedAfter :> acyclic:Acyclic [
-		from Event
-		to Event
-		forward happenedAfter
-		reverse happenedBefore
 		asymmetric
 		irreflexive
 	]

+ 2 - 24
examples/oml/CDF/src/oml/flandersmake.be/cdf/vocabulary/statechart.oml

@@ -1,9 +1,8 @@
 vocabulary <http://flandersmake.be/cdf/vocabulary/statechart#> as statechart {
 	
+	extends <http://flandersmake.be/cdf/vocabulary/acyclic#> as acyclic
 	extends <http://flandersmake.be/cdf/vocabulary/object_diagram#> as object_diagram
 	extends <http://www.w3.org/2001/XMLSchema#> as xsd
-
-	extends <http://flandersmake.be/cdf/vocabulary/acyclic#> as acyclic
 	
 	aspect element :> object_diagram:Object []
 	
@@ -48,28 +47,7 @@ vocabulary <http://flandersmake.be/cdf/vocabulary/statechart#> as statechart {
 		asymmetric
 		irreflexive
 	]
-	
-	// Uncomment to add transitive 'hasAncestor' relation and forbid parent cycles:
-
-	//	relation entity HasAncestor [
-	//		from State
-	//		to State
-	//		forward hasAncestor
-	//		reverse hasDescendant
-	//		asymmetric
-	//		irreflexive
-	//		transitive // seems to have no effect in current version of OWL reasoner, see workaround below
-	//	]
-	//	
-	//	rule ParentIsAncestor [
-	//		hasParent(C,P) -> hasAncestor(C,P)
-	//	]
-	//	
-	//	// Workaround:
-	//	rule MakeTransitive [
-	//		hasAncestor(C,P) ^ hasAncestor(P,P2) -> hasAncestor(C,P2)
-	//	]
-	
+		
 	relation entity Transition :> object_diagram:Link, element [
 		from State
 		to State

+ 147 - 0
examples/oml/CDF/src/oml/flandersmake.be/cdf/vocabulary/xournalpp.oml

@@ -0,0 +1,147 @@
+vocabulary <http://flandersmake.be/cdf/vocabulary/xournalpp#> as xournalpp {
+
+	extends <http://flandersmake.be/cdf/vocabulary/object_diagram#> as object_diagram
+	extends <http://www.w3.org/2001/XMLSchema#> as xsd
+
+	aspect element :> object_diagram:Object []
+	
+	aspect LayerElement :> element [
+		restricts relation inLayer to exactly 1
+		restricts scalar property hasText to exactly 1
+	]
+	scalar property hasText [
+		domain LayerElement
+		range xsd:string
+		functional
+	]
+
+	relation entity HasXMLAttribute [
+		from LayerElement
+		to XMLAttribute
+		forward hasAttribute
+		reverse ofLayerElement
+		inverse functional
+	]
+	
+	concept XMLAttribute :> element [
+		restricts scalar property hasKey to exactly 1
+		restricts scalar property hasValue to exactly 1
+		restricts relation ofLayerElement to exactly 1
+	]
+	scalar property hasKey [
+		domain XMLAttribute
+		range xsd:string
+		functional
+	]
+	scalar property hasValue [
+		domain XMLAttribute
+		range xsd:string
+		functional
+	]
+	
+	concept Text :> LayerElement []
+	concept Stroke :> LayerElement []
+	
+	concept Layer :> element [
+		restricts relation inPage to exactly 1
+	]
+	
+	relation entity HasLayerElement [
+		from Layer
+		to LayerElement
+		forward hasElement
+		reverse inLayer
+		inverse functional
+		asymmetric
+		irreflexive
+	]
+	
+	concept Page :> element [
+		restricts relation inFile to exactly 1
+		restricts scalar property hasWidth to exactly 1
+		restricts scalar property hasHeight to exactly 1
+		restricts scalar property hasBackgroundType to exactly 1
+		restricts scalar property hasBackgroundColor to exactly 1
+		restricts scalar property hasBackgroundStyle to exactly 1
+	]
+
+	scalar property hasWidth [
+		domain Page
+		range xsd:decimal
+		functional
+	]
+	scalar property hasHeight [
+		domain Page
+		range xsd:decimal
+		functional
+	]
+	scalar property hasBackgroundType [
+		domain Page
+		range xsd:string
+		functional
+	]
+	scalar property hasBackgroundColor [
+		domain Page
+		range xsd:string
+		functional
+	]
+	scalar property hasBackgroundStyle [
+		domain Page
+		range xsd:string
+		functional
+	]
+	relation entity HasLayer [
+		from Page
+		to Layer
+		forward hasLayer
+		reverse inPage
+		inverse functional
+		asymmetric
+		irreflexive
+	]
+	
+	concept File :> element [
+		restricts relation hasPage to min 1
+		
+		restricts scalar property hasCreator to exactly 1
+		restricts scalar property hasFileVersion to exactly 1
+		restricts scalar property hasTitle to exactly 1
+//		restricts scalar property hasPreview to exactly 1 // not mandatory
+	]
+	
+	scalar property hasCreator [
+		domain File
+		range xsd:string
+		functional
+	]
+	scalar property hasFileVersion [
+		domain File
+		range xsd:integer
+		functional
+	]
+	scalar property hasTitle [
+		domain File
+		range xsd:string
+		functional
+	]
+	scalar property hasPreview [
+		domain File
+//		range xsd:base64Binary // PNG-encoded // Doesn't seem to be working, workaround below
+		range xsd:string // Workaround
+		functional
+	]	
+	
+	relation entity HasPage [
+		from File
+		to Page
+		forward hasPage
+		reverse inFile
+		asymmetric
+		irreflexive
+		inverse functional
+	]
+	
+	concept Model :> object_diagram:Model [
+		restricts all relation object_diagram:hasObject to element
+	]
+}