]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.graph/src/org/simantics/graph/query/IGraph.java
Option for exporting tg and pgraph with sharedlibrary
[simantics/platform.git] / bundles / org.simantics.graph / src / org / simantics / graph / query / IGraph.java
1 package org.simantics.graph.query;
2
3 import java.io.IOException;
4 import java.util.Collection;
5
6 import org.simantics.databoard.binding.Binding;
7 import org.simantics.databoard.binding.error.BindingException;
8 import org.simantics.databoard.binding.mutable.Variant;
9 import org.simantics.databoard.serialization.RuntimeSerializerConstructionException;
10 import org.simantics.databoard.serialization.SerializationException;
11 import org.simantics.databoard.type.Datatype;
12
13 /**
14  * Graph browsing interface for transferable graphs.
15  * @author Hannu Niemist�
16  */
17 public interface IGraph {
18
19         /**
20          * Get value of the resource as variant. Returns null, if there is no value.
21          */
22         Variant getValue(Res resource);
23
24         /**
25          * Sets value of the resource.
26         */
27         void setValue(Res resource, Object value, Binding binding);
28
29         /**
30          * Gets the value of the resource using the given binding.
31          */
32         Object getValue(Res resource, Binding binding) throws RuntimeSerializerConstructionException, SerializationException, IOException, BindingException, NoValueException;
33         
34         /**
35          * Gets the data type of the resource or null if it doesn't have a data type.
36          */
37         Datatype getDatatype(Res resource);
38         
39         /**
40          * Gets raw objects without assertions
41          */
42         Collection<Res> rawGetObjects(Res subject, Res predicate);
43         
44         /**
45          * Gets single raw object or throws NoUniqueObjectException if that is not possible
46          */
47         Res singleRawObject(Res subject, Res predicate) throws NoUniqueObjectException;
48
49         /**
50          * Gets raw and asserted objects.
51          */
52         Collection<Res> getObjects(Res subject, Res predicate);
53         
54         /**
55          * Gets all types of the given resource
56          */
57         Collection<Res> getTypes(Res resource); 
58         
59         /**
60          * Gets all instances of the given type
61          */
62         Collection<Res> getInstances(Res type);
63
64         Datatype getAssertedDatatype(Res type);
65         
66         Collection<Res> getChildren(Res res);
67         
68         Paths getPaths();    
69
70 }