1 package org.simantics.graph.query;
\r
3 import java.io.IOException;
\r
4 import java.util.Collection;
\r
6 import org.simantics.databoard.binding.Binding;
\r
7 import org.simantics.databoard.binding.error.BindingException;
\r
8 import org.simantics.databoard.binding.mutable.Variant;
\r
9 import org.simantics.databoard.serialization.RuntimeSerializerConstructionException;
\r
10 import org.simantics.databoard.serialization.SerializationException;
\r
11 import org.simantics.databoard.type.Datatype;
\r
14 * Graph browsing interface for transferable graphs.
\r
15 * @author Hannu Niemist�
\r
17 public interface IGraph {
\r
20 * Get value of the resource as variant. Returns null, if there is no value.
\r
22 Variant getValue(Res resource);
\r
25 * Sets value of the resource.
\r
27 void setValue(Res resource, Object value, Binding binding);
\r
30 * Gets the value of the resource using the given binding.
\r
32 Object getValue(Res resource, Binding binding) throws RuntimeSerializerConstructionException, SerializationException, IOException, BindingException, NoValueException;
\r
35 * Gets the data type of the resource or null if it doesn't have a data type.
\r
37 Datatype getDatatype(Res resource);
\r
40 * Gets raw objects without assertions
\r
42 Collection<Res> rawGetObjects(Res subject, Res predicate);
\r
45 * Gets single raw object or throws NoUniqueObjectException if that is not possible
\r
47 Res singleRawObject(Res subject, Res predicate) throws NoUniqueObjectException;
\r
50 * Gets raw and asserted objects.
\r
52 Collection<Res> getObjects(Res subject, Res predicate);
\r
55 * Gets all types of the given resource
\r
57 Collection<Res> getTypes(Res resource);
\r
60 * Gets all instances of the given type
\r
62 Collection<Res> getInstances(Res type);
\r
64 Datatype getAssertedDatatype(Res type);
\r
66 Collection<Res> getChildren(Res res);
\r