com.hp.hpl.mesa.rdf.jena.common
Class ModelCom

java.lang.Object
  |
  +--com.hp.hpl.mesa.rdf.jena.common.ModelCom
All Implemented Interfaces:
Model, ModelCon, ModelI, RDFReaderF, RDFWriterF
Direct Known Subclasses:
ModelBdb, ModelMem, ModelRDB

public abstract class ModelCom
extends java.lang.Object
implements Model, ModelI

Common methods for model implementations.

This class implements common methods, mainly convenience methods, for model implementations. It is intended use is as a base class from which model implemenations can be derived.

Version:
Release='$Name: $' Revision='$Revision: 1.10 $' Date='$Date: 2001/12/06 11:50:21 $'
Author:
bwm

Constructor Summary
ModelCom()
           
 
Method Summary
 Model abort()
          Abort the current transaction and abandon any changes in progress.
 Model add(Model m)
          Add all the statements in another model to this model.
 Model add(Resource s, Property p, boolean o)
          add a statement to this model
 Model add(Resource s, Property p, char o)
          add a statement to this model
 Model add(Resource s, Property p, double o)
          add a statement to this model
 Model add(Resource s, Property p, float o)
          add a statement to this model
 Model add(Resource s, Property p, long o)
          add a statement to this model
 Model add(Resource s, Property p, java.lang.Object o)
          add a statement to this model
 Model add(Resource s, Property p, RDFNode o)
          add a statement to this model
 Model add(Resource s, Property p, java.lang.String o)
          add a statement to this model
 Model add(Resource s, Property p, java.lang.String o, boolean wellFormed)
          add a statement to this model
 Model add(Resource s, Property p, java.lang.String o, java.lang.String l)
          add a statement to this model
 Model add(Resource s, Property p, java.lang.String o, java.lang.String lang, boolean wellFormed)
          add a statement to this model
 Model add(Statement s)
          Add a statement to this model.
 Model add(StmtIterator iter)
          Add all the statements returned by an iterator to this model.
 Model begin()
          Begin a new transation.
 void close()
          Close the Model and free up resources held.
 Model commit()
          Commit the current transaction.
 boolean containerContains(Container cont, RDFNode n)
           
 int containerIndexOf(Container cont, RDFNode n)
           
 int containerSize(Container cont)
           
 boolean contains(Resource s, Property p)
          Determine whether this model contains any statements with a given subject and property.
 boolean contains(Resource s, Property p, boolean o)
          Determine if a statement is present in this model.
 boolean contains(Resource s, Property p, char o)
          Determine if a statement is present in this model.
 boolean contains(Resource s, Property p, double o)
          Determine if a statement is present in this model.
 boolean contains(Resource s, Property p, float o)
          Determine if a statement is present in this model.
 boolean contains(Resource s, Property p, long o)
          Determine if a statement is present in this model.
 boolean contains(Resource s, Property p, java.lang.Object o)
          Determine if a statement is present in this model.
 boolean contains(Resource s, Property p, RDFNode o)
          Determine if a statement is present in this model.
 boolean contains(Resource s, Property p, java.lang.String o)
          Determine if a statement is present in this model.
 boolean contains(Resource s, Property p, java.lang.String o, java.lang.String l)
          Determine if a statement is present in this model.
 boolean contains(Statement s)
          Determine if a statement is present in this model.
 boolean containsAll(Model model)
          Determine if all of the statements in a model are also contained in this model.
 boolean containsAll(StmtIterator iter)
          Determine if all of the statements returned by an iterator are contained in this model.
 boolean containsAny(Model model)
          Determine if any of the statements in a model are also contained in this model.
 boolean containsAny(StmtIterator iter)
          Determine if any of the statements returned by an iterator are contained in this model.
 Property convert(Property p)
           
 RDFNode convert(RDFNode n)
           
 Resource convert(Resource r)
           
 Alt createAlt()
          Create a new anonymous alt.
 Alt createAlt(java.lang.String uri)
          Create a new alt.
 Bag createBag()
          Create a new anonymous bag.
 Bag createBag(java.lang.String uri)
          Create a new bag.
 Literal createLiteral(boolean v)
          create a literal from a boolean value.
 Literal createLiteral(char v)
          create a literal from a char value.
 Literal createLiteral(double v)
          create a literal from a double value.
 Literal createLiteral(float v)
          create a literal from a float value.
 Literal createLiteral(long v)
          create a literal from an integer value.
 Literal createLiteral(java.lang.Object v)
          create a literal from an Object.
 Literal createLiteral(java.lang.String v)
          create a literal from a String value.
 Literal createLiteral(java.lang.String v, java.lang.String l)
          create a literal from a String value with a specified language
 Literal createLiteral(java.lang.String v, java.lang.String l, boolean wellFormed)
          create a literal from a String value with a specified language
 Property createProperty(java.lang.String uri)
          Create a property
 Property createProperty(java.lang.String nameSpace, java.lang.String localName)
          Create a property
 Resource createResource()
          Create a new anonymous resource.
 Resource createResource(Resource type)
          Create a new anonymous resource with a given type.
 Resource createResource(ResourceF f)
          Create a new anonymous resource using the supplied factory
 Resource createResource(java.lang.String uri)
          Create a new resource.
 Resource createResource(java.lang.String uri, Resource type)
          Create a new resource with a given type.
 Resource createResource(java.lang.String uri, ResourceF f)
          Create a new resource using the supplied factory
 Seq createSeq()
          Create a new anonymous seq.
 Seq createSeq(java.lang.String uri)
          Create a new seq.
 Statement createStatement(Resource r, Property p, boolean o)
          Create a Statement instance.
 Statement createStatement(Resource r, Property p, char o)
          Create a Statement instance.
 Statement createStatement(Resource r, Property p, double o)
          Create a Statement instance.
 Statement createStatement(Resource r, Property p, float o)
          Create a Statement instance.
 Statement createStatement(Resource r, Property p, long o)
          Create a Statement instance.
 Statement createStatement(Resource r, Property p, java.lang.Object o)
          Create a Statement instance.
 Statement createStatement(Resource r, Property p, RDFNode o)
          Create a Statement instance.
 Statement createStatement(Resource r, Property p, java.lang.String o)
          Create a Statement instance.
 Statement createStatement(Resource r, Property p, java.lang.String o, boolean wellFormed)
          Create a Statement instance.
 Statement createStatement(Resource r, Property p, java.lang.String o, java.lang.String l)
          Create a Statement instance.
 Statement createStatement(Resource r, Property p, java.lang.String o, java.lang.String l, boolean wellFormed)
          Create a Statement instance.
 boolean equals(java.lang.Object model)
          Test whether one model is the equal to another.
 Alt getAlt(Resource r)
          Return an Alt instance based on a given resource.
 Alt getAlt(java.lang.String uri)
          Return an Alt instance in this model.
 Bag getBag(Resource r)
          Return a bag instance based on a given resource.
 Bag getBag(java.lang.String uri)
          Return a Bag instance in this model.
 Statement getProperty(Resource s, Property p)
          Return a statement with given subject and property.
 Property getProperty(java.lang.String uri)
          Return a Property instance in this model.
 Property getProperty(java.lang.String nameSpace, java.lang.String localName)
          Return a Property instance in this model.
 RDFReader getReader()
          return an RDFReader instance for the default serialization language.
 RDFReader getReader(java.lang.String lang)
          return an RDFReader instance for the specified serialization language.
 Resource getResource(java.lang.String uri)
          Return a Resource instance in this model.
 Resource getResource(java.lang.String uri, ResourceF f)
          Return a Resource instance in this model.
 Seq getSeq(Resource r)
          Return a Seq instance based on a given resource.
 Seq getSeq(java.lang.String uri)
          Return a Seq instance in this model.
 RDFWriter getWriter()
          return an RDFWriter instance for the default serialization language.
 RDFWriter getWriter(java.lang.String lang)
          an RDFWriter instance for the specified serialization language.
 boolean independent()
          Determine whether this model is independent.
 boolean isReified(Statement s)
          Determine if this statement is the subject of any statements in this model
 NodeIterator listContainerMembers(Container cont, NodeIteratorFactory f)
           
 NsIterator listNameSpaces()
          List all namespaces of predicates in the model.
 NodeIterator listObjects()
          List all objects in a model.
 NodeIterator listObjectsOfProperty(Property p)
          List all objects of a given property.
 NodeIterator listObjectsOfProperty(Resource s, Property p)
          List the values of a property of a resource.
 StmtIterator listReifiedStatements()
          List all reified statements in the model.
 StmtIterator listStatements()
          List all statements.
 StmtIterator listStatements(Selector selector)
          List the statements matching a selector.
 ResIterator listSubjects()
          List all resources which are subjects of statements.
 ResIterator listSubjectsWithProperty(Property p)
          List all subjects with a given property.
 ResIterator listSubjectsWithProperty(Property p, boolean o)
          List all subjects with a given property and property value
 ResIterator listSubjectsWithProperty(Property p, char o)
          List all subjects with a given property and property value
 ResIterator listSubjectsWithProperty(Property p, double o)
          lists all subjects with a given property and property value
 ResIterator listSubjectsWithProperty(Property p, float o)
          List all subjects with a given property and property value
 ResIterator listSubjectsWithProperty(Property p, long o)
          List all the subjects with a given property and property value
 ResIterator listSubjectsWithProperty(Property p, java.lang.Object o)
          List all subjects with a given property and property value
 ResIterator listSubjectsWithProperty(Property p, RDFNode o)
          List all subjects with a given property and property value
 ResIterator listSubjectsWithProperty(Property p, java.lang.String o)
          lists all subjects with a given property and property value
 ResIterator listSubjectsWithProperty(Property p, java.lang.String o, java.lang.String l)
          lists all subjects with a given property and property value
 Model read(java.io.Reader reader, java.lang.String base)
          add statements from an RDF/XML serialization
 Model read(java.io.Reader reader, java.lang.String base, java.lang.String lang)
          add RDF statements represented in language lang to the model.
 Model read(java.lang.String url)
          Add the RDF statements from an XML document.
 Model read(java.lang.String url, java.lang.String lang)
          add statements from a serializion in language lang to the model.
 Model remove(Model m)
          Remove all the Statements in a given model.
 Model remove(Statement s)
          Removes a statement.
 Model remove(StmtIterator iter)
          Remove all the Statements returned by an iterator.
 java.lang.String setReaderClassName(java.lang.String lang, java.lang.String className)
          set the class name for the RDFReader for a langauge
 java.lang.String setWriterClassName(java.lang.String lang, java.lang.String className)
          set the class name for the RDFWriter for a langauge
 long size()
          computes the number of statements in the model.
 Model write(java.io.Writer writer)
          Write the model as an XML document.
 Model write(java.io.Writer writer, java.lang.String lang)
          write a serialized represention of a model in a specified language.
 Model write(java.io.Writer writer, java.lang.String lang, java.lang.String base)
          write a serialized represention of a model in a specified language.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.hp.hpl.mesa.rdf.jena.model.Model
difference, intersection, query, supportsSetOperations, supportsTransactions, union
 

Constructor Detail

ModelCom

public ModelCom()
Method Detail

getResource

public Resource getResource(java.lang.String uri,
                            ResourceF f)
                     throws RDFException
Description copied from interface: ModelCon
Return a Resource instance in this model.

Subsequent operations on the returned object may modify this model.

The resource is assumed to already exist in the model. If it does not, createResource should be used instead.

Specified by:
getResource in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
uri - the URI of the resource
f - the factory object
Returns:
a resource instance created by the factory provided
Throws:
RDFException - Generic RDF Exception

add

public Model add(Resource s,
                 Property p,
                 RDFNode o)
          throws RDFException
Description copied from interface: ModelCon
add a statement to this model
Specified by:
add in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
s - the subject of the statement to add
p - the predicate of the statement to add
o - the object of the statement to add
Returns:
this model
Throws:
RDFException - Generic RDF Exception

add

public Model add(Resource s,
                 Property p,
                 boolean o)
          throws RDFException
Description copied from interface: ModelCon
add a statement to this model
Specified by:
add in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
s - the subject of the statement to add
p - the predicate of the statement to add
o - the object of the statement to add
Returns:
this model
Throws:
RDFException - Generic RDF Exception

add

public Model add(Resource s,
                 Property p,
                 long o)
          throws RDFException
Description copied from interface: ModelCon
add a statement to this model
Specified by:
add in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
s - the subject of the statement to add
p - the predicate of the statement to add
o - the object of the statement to add
Returns:
this model
Throws:
RDFException - Generic RDF Exception

add

public Model add(Resource s,
                 Property p,
                 char o)
          throws RDFException
Description copied from interface: ModelCon
add a statement to this model
Specified by:
add in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
s - the subject of the statement to add
p - the predicate of the statement to add
o - the object of the statement to add
Returns:
this model
Throws:
RDFException - Generic RDF Exception

add

public Model add(Resource s,
                 Property p,
                 float o)
          throws RDFException
Description copied from interface: ModelCon
add a statement to this model
Specified by:
add in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
s - the subject of the statement to add
p - the predicate of the statement to add
o - the object of the statement to add
Returns:
this model
Throws:
RDFException - Generic RDF Exception

add

public Model add(Resource s,
                 Property p,
                 double o)
          throws RDFException
Description copied from interface: ModelCon
add a statement to this model
Specified by:
add in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
s - the subject of the statement to add
p - the predicate of the statement to add
o - the object of the statement to add
Returns:
this model
Throws:
RDFException - Generic RDF Exception

add

public Model add(Resource s,
                 Property p,
                 java.lang.String o)
          throws RDFException
Description copied from interface: ModelCon
add a statement to this model
Specified by:
add in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
s - the subject of the statement to add
p - the predicate of the statement to add
o - the object of the statement to add
Returns:
this model
Throws:
RDFException - Generic RDF Exception

add

public Model add(Resource s,
                 Property p,
                 java.lang.String o,
                 boolean wellFormed)
          throws RDFException
Description copied from interface: ModelCon
add a statement to this model
Specified by:
add in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
s - the subject of the statement to add
p - the predicate of the statement to add
o - the object of the statement to add
wellFormed - true if o is well formed XML
Returns:
this model
Throws:
RDFException - Generic RDF Exception

add

public Model add(Resource s,
                 Property p,
                 java.lang.String o,
                 java.lang.String lang,
                 boolean wellFormed)
          throws RDFException
Description copied from interface: ModelCon
add a statement to this model
Specified by:
add in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
s - the subject of the statement to add
p - the predicate of the statement to add
o - the object of the statement to add
l - the language associated with the object
wellFormed - true if o is well formed XML
Returns:
this model
Throws:
RDFException - Generic RDF Exception

add

public Model add(Resource s,
                 Property p,
                 java.lang.String o,
                 java.lang.String l)
          throws RDFException
Description copied from interface: ModelCon
add a statement to this model
Specified by:
add in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
s - the subject of the statement to add
p - the predicate of the statement to add
o - the object of the statement to add
l - the language associated with the object
Returns:
this model
Throws:
RDFException - Generic RDF Exception

add

public Model add(Resource s,
                 Property p,
                 java.lang.Object o)
          throws RDFException
Description copied from interface: ModelCon
add a statement to this model
Specified by:
add in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
s - the subject of the statement to add
p - the predicate of the statement to add
o - the object of the statement to add
Returns:
this model
Throws:
RDFException - Generic RDF Exception

add

public Model add(StmtIterator iter)
          throws RDFException
Description copied from interface: Model
Add all the statements returned by an iterator to this model.
Specified by:
add in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Parameters:
iter - An iterator which returns the statements to be added.
Returns:
this model
Throws:
RDFException - Generic RDF Exception

add

public Model add(Model m)
          throws RDFException
Description copied from interface: Model
Add all the statements in another model to this model.
Specified by:
add in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Parameters:
m - The model whose statements are to be added.
Returns:
this model
Throws:
RDFException - Generic RDF Exception

getReader

public RDFReader getReader()
                    throws RDFException
Description copied from interface: RDFReaderF
return an RDFReader instance for the default serialization language.
Specified by:
getReader in interface RDFReaderF
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.RDFReaderF
Returns:
an RDFReader instance for the default serialization language.
Throws:
RDFException - generic RDF exception

getReader

public RDFReader getReader(java.lang.String lang)
                    throws RDFException
Description copied from interface: RDFReaderF
return an RDFReader instance for the specified serialization language.
Specified by:
getReader in interface RDFReaderF
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.RDFReaderF
Parameters:
lang - the serialization langauge - null selects the default
Returns:
the RDFWriter instance
Throws:
RDFException - generic RDF exception

setReaderClassName

public java.lang.String setReaderClassName(java.lang.String lang,
                                           java.lang.String className)
Description copied from interface: RDFReaderF
set the class name for the RDFReader for a langauge
Specified by:
setReaderClassName in interface RDFReaderF
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.RDFReaderF
Parameters:
lang - the language for which this class should be used
className - the class name for readers for this language
Returns:
the old class name for this language

read

public Model read(java.lang.String url)
           throws RDFException
Description copied from interface: Model
Add the RDF statements from an XML document.

See Model for a description of how to traverse a firewall.

Specified by:
read in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Parameters:
url - of the document containing the RDF statements.
Returns:
this model
Throws:
RDFException - Generic RDF Exception

read

public Model read(java.io.Reader reader,
                  java.lang.String base)
           throws RDFException
Description copied from interface: Model
add statements from an RDF/XML serialization
Specified by:
read in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Parameters:
reader - the source of the RDF/XML
base - the base to use when converting relative to absolute uri's
Returns:
the current model
Throws:
RDFException - a generic RDF exception

read

public Model read(java.lang.String url,
                  java.lang.String lang)
           throws RDFException
Description copied from interface: Model
add statements from a serializion in language lang to the model.

predefined values for lang are "RDF/XML", "N-TRIPLE" and "N3". null represents the default language, "RDF/XML".

See Model for a description of how to traverse a firewall.

Specified by:
read in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Parameters:
url - a string representation of the url to read from
lang - the language of the serialization
Returns:
this model
Throws:
RDFException - generic RDF exception

read

public Model read(java.io.Reader reader,
                  java.lang.String base,
                  java.lang.String lang)
           throws RDFException
Description copied from interface: Model
add RDF statements represented in language lang to the model.

predefined values for lang are defined in RDFReader

Specified by:
read in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Parameters:
base - the base uri to be used when converting relative URI's to absolute URI's.
lang - the langauge of the serialization null selects the default
reader - the source of the input serialization
Returns:
this model
Throws:
RDFException - generic exception

getWriter

public RDFWriter getWriter()
                    throws RDFException
Description copied from interface: RDFWriterF
return an RDFWriter instance for the default serialization language.
Specified by:
getWriter in interface RDFWriterF
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.RDFWriterF
Returns:
an RDFWriter instance for the default serialization language.

getWriter

public RDFWriter getWriter(java.lang.String lang)
                    throws RDFException
Description copied from interface: RDFWriterF
an RDFWriter instance for the specified serialization language.
Specified by:
getWriter in interface RDFWriterF
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.RDFWriterF
Parameters:
lang - the serialization langauge - null selects the default
Returns:
the RDFWriter instance

setWriterClassName

public java.lang.String setWriterClassName(java.lang.String lang,
                                           java.lang.String className)
Description copied from interface: RDFWriterF
set the class name for the RDFWriter for a langauge
Specified by:
setWriterClassName in interface RDFWriterF
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.RDFWriterF
Parameters:
lang - the language for which this class should be used
className - the class name for writers for this language
Returns:
the old class name for this language

write

public Model write(java.io.Writer writer)
            throws RDFException
Description copied from interface: Model
Write the model as an XML document.

The language in which to write the model is specified by the lang argument. Predefined values are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE" and "N3". The default value is represented by null is "RDF/XML".

Specified by:
write in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Parameters:
writer - a writer to which the XML will be written
Returns:
this model
Throws:
RDFException - Generic RDF Exception

write

public Model write(java.io.Writer writer,
                   java.lang.String lang)
            throws RDFException
Description copied from interface: Model
write a serialized represention of a model in a specified language.

The language in which to write the model is specified by the lang argument. Predefined values are "RDF/XML", "RDF/XML-ABBREV", "N-TRIPLE" and "N3". The default value is represented by null is "RDF/XML".

Specified by:
write in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Parameters:
writer - the output writer
lang - the output langauge
Returns:
this model
Throws:
RDFException - generic exception

write

public Model write(java.io.Writer writer,
                   java.lang.String lang,
                   java.lang.String base)
            throws RDFException
Description copied from interface: Model
write a serialized represention of a model in a specified language.

Predefine languages are defined in RDFWriterF

Specified by:
write in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Parameters:
writer - the output writer
base - the base uri for relative URI calculations. null means use only absolute URI's.
lang - the language in which the RDF should be written
Returns:
this model
Throws:
RDFException - generic RDF exception

remove

public Model remove(StmtIterator iter)
             throws RDFException
Description copied from interface: ModelCon
Remove all the Statements returned by an iterator.
Specified by:
remove in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
iter - the iterator which returns the statements to be removed.
Returns:
this model
Throws:
RDFException - Generic RDF Exception

remove

public Model remove(Model m)
             throws RDFException
Description copied from interface: ModelCon
Remove all the Statements in a given model.
Specified by:
remove in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
m - the model containing the statements to be removed.
Returns:
this model
Throws:
RDFException - Generic RDF Exception

contains

public boolean contains(Resource s,
                        Property p,
                        boolean o)
                 throws RDFException
Description copied from interface: ModelCon
Determine if a statement is present in this model.
Specified by:
contains in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
s - The subject of the statment tested.
p - The predicate of the statement tested.
o - The object of the statement tested.
Returns:
true if the statement with subject s, property p and object o is in the model, false otherwise
Throws:
RDFException - Generic RDF Exception

contains

public boolean contains(Resource s,
                        Property p,
                        long o)
                 throws RDFException
Description copied from interface: ModelCon
Determine if a statement is present in this model.
Specified by:
contains in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
s - The subject of the statment tested.
p - The predicate of the statement tested.
o - The object of the statement tested.
Returns:
true if the statement with subject s, property p and object o is in the model, false otherwise
Throws:
RDFException - Generic RDF Exception

contains

public boolean contains(Resource s,
                        Property p,
                        char o)
                 throws RDFException
Description copied from interface: ModelCon
Determine if a statement is present in this model.
Specified by:
contains in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
s - The subject of the statment tested.
p - The predicate of the statement tested.
o - The object of the statement tested.
Returns:
true if the statement with subject s, property p and object o is in the model, false otherwise
Throws:
RDFException - Generic RDF Exception

contains

public boolean contains(Resource s,
                        Property p,
                        float o)
                 throws RDFException
Description copied from interface: ModelCon
Determine if a statement is present in this model.
Specified by:
contains in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
s - The subject of the statment tested.
p - The predicate of the statement tested.
o - The object of the statement tested.
Returns:
true if the statement with subject s, property p and object o is in the model, false otherwise
Throws:
RDFException - Generic RDF Exception

contains

public boolean contains(Resource s,
                        Property p,
                        double o)
                 throws RDFException
Description copied from interface: ModelCon
Determine if a statement is present in this model.
Specified by:
contains in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
s - The subject of the statment tested.
p - The predicate of the statement tested.
o - The object of the statement tested.
Returns:
true if the statement with subject s, property p and object o is in the model, false otherwise
Throws:
RDFException - Generic RDF Exception

contains

public boolean contains(Resource s,
                        Property p,
                        java.lang.String o)
                 throws RDFException
Description copied from interface: ModelCon
Determine if a statement is present in this model.
Specified by:
contains in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
s - The subject of the statment tested.
p - The predicate of the statement tested.
o - The object of the statement tested.
Returns:
true if the statement with subject s, property p and object o is in the model, false otherwise
Throws:
RDFException - Generic RDF Exception

contains

public boolean contains(Resource s,
                        Property p,
                        java.lang.String o,
                        java.lang.String l)
                 throws RDFException
Description copied from interface: ModelCon
Determine if a statement is present in this model.
Specified by:
contains in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
s - The subject of the statment tested.
p - The predicate of the statement tested.
o - The object of the statement tested.
l - the language associated with the object
Returns:
true if the statement with subject s, property p and object o is in the model, false otherwise
Throws:
RDFException - Generic RDF Exception

contains

public boolean contains(Resource s,
                        Property p,
                        java.lang.Object o)
                 throws RDFException
Description copied from interface: ModelCon
Determine if a statement is present in this model.
Specified by:
contains in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
s - The subject of the statment tested.
p - The predicate of the statement tested.
o - The object of the statement tested.
Returns:
true if the statement with subject s, property p and object o is in the model, false otherwise
Throws:
RDFException - Generic RDF Exception

containsAny

public boolean containsAny(StmtIterator iter)
                    throws RDFException
Description copied from interface: Model
Determine if any of the statements returned by an iterator are contained in this model.
Specified by:
containsAny in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Parameters:
iter - an iterator of the statements to be tested
Returns:
true if any of the statements returns by iter are contained in this model and false otherwise.
Throws:
RDFException - Generic RDF Exception

containsAll

public boolean containsAll(StmtIterator iter)
                    throws RDFException
Description copied from interface: Model
Determine if all of the statements returned by an iterator are contained in this model.
Specified by:
containsAll in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Parameters:
iter - an iterator of the statements to be tested
Returns:
true if any of the statements returns by iter are contained in this model and false otherwise.
Throws:
RDFException - Generic RDF Exception

containsAny

public boolean containsAny(Model model)
                    throws RDFException
Description copied from interface: Model
Determine if any of the statements in a model are also contained in this model.
Specified by:
containsAny in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Parameters:
model - the model containing the statements to be tested
Returns:
true if any of the statements in model are also contained in this model and false otherwise.
Throws:
RDFException - Generic RDF Exception

containsAll

public boolean containsAll(Model model)
                    throws RDFException
Description copied from interface: Model
Determine if all of the statements in a model are also contained in this model.
Specified by:
containsAll in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Parameters:
model - the model containing the statements to be tested
Returns:
true if all of the statements in model are also contained in this model and false otherwise.
Throws:
RDFException - Generic RDF Exception

listSubjectsWithProperty

public ResIterator listSubjectsWithProperty(Property p,
                                            boolean o)
                                     throws RDFException
Description copied from interface: ModelCon
List all subjects with a given property and property value
Specified by:
listSubjectsWithProperty in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
p - The predicate sought
o - The value sought
Returns:
an iterator over the subjects
Throws:
RDFException - Generic RDF Exception

listSubjectsWithProperty

public ResIterator listSubjectsWithProperty(Property p,
                                            long o)
                                     throws RDFException
Description copied from interface: ModelCon
List all the subjects with a given property and property value
Specified by:
listSubjectsWithProperty in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
p - The predicate sought
o - The value sought
Returns:
an iterator over the subjects
Throws:
RDFException - Generic RDF Exception

listSubjectsWithProperty

public ResIterator listSubjectsWithProperty(Property p,
                                            char o)
                                     throws RDFException
Description copied from interface: ModelCon
List all subjects with a given property and property value
Specified by:
listSubjectsWithProperty in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
p - The predicate sought
o - The value sought
Returns:
an iterator over the subjects
Throws:
RDFException - Generic RDF Exception

listSubjectsWithProperty

public ResIterator listSubjectsWithProperty(Property p,
                                            float o)
                                     throws RDFException
Description copied from interface: ModelCon
List all subjects with a given property and property value
Specified by:
listSubjectsWithProperty in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
p - The predicate sought
o - The value sought
Returns:
an iterator over the subjects
Throws:
RDFException - Generic RDF Exception

listSubjectsWithProperty

public ResIterator listSubjectsWithProperty(Property p,
                                            double o)
                                     throws RDFException
Description copied from interface: ModelCon
lists all subjects with a given property and property value
Specified by:
listSubjectsWithProperty in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
p - The property sought.
o - The property value sought.
Returns:
an iterator over the set of subjects
Throws:
RDFException - Generic RDF Exception

listSubjectsWithProperty

public ResIterator listSubjectsWithProperty(Property p,
                                            java.lang.String o)
                                     throws RDFException
Description copied from interface: ModelCon
lists all subjects with a given property and property value
Specified by:
listSubjectsWithProperty in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
p - The predicate sought.
o - The property value sought.
Returns:
an iterator over the set of subjects
Throws:
RDFException - Generic RDF Exception

listSubjectsWithProperty

public ResIterator listSubjectsWithProperty(Property p,
                                            java.lang.String o,
                                            java.lang.String l)
                                     throws RDFException
Description copied from interface: ModelCon
lists all subjects with a given property and property value
Specified by:
listSubjectsWithProperty in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
p - The predicate sought.
o - The property value sought.
l - the language associated with the object
Returns:
an iterator over the set of subjects
Throws:
RDFException - Generic RDF Exception

listSubjectsWithProperty

public ResIterator listSubjectsWithProperty(Property p,
                                            java.lang.Object o)
                                     throws RDFException
Description copied from interface: ModelCon
List all subjects with a given property and property value
Specified by:
listSubjectsWithProperty in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
p - The predicate sought
o - The value sought
Returns:
an iterator over the subjects
Throws:
RDFException - Generic RDF Exception

createResource

public Resource createResource(Resource type)
                        throws RDFException
Description copied from interface: ModelCon
Create a new anonymous resource with a given type.

Subsequent operations on the returned resource may modify this model.

The resource is created and an rdf:type property added to the model to specify its type.

Specified by:
createResource in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
type - A resource representing the RDF type of the new resource.
Returns:
a new anonymous resource linked to this model.
Throws:
RDFException - Generic RDF exception

createResource

public Resource createResource(java.lang.String uri,
                               Resource type)
                        throws RDFException
Description copied from interface: ModelCon
Create a new resource with a given type.

Subsequent operations on the returned resource may modify this model.

The resource is created and an rdf:type property added to the model to specify its type.

Specified by:
createResource in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
uri - The URI of the new resource.
type - A resource representing the RDF type of the new resource.
Returns:
a new resource linked to this model.
Throws:
RDFException - Generic RDF exception.

createResource

public Resource createResource(ResourceF f)
                        throws RDFException
Description copied from interface: ModelCon
Create a new anonymous resource using the supplied factory

Subsequent operations on the returned resource may modify this model.

Specified by:
createResource in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
f - A factory object to create the returned object.
Returns:
a new anonymous resource linked to this model.
Throws:
RDFException - Generic RDF exception.

createResource

public Resource createResource(java.lang.String uri,
                               ResourceF f)
                        throws RDFException
Description copied from interface: ModelCon
Create a new resource using the supplied factory

Subsequent operations on the returned resource may modify this model.

Specified by:
createResource in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
uri - the URI of the resource
f - A factory to create the returned object.
Returns:
a new resource linked to this model.
Throws:
RDFException - Generic RDF exception.

createLiteral

public Literal createLiteral(boolean v)
                      throws RDFException
Description copied from interface: ModelCon
create a literal from a boolean value.

The value is converted to a string using its toString method.

Specified by:
createLiteral in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
v - the value of the literal
Returns:
a new literal representing the value v
Throws:
RDFException - generic RDF exception

createLiteral

public Literal createLiteral(long v)
                      throws RDFException
Description copied from interface: ModelCon
create a literal from an integer value.
Specified by:
createLiteral in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
v - the value of the literal
Returns:
a new literal representing the value v
Throws:
RDFException - generic RDF exception

createLiteral

public Literal createLiteral(char v)
                      throws RDFException
Description copied from interface: ModelCon
create a literal from a char value.
Specified by:
createLiteral in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
v - the value of the literal
Returns:
a new literal representing the value v
Throws:
RDFException - generic RDF exception

createLiteral

public Literal createLiteral(float v)
                      throws RDFException
Description copied from interface: ModelCon
create a literal from a float value.
Specified by:
createLiteral in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
v - the value of the literal
Returns:
a new literal representing the value v
Throws:
RDFException - generic RDF exception

createLiteral

public Literal createLiteral(double v)
                      throws RDFException
Description copied from interface: ModelCon
create a literal from a double value.
Specified by:
createLiteral in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
v - the value of the literal
Returns:
a new literal representing the value v
Throws:
RDFException - generic RDF exception

createLiteral

public Literal createLiteral(java.lang.String v)
                      throws RDFException
Description copied from interface: ModelCon
create a literal from a String value.
Specified by:
createLiteral in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
v - the value of the literal
Returns:
a new literal representing the value v
Throws:
RDFException - generic RDF exception

createLiteral

public Literal createLiteral(java.lang.String v,
                             java.lang.String l)
                      throws RDFException
Description copied from interface: Model
create a literal from a String value with a specified language

If v is null, then a literal with an empty string is created.

Specified by:
createLiteral in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Parameters:
v - the value of the literal
language - the language associated with the literal
Returns:
a new literal representing the value v with the given language
Throws:
RDFException - generic RDF exception

createLiteral

public Literal createLiteral(java.lang.String v,
                             java.lang.String l,
                             boolean wellFormed)
Description copied from interface: Model
create a literal from a String value with a specified language

If v is null, then a literal with an empty string is created.

Specified by:
createLiteral in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Parameters:
v - the value of the literal
language - the language associated with the literal
wellFormed - true if the Literal is well formed XML
Returns:
a new literal representing the value v with the given language
Throws:
RDFException - generic RDF exception

createLiteral

public Literal createLiteral(java.lang.Object v)
                      throws RDFException
Description copied from interface: ModelCon
create a literal from an Object.
Specified by:
createLiteral in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
v - the value of the literal.
Returns:
a new literal representing the value v
Throws:
RDFException - generic RDF exception

createStatement

public Statement createStatement(Resource r,
                                 Property p,
                                 boolean o)
                          throws RDFException
Description copied from interface: ModelCon
Create a Statement instance.

Subsequent operations on the statement or any of its parts may modify this model.

Creating a statement does not add it to the set of statements in the model.

The value o will be converted to a Literal.

Specified by:
createStatement in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
s - the subject of the statement
p - the predicate of the statement
o - is the value to be the object of the statement
Returns:
the new statement
Throws:
RDFException - generic RDF exception

createStatement

public Statement createStatement(Resource r,
                                 Property p,
                                 long o)
                          throws RDFException
Description copied from interface: ModelCon
Create a Statement instance.

Subsequent operations on the statement or any of its parts may modify this model.

Creating a statement does not add it to the set of statements in the model.

The value o will be converted to a Literal.

Specified by:
createStatement in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
s - the subject of the statement
p - the predicate of the statement
o - is the value to be the object of the statement
Returns:
the new statement
Throws:
RDFException - generic RDF exception

createStatement

public Statement createStatement(Resource r,
                                 Property p,
                                 char o)
                          throws RDFException
Description copied from interface: ModelCon
Create a Statement instance.

Subsequent operations on the statement or any of its parts may modify this model.

Creating a statement does not add it to the set of statements in the model.

The value o will be converted to a Literal.

Specified by:
createStatement in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
s - the subject of the statement
p - the predicate of the statement
o - is the value to be the object of the statement
Returns:
the new statement
Throws:
RDFException - generic RDF exception

createStatement

public Statement createStatement(Resource r,
                                 Property p,
                                 float o)
                          throws RDFException
Description copied from interface: ModelCon
Create a Statement instance.

Subsequent operations on the statement or any of its parts may modify this model.

Creating a statement does not add it to the set of statements in the model.

The value o will be converted to a Literal.

Specified by:
createStatement in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
s - the subject of the statement
p - the predicate of the statement
o - is the value to be the object of the statement
Returns:
the new statement
Throws:
RDFException - generic RDF exception

createStatement

public Statement createStatement(Resource r,
                                 Property p,
                                 double o)
                          throws RDFException
Description copied from interface: ModelCon
Create a Statement instance.

Subsequent operations on the statement or any of its parts may modify this model.

Creating a statement does not add it to the set of statements in the model.

The value o will be converted to a Literal.

Specified by:
createStatement in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
s - the subject of the statement
p - the predicate of the statement
o - is the value to be the object of the statement
Returns:
the new statement
Throws:
RDFException - generic RDF exception

createStatement

public Statement createStatement(Resource r,
                                 Property p,
                                 java.lang.String o)
                          throws RDFException
Description copied from interface: ModelCon
Create a Statement instance.

Subsequent operations on the statement or any of its parts may modify this model.

Creating a statement does not add it to the set of statements in the model.

The Object o will be converted to a Literal.

Specified by:
createStatement in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
s - the subject of the statement
p - the predicate of the statement
o - is the value to be the object of the statement
Returns:
the new statement
Throws:
RDFException - generic RDF exception

createStatement

public Statement createStatement(Resource r,
                                 Property p,
                                 java.lang.Object o)
                          throws RDFException
Description copied from interface: ModelCon
Create a Statement instance.

Subsequent operations on the statement or any of its parts may modify this model.

Creating a statement does not add it to the set of statements in the model.

The value o will be converted to a Literal.

Specified by:
createStatement in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
s - the subject of the statement
p - the predicate of the statement
o - is the value to be the object of the statement
Returns:
the new statement
Throws:
RDFException - generic RDF exception

createStatement

public Statement createStatement(Resource r,
                                 Property p,
                                 java.lang.String o,
                                 boolean wellFormed)
                          throws RDFException
Description copied from interface: ModelCon
Create a Statement instance.

Subsequent operations on the statement or any of its parts may modify this model.

Creating a statement does not add it to the set of statements in the model.

The Object o will be converted to a Literal.

Specified by:
createStatement in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
s - the subject of the statement
p - the predicate of the statement
o - is the value to be the object of the statement
wellFormed - true if the string is well formed XML
Returns:
the new statement
Throws:
RDFException - generic RDF exception

createStatement

public Statement createStatement(Resource r,
                                 Property p,
                                 java.lang.String o,
                                 java.lang.String l)
                          throws RDFException
Description copied from interface: ModelCon
Create a Statement instance.

Subsequent operations on the statement or any of its parts may modify this model.

Creating a statement does not add it to the set of statements in the model.

The Object o will be converted to a Literal.

Specified by:
createStatement in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
s - the subject of the statement
p - the predicate of the statement
o - is the value to be the object of the statement
l - the language associated with the object
Returns:
the new statement
Throws:
RDFException - generic RDF exception

createStatement

public Statement createStatement(Resource r,
                                 Property p,
                                 java.lang.String o,
                                 java.lang.String l,
                                 boolean wellFormed)
                          throws RDFException
Description copied from interface: ModelCon
Create a Statement instance.

Subsequent operations on the statement or any of its parts may modify this model.

Creating a statement does not add it to the set of statements in the model.

The Object o will be converted to a Literal.

Specified by:
createStatement in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
s - the subject of the statement
p - the predicate of the statement
o - is the value to be the object of the statement
l - the language associated with the object
wellFormed - true of the string is well formed XML
Returns:
the new statement
Throws:
RDFException - generic RDF exception

createBag

public Bag createBag()
              throws RDFException
Description copied from interface: ModelCon
Create a new anonymous bag.

Subsequent operations on the bag or any of its parts may modify this model.

A statement defining the type of the new bag is added to this model.

Specified by:
createBag in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Returns:
a new anonymous bag.
Throws:
RDFException - Generic RDF exception.

createAlt

public Alt createAlt()
              throws RDFException
Description copied from interface: ModelCon
Create a new anonymous alt.

Subsequent operations on the alt or any of its parts may modify this model.

A statement defining the type of the new alt is added to this model.

Specified by:
createAlt in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Returns:
a new anonymous alt.
Throws:
RDFException - Generic RDF exception.

createSeq

public Seq createSeq()
              throws RDFException
Description copied from interface: ModelCon
Create a new anonymous seq.

Subsequent operations on the seq or any of its parts may modify this model.

A statement defining the type of the new seq is added to this model.

Specified by:
createSeq in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Returns:
a new anonymous seq.
Throws:
RDFException - Generic RDF exception.

getResource

public Resource getResource(java.lang.String uri)
                     throws RDFException
Description copied from interface: Model
Return a Resource instance in this model.

Subsequent operations on the returned object may modify this model.

This method should be called if the resource may already exist in the model so that an implementation may reuse the same object. If it does not an object will be created. If it is known that an object for the resource does not already exist, then it may be more efficient to call createResource instead.

Specified by:
getResource in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Parameters:
uri - the URI of the resource
Returns:
a resource instance
Throws:
RDFException - Generic RDF exception.

getProperty

public Property getProperty(java.lang.String uri)
                     throws RDFException
Description copied from interface: ModelCon
Return a Property instance in this model.

Subsequent operations on the returned property may modify this model.

The property is assumed to already exist in the model. If it does not, createProperty should be used instead.

Specified by:
getProperty in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
uri - the URI of the property
Returns:
a property object
Throws:
RDFException - Generic RDF Exception

getProperty

public Property getProperty(java.lang.String nameSpace,
                            java.lang.String localName)
                     throws RDFException
Description copied from interface: Model
Return a Property instance in this model.

Subsequent operations on the returned property may modify this model.

This method should be called if the property may already exist in the model so that an implementation may reuse the same object. If it does not an object will be created. If it is known that an object for the property does not already exist, then it may be more efficient to call createProperty instead.

Specified by:
getProperty in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Parameters:
nameSpace - the RDF namespace of the property
localName - the localName of the property in its namespace
Returns:
a property linked to this model
Throws:
RDFException - Generic RDF Exception

getBag

public Bag getBag(java.lang.String uri)
           throws RDFException
Description copied from interface: ModelCon
Return a Bag instance in this model.

Subsequent operations on the returned bag may modify this model.

The bag is assumed to already exist in the model. If it does not, createBag should be used instead.

Specified by:
getBag in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
uri - the URI of the bag.
Returns:
a bag instance
Throws:
RDFException - Generic RDF Exception

getBag

public Bag getBag(Resource r)
           throws RDFException
Description copied from interface: ModelCon
Return a bag instance based on a given resource.

This method enables an application to treat any resource as a bag. It is in effect an unsafe downcast.

Subsequent operations on the returned bag may modify this model.

The bag is assumed to already exist in the model. If it does not, createBag should be used instead.

Specified by:
getBag in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
r - an untyped Resource instance
Returns:
a bag instance
Throws:
RDFException - Generic RDF Exception

getAlt

public Alt getAlt(java.lang.String uri)
           throws RDFException
Description copied from interface: ModelCon
Return an Alt instance in this model.

Subsequent operations on the returned object may modify this model.

The alt is assumed to already exist in the model. If it does not, createAlt should be used instead.

Specified by:
getAlt in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
uri - the URI of the alt
Returns:
an alt instance
Throws:
RDFException - Generic RDF Exception

getAlt

public Alt getAlt(Resource r)
           throws RDFException
Description copied from interface: ModelCon
Return an Alt instance based on a given resource.

This method enables an application to treat any resource as an Alt. It is in effect an unsafe downcast.

Subsequent operations on the returned Alt may modify this model.

The bag is assumed to already exist in the model. If it does not, createAlt should be used instead.

Specified by:
getAlt in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
r - an untyped Resource instance
Returns:
an Alt instance
Throws:
RDFException - Generic RDF Exception

getSeq

public Seq getSeq(java.lang.String uri)
           throws RDFException
Description copied from interface: ModelCon
Return a Seq instance in this model.

Subsequent operations on the returned bag may modify this model.

The seq is assumed to already exist in the model. If it does not, createSeq should be used instead.

Specified by:
getSeq in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
uri - the URI of the seq
Returns:
a seq instance
Throws:
RDFException - Generic RDF Exception

getSeq

public Seq getSeq(Resource r)
           throws RDFException
Description copied from interface: ModelCon
Return a Seq instance based on a given resource.

This method enables an application to treat any resource as a Seq. It is in effect an unsafe downcast.

Subsequent operations on the returned Seq may modify this model.

The Seq is assumed to already exist in the model. If it does not, createAlt should be used instead.

Specified by:
getSeq in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
r - an untyped Resource instance
Returns:
an Alt instance
Throws:
RDFException - Generic RDF Exception

size

public long size()
          throws RDFException
Description copied from interface: Model
computes the number of statements in the model.
Specified by:
size in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Returns:
the number of statements in the model
Throws:
RDFException - Generic RDF Exception

listSubjects

public ResIterator listSubjects()
                         throws RDFException
Description copied from interface: Model
List all resources which are subjects of statements.

Subsequent operations on those resource may modify this model.

Specified by:
listSubjects in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Returns:
an iterator over a set of resources which are subjects of statements in the model.
Throws:
RDFException - Generic RDF Exception

listNameSpaces

public NsIterator listNameSpaces()
                          throws RDFException
Description copied from interface: Model
List all namespaces of predicates in the model.
Specified by:
listNameSpaces in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Returns:
an iterator over the set of namespaces associated with predicates in the model.
Throws:
RDFException - Generic RDF Exception

listStatements

public StmtIterator listStatements()
                            throws RDFException
Description copied from interface: Model
List all statements.

Subsequent operations on those statements may modify this model.

Specified by:
listStatements in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Returns:
an iterator over all statements in the model.
Throws:
RDFException - Generic RDF Exception

listReifiedStatements

public StmtIterator listReifiedStatements()
                                   throws RDFException
Description copied from interface: Model
List all reified statements in the model.

Subsequent operations on those statements may modify this model.

Specified by:
listReifiedStatements in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Returns:
an iterator over the set of all reified statements in the model
Throws:
RDFException - Generic RDF Exception

add

public Model add(Statement s)
          throws RDFException
Description copied from interface: Model
Add a statement to this model.
Specified by:
add in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Parameters:
s - The statement to be added.
Returns:
This model.
Throws:
RDFException - Generic RDF Exception

remove

public Model remove(Statement s)
             throws RDFException
Description copied from interface: Model
Removes a statement.

The statement with the same subject, predicate and object as that supplied will be removed from the model.

Specified by:
remove in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Parameters:
s - The statement to be removed.
Returns:
this model
Throws:
RDFException - Generic RDF Exception

contains

public boolean contains(Statement s)
                 throws RDFException
Description copied from interface: Model
Determine if a statement is present in this model.
Specified by:
contains in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Parameters:
s - The statement tested.
Returns:
true if the statement s is in this model, false otherwise
Throws:
RDFException - Generic RDF Exception

contains

public boolean contains(Resource s,
                        Property p)
                 throws RDFException
Description copied from interface: Model
Determine whether this model contains any statements with a given subject and property.
Specified by:
contains in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Parameters:
s - The subject sought.
p - The predicate sought.
Returns:
true if there exists within this model a statement with subject s and property p, false otherwise
Throws:
RDFException - Generic RDF Exception

contains

public boolean contains(Resource s,
                        Property p,
                        RDFNode o)
                 throws RDFException
Description copied from interface: Model
Determine if a statement is present in this model.
Specified by:
contains in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Parameters:
s - The subject of the statment tested.
p - The predicate of the statement tested.
o - The object of the statement tested.
Returns:
true if the statement with subject s, property p and object o is in the model, false otherwise
Throws:
RDFException - Generic RDF Exception

isReified

public boolean isReified(Statement s)
                  throws RDFException
Description copied from interface: Model
Determine if this statement is the subject of any statements in this model
Specified by:
isReified in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Parameters:
s - The statement tested.
Returns:
true if the statement s is the subject of a statement in the model, false otherwise
Throws:
RDFException - Generic RDF Exception

getProperty

public Statement getProperty(Resource s,
                             Property p)
                      throws RDFException
Description copied from interface: Model
Return a statement with given subject and property.

If more than one statement witht the given subject and property exists in the model, it is undefined which will be returned.

Specified by:
getProperty in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Parameters:
s - The subject of the statement to be returned.
p - The property of the statement to be returned.
Returns:
A statement from the model with the given subject and property.
Throws:
RDFException - Generic RDF Exception

listSubjectsWithProperty

public ResIterator listSubjectsWithProperty(Property p)
                                     throws RDFException
Description copied from interface: Model
List all subjects with a given property.
Specified by:
listSubjectsWithProperty in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Parameters:
p - the property sought.
Returns:
an iterator over the subjects
Throws:
RDFException - Generic RDF Exception

listSubjectsWithProperty

public ResIterator listSubjectsWithProperty(Property p,
                                            RDFNode o)
                                     throws RDFException
Description copied from interface: Model
List all subjects with a given property and property value
Specified by:
listSubjectsWithProperty in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Parameters:
p - The predicate sought
o - The value sought
Returns:
an iterator over the subjects
Throws:
RDFException - Generic RDF Exception

listObjects

public NodeIterator listObjects()
                         throws RDFException
Description copied from interface: Model
List all objects in a model.
Specified by:
listObjects in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Parameters:
p - The predicate sought
Returns:
an iterator over the objects
Throws:
RDFException - Generic RDF Exception

listObjectsOfProperty

public NodeIterator listObjectsOfProperty(Property p)
                                   throws RDFException
Description copied from interface: Model
List all objects of a given property.
Specified by:
listObjectsOfProperty in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Parameters:
p - The predicate sought
Returns:
an iterator over the objects
Throws:
RDFException - Generic RDF Exception

listObjectsOfProperty

public NodeIterator listObjectsOfProperty(Resource s,
                                          Property p)
                                   throws RDFException
Description copied from interface: Model
List the values of a property of a resource.
Specified by:
listObjectsOfProperty in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Parameters:
p - The predicate sought
Returns:
an iterator over the objects
Throws:
RDFException - Generic RDF Exception

listStatements

public StmtIterator listStatements(Selector selector)
                            throws RDFException
Description copied from interface: Model
List the statements matching a selector.

A statment is considered to match if the test method of s returns true when called on s.

Specified by:
listStatements in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Parameters:
s - A selector object.
Returns:
an iterator over the matching statements
Throws:
RDFException - Generic RDF exception.

begin

public Model begin()
            throws RDFException
Description copied from interface: Model
Begin a new transation.

All changes made to a model within a transaction, will either be made, or none of them will be made.

Specified by:
begin in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Returns:
this model to enable cascading.
Throws:
RDFException - Generic RDF Exception

abort

public Model abort()
            throws RDFException
Description copied from interface: Model
Abort the current transaction and abandon any changes in progress.
Specified by:
abort in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Returns:
this model to enable cascading.
Throws:
RDFException - Generic RDF Exception

commit

public Model commit()
             throws RDFException
Description copied from interface: Model
Commit the current transaction.
Specified by:
commit in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Returns:
this model to enable cascading.
Throws:
RDFException - Generic RDF Exception

independent

public boolean independent()
Description copied from interface: Model
Determine whether this model is independent.

For efficiency reasons, some implementations may create models which which are dependent on others, i.e. a change in one model may cause a change in another. If this is the case this method will return false, otherwise it will return true.

Specified by:
independent in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Returns:
true if this model is indepdent of others

createResource

public Resource createResource()
                        throws RDFException
Description copied from interface: Model
Create a new anonymous resource.

Subsequent operations on the returned resource may modify this model.

Specified by:
createResource in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Returns:
a new anonymous resource linked to this model.
Throws:
RDFException - Generic RDF exception.

createResource

public Resource createResource(java.lang.String uri)
                        throws RDFException
Description copied from interface: Model
Create a new resource.

Subsequent operations on the returned resource may modify this model.

Specified by:
createResource in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Parameters:
uri - the URI of the resource to be created
Returns:
a new resource linked to this model.
Throws:
RDFException - Generic RDF exception.

createProperty

public Property createProperty(java.lang.String uri)
                        throws RDFException
Description copied from interface: ModelCon
Create a property

Subsequent operations on the returned property may modify this model.

Specified by:
createProperty in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
uri - the URI of the property
Returns:
a property instance
Throws:
RDFException - Generic RDF exception

createProperty

public Property createProperty(java.lang.String nameSpace,
                               java.lang.String localName)
                        throws RDFException
Description copied from interface: Model
Create a property

Subsequent operations on the returned property may modify this model.

Specified by:
createProperty in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Parameters:
nameSpace - the nameSpace of the property
localName - the name of the property within its namespace
Returns:
a property instance
Throws:
RDFException - Generic RDF exception

createStatement

public Statement createStatement(Resource r,
                                 Property p,
                                 RDFNode o)
                          throws RDFException
Description copied from interface: Model
Create a Statement instance.

Subsequent operations on the statement or any of its parts will modify this model.

Creating a statement does not add it to the set of statements in the model.

Specified by:
createStatement in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Parameters:
s - the subject of the statement
p - the predicate of the statement
o - the object of the statement
Returns:
the new statement
Throws:
RDFException - generic RDF exception

createBag

public Bag createBag(java.lang.String uri)
              throws RDFException
Description copied from interface: ModelCon
Create a new bag.

Subsequent operations on the bag or any of its parts may modify this model.

A statement defining the type of the new bag is added to this model.

Specified by:
createBag in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
uri - The URI of the new Bag.
Returns:
a new bag.
Throws:
RDFException - Generic RDF exception.

createAlt

public Alt createAlt(java.lang.String uri)
              throws RDFException
Description copied from interface: ModelCon
Create a new alt.

Subsequent operations on the alt or any of its parts may modify this model.

A statement defining the type of the new alt is added to this model.

Specified by:
createAlt in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
uri - The URI of the new alt.
Returns:
a new alt.
Throws:
RDFException - Generic RDF exception.

createSeq

public Seq createSeq(java.lang.String uri)
              throws RDFException
Description copied from interface: ModelCon
Create a new seq.

Subsequent operations on the seq or any of its parts may modify this model.

A statement defining the type of the new seq is added to this model.

Specified by:
createSeq in interface ModelCon
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.ModelCon
Parameters:
uri - The URI of the new seq.
Returns:
a new seq.
Throws:
RDFException - Generic RDF exception.

listContainerMembers

public NodeIterator listContainerMembers(Container cont,
                                         NodeIteratorFactory f)
                                  throws RDFException
Specified by:
listContainerMembers in interface ModelI
Following copied from interface: com.hp.hpl.mesa.rdf.jena.common.ModelI
Parameters:
cont -  
f -  
Returns:
iterator over container members
Throws:
RDFException -  

containerSize

public int containerSize(Container cont)
                  throws RDFException
Specified by:
containerSize in interface ModelI
Following copied from interface: com.hp.hpl.mesa.rdf.jena.common.ModelI
Parameters:
cont -  
Returns:
size of container
Throws:
RDFException -  

containerIndexOf

public int containerIndexOf(Container cont,
                            RDFNode n)
                     throws RDFException
Specified by:
containerIndexOf in interface ModelI
Following copied from interface: com.hp.hpl.mesa.rdf.jena.common.ModelI
Parameters:
cont -  
n -  
Returns:
index of n in container
Throws:
RDFException -  

containerContains

public boolean containerContains(Container cont,
                                 RDFNode n)
                          throws RDFException
Specified by:
containerContains in interface ModelI
Following copied from interface: com.hp.hpl.mesa.rdf.jena.common.ModelI
Parameters:
cont -  
n -  
Returns:
true if containter contains n, false otherwise
Throws:
RDFException -  

convert

public Resource convert(Resource r)
                 throws RDFException
Specified by:
convert in interface ModelI
Following copied from interface: com.hp.hpl.mesa.rdf.jena.common.ModelI
Parameters:
r -  
Returns:
the converted resource
Throws:
RDFException -  

convert

public Property convert(Property p)
                 throws RDFException
Specified by:
convert in interface ModelI
Following copied from interface: com.hp.hpl.mesa.rdf.jena.common.ModelI
Parameters:
p -  
Returns:
the converted property
Throws:
RDFException -  

convert

public RDFNode convert(RDFNode n)
                throws RDFException
Specified by:
convert in interface ModelI
Following copied from interface: com.hp.hpl.mesa.rdf.jena.common.ModelI
Parameters:
n -  
Returns:
the converted node
Throws:
RDFException -  

equals

public boolean equals(java.lang.Object model)
Description copied from interface: Model
Test whether one model is the equal to another.

Two models are considered equal when each statement in one can be matched with a statement in the other. Statements which are identical match.

Special treatment is given to anonymous nodes. A binding is a one to one mapping which maps each anonymous node in this model to an anonymous node in model. Two statements s1 and s2 match under a binding if if s1.subject is anonymous and s2.subject is anonymous and the binding maps s1.subject to s2.subject.

Two models are equal if there is a binding that allows all the statements in one model to match a a statement in the other.

Specified by:
equals in interface Model
Overrides:
equals in class java.lang.Object
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Parameters:
model - the model to be compared
Returns:
true if the models are equal

close

public void close()
Description copied from interface: Model
Close the Model and free up resources held.

Not all implementations of Model 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.

Specified by:
close in interface Model


Copyright © 2001 Hewlett-Packard. All Rights Reserved.