com.hp.hpl.mesa.rdf.jena.common
Interface Store

All Known Implementing Classes:
StoreCom, StoreRDB

public interface Store

Interface to a triple store.

Version:
Release='$Name: $' Revision='$Revision: 1.3 $' Date='$Date: 2001/08/25 12:27:01 $'
Author:
bwm

Method Summary
 void add(Statement s)
          Add a statement to the store
 void close()
          Close the store and free up resources held.
 boolean contains(Resource s, Property p)
          test whether the store contains a statement with a given subject and predicate
 boolean contains(Statement s)
          test whether the store contains a statement
 Alt createAlt(Model m)
           
 Alt createAlt(java.lang.String uri, Model m)
           
 Bag createBag(Model m)
           
 Bag createBag(java.lang.String uri, Model m)
           
 Property createProperty(java.lang.String uri, Model m)
           
 Property createProperty(java.lang.String namespace, java.lang.String localPart, Model m)
           
 Resource createResource(Model m)
           
 Resource createResource(java.lang.String uri, Model m)
           
 Seq createSeq(Model m)
           
 Seq createSeq(java.lang.String uri, Model m)
           
 Statement createStatement(Resource s, Property p, RDFNode o, Model m)
           
 Alt getAlt(Resource r, Model m)
           
 Alt getAlt(java.lang.String uri, Model m)
           
 Bag getBag(Resource r, Model m)
           
 Bag getBag(java.lang.String uri, Model m)
           
 Property getProperty(Property p)
           
 Property getProperty(java.lang.String uri, Model m)
           
 Property getProperty(java.lang.String namespace, java.lang.String localPart, Model m)
           
 Resource getResource(java.lang.String uri, Model m)
           
 Seq getSeq(Resource r, Model m)
           
 Seq getSeq(java.lang.String uri, Model m)
           
 Statement getStatement(Resource s, Property p, RDFNode o, Model m)
           
 java.util.Iterator list()
          return an iterator on all the statements in the store
 java.util.Iterator list(Resource subject, Property predicate, RDFNode object)
          return an iterator over all the statements which match the given subject predicate and object.
 java.util.Iterator listByObject(RDFNode object)
          list all the statements in the store with a given object
 java.util.Iterator listByPredicate(Property property)
          list all the statements in the store with a given predicate
 java.util.Iterator listBySubject(Resource subject)
          return an iterator over all the statements with a given subject
 NsIterator listNameSpaces()
          list namespaces of the predicates of all the statements in ths store.
 ResIterator listSubjects()
          list all the subjects of statements in the store
 void remove(Statement s)
          remove a statement from the store
 int size()
          the number of statements in the store
 

Method Detail

createResource

public Resource createResource(Model m)
                        throws RDFException
RDFException

createResource

public Resource createResource(java.lang.String uri,
                               Model m)
                        throws RDFException
RDFException

createProperty

public Property createProperty(java.lang.String uri,
                               Model m)
                        throws RDFException
RDFException

createProperty

public Property createProperty(java.lang.String namespace,
                               java.lang.String localPart,
                               Model m)
                        throws RDFException
RDFException

createStatement

public Statement createStatement(Resource s,
                                 Property p,
                                 RDFNode o,
                                 Model m)
                          throws RDFException
RDFException

createBag

public Bag createBag(Model m)
              throws RDFException
RDFException

createBag

public Bag createBag(java.lang.String uri,
                     Model m)
              throws RDFException
RDFException

createAlt

public Alt createAlt(Model m)
              throws RDFException
RDFException

createAlt

public Alt createAlt(java.lang.String uri,
                     Model m)
              throws RDFException
RDFException

createSeq

public Seq createSeq(Model m)
              throws RDFException
RDFException

createSeq

public Seq createSeq(java.lang.String uri,
                     Model m)
              throws RDFException
RDFException

getResource

public Resource getResource(java.lang.String uri,
                            Model m)
                     throws RDFException
RDFException

getProperty

public Property getProperty(java.lang.String uri,
                            Model m)
                     throws RDFException
RDFException

getProperty

public Property getProperty(java.lang.String namespace,
                            java.lang.String localPart,
                            Model m)
                     throws RDFException
RDFException

getProperty

public Property getProperty(Property p)
                     throws RDFException
RDFException

getStatement

public Statement getStatement(Resource s,
                              Property p,
                              RDFNode o,
                              Model m)
                       throws RDFException
RDFException

getBag

public Bag getBag(java.lang.String uri,
                  Model m)
           throws RDFException
RDFException

getBag

public Bag getBag(Resource r,
                  Model m)
           throws RDFException
RDFException

getAlt

public Alt getAlt(java.lang.String uri,
                  Model m)
           throws RDFException
RDFException

getAlt

public Alt getAlt(Resource r,
                  Model m)
           throws RDFException
RDFException

getSeq

public Seq getSeq(java.lang.String uri,
                  Model m)
           throws RDFException
RDFException

getSeq

public Seq getSeq(Resource r,
                  Model m)
           throws RDFException
RDFException

add

public void add(Statement s)
         throws RDFException
Add a statement to the store

Parameters:
s - the statement to add
RDFException

remove

public void remove(Statement s)
            throws RDFException
remove a statement from the store

Parameters:
s - the statement to remove
RDFException

size

public int size()
         throws RDFException
the number of statements in the store

Returns:
the number of statements in the store
RDFException

contains

public boolean contains(Statement s)
                 throws RDFException
test whether the store contains a statement

Parameters:
s - the statement to test for
Returns:
true if the statement is in the store, false otherwise
RDFException

contains

public boolean contains(Resource s,
                        Property p)
                 throws RDFException
test whether the store contains a statement with a given subject and predicate

Parameters:
s - the subject of the statement to test for
p - the predicate of the statement to test for
Returns:
true if the statement is in the store, false otherwise
RDFException

list

public java.util.Iterator list()
                        throws RDFException
return an iterator on all the statements in the store

Returns:
in iterator over all the statements in the store
RDFException

list

public java.util.Iterator list(Resource subject,
                               Property predicate,
                               RDFNode object)
                        throws RDFException
return an iterator over all the statements which match the given subject predicate and object.

The store is searched for all statements which match the given subject predicate and object. A null arguement matches anything.

Parameters:
subject - the subject of the statements to be returned or null
predicate - the predicate of the statments to be returned or null
object - the object of the statements to be returned or null
Returns:
an iterator over all statements in the store which match the given subject predicate and object
RDFException

listBySubject

public java.util.Iterator listBySubject(Resource subject)
                                 throws RDFException
return an iterator over all the statements with a given subject

Parameters:
subject - the subject of the statements to be returned
Returns:
an iterator over all statements in the store with the given subject
RDFException

listByPredicate

public java.util.Iterator listByPredicate(Property property)
                                   throws RDFException
list all the statements in the store with a given predicate

Parameters:
property - the predicate to search for
Returns:
an iterator over all statements in the store with the given predicate
RDFException

listByObject

public java.util.Iterator listByObject(RDFNode object)
                                throws RDFException
list all the statements in the store with a given object

Parameters:
object - the object to search for
Returns:
an iterator over all statements in the store with the given object
RDFException

listSubjects

public ResIterator listSubjects()
                         throws RDFException
list all the subjects of statements in the store

Each subject is listed only once.

Returns:
an iterator over a set of the subjects of all statements in the store
RDFException

listNameSpaces

public NsIterator listNameSpaces()
                          throws RDFException
list namespaces of the predicates of all the statements in ths store.

Each namespace is listed only once.

Returns:
an iterator over a set of the subjects of all statements in the store
RDFException

close

public void close()
Close the store and free up resources held.

Not all implementations of Store require this method to be called. But some do, so in general its best to call it when done with the object, rather than leave it to the finalizer.



Copyright © 2001 Hewlett-Packard. All Rights Reserved.