--- /dev/null
+package org.simantics.db.tests.api.write.claim;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.junit.Test;
+import org.simantics.db.Resource;
+import org.simantics.db.WriteGraph;
+import org.simantics.db.common.request.WriteResultRequest;
+import org.simantics.db.exception.DatabaseException;
+import org.simantics.db.testing.annotation.Fails;
+import org.simantics.db.testing.base.ExistingDatabaseTest;
+import org.simantics.db.testing.common.WriteQuery;
+import org.simantics.layer0.Layer0;
+
+public class WriteWithMultipleInverses extends ExistingDatabaseTest {
+
+ @Test
+ @Fails
+ public void test() throws Exception{
+
+ final Collection<Resource> predicates = getSession().syncRequest(new WriteResultRequest<Collection<Resource>>() {
+ @Override
+ public Collection<Resource> perform(WriteGraph g) throws DatabaseException {
+ Layer0 L0 = Layer0.getInstance(g);
+ Collection<Resource> result = new ArrayList<Resource>();
+ for(int i=0;i<1;i++) {
+ Resource predicate = g.newResource();
+ g.claim(predicate, L0.SubrelationOf, null, L0.IsRelatedTo);
+ g.claim(predicate, L0.InverseOf, null, L0.IsRelatedTo);
+ g.claim(predicate, L0.InverseOf, null, L0.IsWeaklyRelatedTo);
+ g.claim(predicate, L0.InverseOf, null, L0.IsComposedOf);
+ g.claim(predicate, L0.InverseOf, null, L0.IsDependencyOf);
+ result.add(predicate);
+ }
+ return result;
+ }
+ });
+
+ checkException();
+
+ try {
+ getSession().syncRequest(new WriteQuery(this) {
+
+ @Override
+ public void run(WriteGraph g) throws Throwable {
+
+ for(Resource predicate : predicates)
+ g.claim(predicate, predicate, predicate);
+
+ }
+
+ });
+
+ } catch (DatabaseException e) {
+ return;
+ }
+
+ fail("Write should throw.");
+
+ }
+
+}