--- /dev/null
+import "Simantics/DB"\r
+import "Simantics/Ontologies"\r
+\r
+importJava "org.simantics.datatypes.literal.GUID" where\r
+ \r
+ data GUID\r
+ \r
+ @JavaName "BINDING"\r
+ guidBinding :: Binding a\r
+ @JavaName random\r
+ randomGUID :: <Proc> GUID\r
+ @JavaName indexString\r
+ guidIndexString :: GUID -> String\r
+ \r
+guidOf :: Resource -> <ReadGraph> GUID\r
+guidOf res = relatedValue_ res L0.identifier guidBinding\r
+ \r
+possibleGUIDOf :: Resource -> <ReadGraph> Maybe GUID\r
+possibleGUIDOf res = possibleRelatedValue_ res L0.identifier guidBinding\r
+\r
+claimGUID :: Resource -> <WriteGraph, Proc> ()\r
+claimGUID res = do\r
+ match possibleGUIDOf res with\r
+ Nothing -> claimRelatedValueWithType_ res L0.identifier L0.GUID randomGUID guidBinding\r
+ _ -> ()
\ No newline at end of file