1 /*******************************************************************************
2 * Copyright (c) 2007, 2010 Association for Decentralized Information Management
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.layer0.utils.writer;
14 import org.simantics.db.Resource;
15 import org.simantics.db.ReadGraph;
16 import org.simantics.db.exception.DatabaseException;
18 public interface GraphWriter {
20 ReadGraph getGraph(); // Returns read-only graph
22 GraphWriter flush() throws DatabaseException;
25 GraphWriter create() throws DatabaseException;
26 GraphWriter create(Resource type) throws DatabaseException;
27 GraphWriter create(int clusterHint) throws DatabaseException;
28 GraphWriter create(int clusterHint, Resource type) throws DatabaseException;
29 GraphWriter create(String name, Resource type) throws DatabaseException;
30 GraphWriter create(int clusterHint, String name, Resource type) throws DatabaseException;
31 GraphWriter createLiteral(Object value, Resource dataType) throws DatabaseException;
32 GraphWriter createLiteral(int clusterHint, Object value, Resource dataType) throws DatabaseException;
33 GraphWriter createInverse(Resource r) throws DatabaseException;
34 GraphWriter createInverse(int clusterHint, Resource r) throws DatabaseException;
35 GraphWriter handle(Resource s);
38 GraphWriter let(Resource p, Resource o) throws DatabaseException;
39 //GraphWriter letWithoutInverse(Resource p, Resource o);
40 GraphWriter let(int clusterHint, Resource p, Object value, Resource dataType) throws DatabaseException;
41 GraphWriter let(Resource p, Object value, Resource dataType) throws DatabaseException;
42 //GraphWriter letWithoutInverse(Resource p, Object value, Resource dataType);
43 GraphWriter stat(Resource s, Resource p, Resource o) throws DatabaseException;