]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.tutorial/scl/Tutorial/2.05 Semantic graph.md
Import org.simantics.scl.tutorial from incubator SVN repo
[simantics/platform.git] / bundles / org.simantics.scl.tutorial / scl / Tutorial / 2.05 Semantic graph.md
diff --git a/bundles/org.simantics.scl.tutorial/scl/Tutorial/2.05 Semantic graph.md b/bundles/org.simantics.scl.tutorial/scl/Tutorial/2.05 Semantic graph.md
new file mode 100644 (file)
index 0000000..edd800d
--- /dev/null
@@ -0,0 +1,59 @@
+# Operating on the semantic graph\r
+\r
+All model configurations in Simantics are stored into a semantic graph database.\r
+Therefore it is the most primitive interface for accessing Simantics and in\r
+principle everything is doable with it, although sometimes with a great effort.\r
+\r
+## Understanding semantic graphs\r
+\r
+The best tool for discovering how the model configuration is represented\r
+in the Simantics, is Graph debugger. It can be opened from\r
+**Window/Show View/Other**. Resources can be dragged to the debugger\r
+from the model browser.\r
+\r
+The debugger shows the URI of the resource and all statements related\r
+to it.\r
+\r
+## Accessing resources\r
+\r
+::data[Simantics/DB/Resource]\r
+::value[Simantics/DB/resource,Simantics/DB/relativeResource,Simantics/DB/possibleResource,Simantics/DB/uriOf]\r
+::value[Simantics/DB/currentModel]\r
+\r
+## Navigating\r
+\r
+::value[Simantics/DB/#,Simantics/DB/possibleObject,Simantics/DB/singleObject]\r
+::data[Simantics/DB/Statement]\r
+::value[Simantics/DB/statements,Simantics/DB/singleStatement]\r
+\r
+## Reading literal values\r
+\r
+::value[Simantics/DB/relatedValue, Simantics/DB/nameOf]\r
+\r
+## Type queries\r
+\r
+::value[Simantics/DB/isInstanceOf, Simantics/DB/isSubrelationOf, Simantics/DB/isInheritedFrom]\r
+::value[Simantics/DB/singleTypeOf, Simantics/DB/possibleTypeOf] \r
+\r
+## Transactions\r
+\r
+The graph database can be accessed only in reading or writing transactions. The SCL console\r
+creates the transaction automatically if necessary, but sometimes it is necessary to control\r
+manually where the transactions are started.\r
+\r
+::value[Simantics/DB/syncRead, Simantics/DB/syncWrite, Simantics/DB/asyncRead, Simantics/DB/asyncWrite] \r
+\r
+## Writing\r
+\r
+::value[Simantics/DB/newResource, Simantics/DB/claim, Simantics/DB/claimRelatedValue]\r
+::value[Simantics/DB/deny]\r
+\r
+## Entities\r
+\r
+::class[Simantics/Entity/Entity]\r
+\r
+## Searching\r
+\r
+::value[Simantics/Model/searchByType, Simantics/Model/searchByTypeShallow, Simantics/Model/searchByTypeAndName]\r
+::value[Simantics/Model/searchByTypeAndNameShallow, Simantics/Model/searchByQuery, Simantics/Model/searchByQueryShallow]\r
+    Simantics/Model/searchByTypeAndFilter
\ No newline at end of file