001: /*
002: (c) Copyright 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP, all rights reserved.
003: [See end of file]
004: $Id: TripleStore.java,v 1.8 2008/01/02 12:05:19 andy_seaborne Exp $
005: */
006:
007: package com.hp.hpl.jena.graph.impl;
008:
009: import com.hp.hpl.jena.graph.*;
010: import com.hp.hpl.jena.util.iterator.ExtendedIterator;
011:
012: /**
013: TripleStore - interface for bulk storage of triples used in composed graphs.
014: @author kers
015: */
016: public interface TripleStore {
017: /**
018: Destroy this triple store - discard the indexes.
019: */
020: public abstract void close();
021:
022: /**
023: Add a triple to this triple store.
024: */
025: public abstract void add(Triple t);
026:
027: /**
028: Remove a triple from this triple store.
029: */
030: public abstract void delete(Triple t);
031:
032: /**
033: Answer the size (number of triples) of this triple store.
034: */
035: public abstract int size();
036:
037: /**
038: Answer true iff this triple store is empty.
039: */
040: public abstract boolean isEmpty();
041:
042: /**
043: Answer true iff this triple store contains the (concrete) triple <code>t</code>.
044: */
045: public abstract boolean contains(Triple t);
046:
047: /**
048: Answer an setwise iterator over all the subjects of triples in this store.
049: */
050: public ExtendedIterator listSubjects();
051:
052: /**
053: Answer an iterator over all the predicates of triples in this store.
054: */
055: public ExtendedIterator listPredicates();
056:
057: /**
058: Answer an setwise iterator over all the objects of triples in this store.
059: */
060: public ExtendedIterator listObjects();
061:
062: /**
063: Answer an ExtendedIterator returning all the triples from this store that
064: match the pattern <code>m = (S, P, O)</code>.
065: */
066: public abstract ExtendedIterator find(TripleMatch tm);
067:
068: /**
069: Clear this store, ie remove all triples from it.
070: */
071: public abstract void clear();
072: }
073:
074: /*
075: (c) Copyright 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
076: All rights reserved.
077:
078: Redistribution and use in source and binary forms, with or without
079: modification, are permitted provided that the following conditions
080: are met:
081:
082: 1. Redistributions of source code must retain the above copyright
083: notice, this list of conditions and the following disclaimer.
084:
085: 2. Redistributions in binary form must reproduce the above copyright
086: notice, this list of conditions and the following disclaimer in the
087: documentation and/or other materials provided with the distribution.
088:
089: 3. The name of the author may not be used to endorse or promote products
090: derived from this software without specific prior written permission.
091:
092: THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
093: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
094: OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
095: IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
096: INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
097: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
098: DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
099: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
100: (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
101: THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
102: */
|