org.ontoware.rdf2go.model
Interface FindableModel

All Known Subinterfaces:
Model, ModelRemovePatterns, QueryableModel

public interface FindableModel

A model where you can list all statements, find statements and check if a statement is contained.

Author:
voelkel

Method Summary
 boolean contains(ResourceOrVariable subject, UriOrVariable predicate, NodeOrVariable object)
           
 boolean contains(ResourceOrVariable subject, UriOrVariable predicate, java.lang.String plainLiteral)
          Convenience function.
 boolean contains(Statement s)
           
 long countStatements(TriplePattern pattern)
           
 TriplePattern createTriplePattern(ResourceOrVariable subject, UriOrVariable predicate, NodeOrVariable object)
           
 ClosableIterator<Statement> findStatements(ResourceOrVariable subject, UriOrVariable predicate, NodeOrVariable object)
          get all statements in the model with this subject, predicate and object.
 ClosableIterator<Statement> findStatements(TriplePattern pattern)
          Iterator must be auto-close, i.e. when last element is fetched, the implementation must call close().
 

Method Detail

findStatements

ClosableIterator<Statement> findStatements(ResourceOrVariable subject,
                                           UriOrVariable predicate,
                                           NodeOrVariable object)
                                           throws ModelRuntimeException
get all statements in the model with this subject, predicate and object. Each of those (s,p,o) can be Variable.ANY Iterator must be auto-close, i.e. when last element is fetched, the implementation must call close().

Parameters:
subject - URI or Object (= blankNode) or Variable
predicate - URI or Variable
object - URI or String (=plainLiteral) or BlankNode (=blankNode) or TypedLiteral or LanguageTagLiteral or Variable
Returns:
a statement iterator
Throws:
ModelRuntimeException

findStatements

ClosableIterator<Statement> findStatements(TriplePattern pattern)
                                           throws ModelRuntimeException
Iterator must be auto-close, i.e. when last element is fetched, the implementation must call close().

Parameters:
pattern -
Returns:
statement iterator returning all triples matching the given pattern
Throws:
ModelRuntimeException

countStatements

long countStatements(TriplePattern pattern)
                     throws ModelRuntimeException
Returns:
the number of statements in the model matching the query
Throws:
ModelRuntimeException

contains

boolean contains(ResourceOrVariable subject,
                 UriOrVariable predicate,
                 NodeOrVariable object)
                 throws ModelRuntimeException
Parameters:
subject -
predicate -
object -
Returns:
true if the statement (subject, predicate, object) is in the model
Throws:
ModelRuntimeException

contains

boolean contains(ResourceOrVariable subject,
                 UriOrVariable predicate,
                 java.lang.String plainLiteral)
                 throws ModelRuntimeException
Convenience function.

Parameters:
subject -
predicate -
plainLiteral -
Returns:
true if model contains statement (s,p,'o')
Throws:
ModelRuntimeException

contains

boolean contains(Statement s)
                 throws ModelRuntimeException
Parameters:
s - a Statement
Returns:
true if the model contains a statement s
Throws:
ModelRuntimeException

createTriplePattern

TriplePattern createTriplePattern(ResourceOrVariable subject,
                                  UriOrVariable predicate,
                                  NodeOrVariable object)
Parameters:
subject -
predicate -
object -
Returns:
a triple pattern


Copyright © 2005-2008 FZI - Forschungszentrum Informatik | Karlsruhe | Germany. All Rights Reserved.