+ public static void setRVIProperty(WriteGraph graph, Variable variable, RVI rvi) throws DatabaseException {
+ Layer0 L0 = Layer0.getInstance(graph);
+ Binding rviBinding = graph.getService(Databoard.class).getBindingUnchecked( RVI.class );
+ Resource predicate = variable.getPredicateResource(graph);
+ Resource subject = variable.getParent(graph).getRepresents(graph);
+ graph.deny(subject, predicate);
+ graph.claimLiteral(subject, predicate, L0.RVI, rvi, rviBinding);
+ }
+
+ public static Binding rviBinding(ReadGraph graph) throws DatabaseException {
+ Databoard databoard = graph.getService(Databoard.class);
+ if (databoard == null) throw new DatabaseException("No databoard support in Session"); //$NON-NLS-1$
+ return databoard.getBindingUnchecked(RVI.class);
+ }
+
+ public static boolean isEmpty(RVI rvi) throws DatabaseException {
+ return rvi.parts.length == 0;
+ }
+