View Javadoc

1   /*
2    * Copyright James Leigh (c) 2007.
3    *
4    * Licensed under the Aduna BSD-style license.
5    */
6   package org.openrdf.repository.augur;
7   
8   import org.openrdf.repository.Repository;
9   import org.openrdf.repository.RepositoryConnection;
10  import org.openrdf.repository.RepositoryException;
11  import org.openrdf.repository.base.RepositoryWrapper;
12  
13  /**
14   * Wraps a Repository reducing traffic to the underlying repository for some
15   * requests. AugurRepository tags Resources leaving the Repository with the
16   * query that was used to retrieve it. When one of these resources is used as a
17   * binding to a new query it expands the new query to pro-actively retrieve the
18   * results for other resources with the same tag. This technique can change
19   * repository hits from O(n^m) into O(m) without changing how the data is
20   * accessed from the repository.
21   * 
22   * @author James Leigh
23   */
24  public class AugurRepository extends RepositoryWrapper {
25  
26  	public AugurRepository() {
27  		super();
28  	}
29  
30  	public AugurRepository(Repository repository) {
31  		super(repository);
32  	}
33  
34  	@Override
35  	public RepositoryConnection getConnection() throws RepositoryException {
36  		return new AugurConnection(this, super.getConnection());
37  	}
38  }