]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.scl.tutorial/scl/Tutorial/2.05 Semantic graph.md
Merge "Fix to OrderedSetTemplate, preference for autocompletion"
[simantics/platform.git] / bundles / org.simantics.scl.tutorial / scl / Tutorial / 2.05 Semantic graph.md
1 # Operating on the semantic graph\r
2 \r
3 All model configurations in Simantics are stored into a semantic graph database.\r
4 Therefore it is the most primitive interface for accessing Simantics and in\r
5 principle everything is doable with it, although sometimes with a great effort.\r
6 \r
7 ## Understanding semantic graphs\r
8 \r
9 The best tool for discovering how the model configuration is represented\r
10 in the Simantics, is Graph debugger. It can be opened from\r
11 **Window/Show View/Other**. Resources can be dragged to the debugger\r
12 from the model browser.\r
13 \r
14 The debugger shows the URI of the resource and all statements related\r
15 to it.\r
16 \r
17 ## Accessing resources\r
18 \r
19 ::data[Simantics/DB/Resource]\r
20 ::value[Simantics/DB/resource,Simantics/DB/relativeResource,Simantics/DB/possibleResource,Simantics/DB/uriOf]\r
21 ::value[Simantics/DB/currentModel]\r
22 \r
23 ## Navigating\r
24 \r
25 ::value[Simantics/DB/#,Simantics/DB/possibleObject,Simantics/DB/singleObject]\r
26 ::data[Simantics/DB/Statement]\r
27 ::value[Simantics/DB/statements,Simantics/DB/singleStatement]\r
28 \r
29 ## Reading literal values\r
30 \r
31 ::value[Simantics/DB/relatedValue, Simantics/DB/nameOf]\r
32 \r
33 ## Type queries\r
34 \r
35 ::value[Simantics/DB/isInstanceOf, Simantics/DB/isSubrelationOf, Simantics/DB/isInheritedFrom]\r
36 ::value[Simantics/DB/singleTypeOf, Simantics/DB/possibleTypeOf] \r
37 \r
38 ## Transactions\r
39 \r
40 The graph database can be accessed only in reading or writing transactions. The SCL console\r
41 creates the transaction automatically if necessary, but sometimes it is necessary to control\r
42 manually where the transactions are started.\r
43 \r
44 ::value[Simantics/DB/syncRead, Simantics/DB/syncWrite, Simantics/DB/asyncRead, Simantics/DB/asyncWrite] \r
45 \r
46 ## Writing\r
47 \r
48 ::value[Simantics/DB/newResource, Simantics/DB/claim, Simantics/DB/claimRelatedValue]\r
49 ::value[Simantics/DB/deny]\r
50 \r
51 ## Entities\r
52 \r
53 ::class[Simantics/Entity/Entity]\r
54 \r
55 ## Searching\r
56 \r
57 ::value[Simantics/Model/searchByType, Simantics/Model/searchByTypeShallow, Simantics/Model/searchByTypeAndName]\r
58 ::value[Simantics/Model/searchByTypeAndNameShallow, Simantics/Model/searchByQuery, Simantics/Model/searchByQueryShallow]\r
59     Simantics/Model/searchByTypeAndFilter