View Javadoc

1   /*
2    ORDI - Ontology Repository and Data Integration
3   
4    Copyright (c) 2004-2007, OntoText Lab. / SIRMA
5   
6    This library is free software; you can redistribute it and/or modify it under
7    the terms of the GNU Lesser General Public License as published by the Free
8    Software Foundation; either version 2.1 of the License, or (at your option)
9    any later version.
10   This library is distributed in the hope that it will be useful, but WITHOUT
11   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12   FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13   details.
14   You should have received a copy of the GNU Lesser General Public License along
15   with this library; if not, write to the Free Software Foundation, Inc.,
16   59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17   */
18  package com.ontotext.ordi.trree;
19  
20  import java.util.Set;
21  
22  import org.openrdf.model.Resource;
23  import org.openrdf.model.URI;
24  import org.openrdf.model.Value;
25  
26  import com.ontotext.ordi.tripleset.TFactory;
27  import com.ontotext.ordi.tripleset.TStatement;
28  import com.ontotext.ordi.tripleset.impl.TFactoryImpl;
29  import com.ontotext.ordi.tripleset.impl.TStatementImpl;
30  import com.ontotext.trree.owlim_ext.AbstractRepository;
31  import com.ontotext.trree.owlim_ext.EntityPool;
32  
33  public class TRREEValueFactory extends TFactoryImpl implements TFactory {
34  
35      protected final AbstractRepository repository;
36  
37      protected final EntityPool pool;
38  
39      public TRREEValueFactory(AbstractRepository repository, EntityPool pool) {
40          if (repository == null || pool == null) {
41              throw new IllegalArgumentException();
42          }
43          this.repository = repository;
44          this.pool = pool;
45      }
46  
47      public TStatement createStatement(Resource subject, URI predicate,
48              Value object, Resource context, URI... ts) {
49          return new TStatementImpl(subject, predicate, object, context, ts);
50      }
51  
52      public TStatement createStatement(Resource subject, URI predicate,
53              Value object, Resource context, Set<URI> ts) {
54          return new TStatementImpl(subject, predicate, object, context, ts);
55      }
56  }