|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.hp.hpl.mesa.rdf.jena.common.ModelCom
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.
| 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,
RDFNode o,
Location l)
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 |
public ModelCom()
| Method Detail |
public Resource getResource(java.lang.String uri,
ResourceF f)
throws RDFException
ModelConSubsequent 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.
getResource in interface ModelConuri - the URI of the resourcef - the factory object
RDFException - Generic RDF Exception
public Model add(Resource s,
Property p,
RDFNode o)
throws RDFException
ModelCon
add in interface ModelCons - the subject of the statement to addp - the predicate of the statement to addo - the object of the statement to add
RDFException - Generic RDF Exception
public Model add(Resource s,
Property p,
RDFNode o,
Location l)
throws RDFException
ModelCon
add in interface ModelCons - the subject of the statement to addp - the predicate of the statement to addo - the object of the statement to addl - the location of the statement in the source
RDFException - Generic RDF Exception
public Model add(Resource s,
Property p,
boolean o)
throws RDFException
ModelCon
add in interface ModelCons - the subject of the statement to addp - the predicate of the statement to addo - the object of the statement to add
RDFException - Generic RDF Exception
public Model add(Resource s,
Property p,
long o)
throws RDFException
ModelCon
add in interface ModelCons - the subject of the statement to addp - the predicate of the statement to addo - the object of the statement to add
RDFException - Generic RDF Exception
public Model add(Resource s,
Property p,
char o)
throws RDFException
ModelCon
add in interface ModelCons - the subject of the statement to addp - the predicate of the statement to addo - the object of the statement to add
RDFException - Generic RDF Exception
public Model add(Resource s,
Property p,
float o)
throws RDFException
ModelCon
add in interface ModelCons - the subject of the statement to addp - the predicate of the statement to addo - the object of the statement to add
RDFException - Generic RDF Exception
public Model add(Resource s,
Property p,
double o)
throws RDFException
ModelCon
add in interface ModelCons - the subject of the statement to addp - the predicate of the statement to addo - the object of the statement to add
RDFException - Generic RDF Exception
public Model add(Resource s,
Property p,
java.lang.String o)
throws RDFException
ModelCon
add in interface ModelCons - the subject of the statement to addp - the predicate of the statement to addo - the object of the statement to add
RDFException - Generic RDF Exception
public Model add(Resource s,
Property p,
java.lang.String o,
boolean wellFormed)
throws RDFException
ModelCon
add in interface ModelCons - the subject of the statement to addp - the predicate of the statement to addo - the object of the statement to addwellFormed - true if o is well formed XML
RDFException - Generic RDF Exception
public Model add(Resource s,
Property p,
java.lang.String o,
java.lang.String lang,
boolean wellFormed)
throws RDFException
ModelCon
add in interface ModelCons - the subject of the statement to addp - the predicate of the statement to addo - the object of the statement to addlang - the language associated with the objectwellFormed - true if o is well formed XML
RDFException - Generic RDF Exception
public Model add(Resource s,
Property p,
java.lang.String o,
java.lang.String l)
throws RDFException
ModelCon
add in interface ModelCons - the subject of the statement to addp - the predicate of the statement to addo - the object of the statement to addl - the language associated with the object
RDFException - Generic RDF Exception
public Model add(Resource s,
Property p,
java.lang.Object o)
throws RDFException
ModelCon
add in interface ModelCons - the subject of the statement to addp - the predicate of the statement to addo - the object of the statement to add
RDFException - Generic RDF Exception
public Model add(StmtIterator iter)
throws RDFException
Model
add in interface Modeliter - An iterator which returns the statements to be added.
RDFException - Generic RDF Exception
public Model add(Model m)
throws RDFException
Model
add in interface Modelm - The model whose statements are to be added.
RDFException - Generic RDF Exception
public RDFReader getReader()
throws RDFException
RDFReaderF
getReader in interface RDFReaderFRDFException - generic RDF exception
public RDFReader getReader(java.lang.String lang)
throws RDFException
RDFReaderF
getReader in interface RDFReaderFlang - the serialization langauge - null selects the
default
RDFException - generic RDF exception
public java.lang.String setReaderClassName(java.lang.String lang,
java.lang.String className)
RDFReaderF
setReaderClassName in interface RDFReaderFlang - the language for which this class should be usedclassName - the class name for readers for this language
public Model read(java.lang.String url)
throws RDFException
ModelSee Model for a description of how to traverse a firewall.
read in interface Modelurl - of the document containing the RDF statements.
RDFException - Generic RDF Exception
public Model read(java.io.Reader reader,
java.lang.String base)
throws RDFException
Model
read in interface Modelreader - the source of the RDF/XMLbase - the base to use when converting relative to absolute uri's
RDFException - a generic RDF exception
public Model read(java.lang.String url,
java.lang.String lang)
throws RDFException
Modellang 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.
read in interface Modelurl - a string representation of the url to read fromlang - the language of the serialization
RDFException - generic RDF exception
public Model read(java.io.Reader reader,
java.lang.String base,
java.lang.String lang)
throws RDFException
Modellang to the model.
predefined values for lang are defined in RDFReader
read in interface Modelbase - the base uri to be used when converting relative
URI's to absolute URI's.lang - the langauge of the serialization null
selects the defaultreader - the source of the input serialization
- Returns:
- this model
- Throws:
RDFException - generic exception
public RDFWriter getWriter()
throws RDFException
RDFWriterF
getWriter in interface RDFWriterFRDFException
public RDFWriter getWriter(java.lang.String lang)
throws RDFException
RDFWriterF
getWriter in interface RDFWriterFlang - the serialization langauge - null selects the
default
RDFException
public java.lang.String setWriterClassName(java.lang.String lang,
java.lang.String className)
RDFWriterF
setWriterClassName in interface RDFWriterFlang - the language for which this class should be usedclassName - the class name for writers for this language
public Model write(java.io.Writer writer)
throws RDFException
ModelThe 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".
write in interface Modelwriter - a writer to which the XML will be written
RDFException - Generic RDF Exception
public Model write(java.io.Writer writer,
java.lang.String lang)
throws RDFException
ModelThe 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".
write in interface Modelwriter - the output writerlang - the output langauge
RDFException - generic exception
public Model write(java.io.Writer writer,
java.lang.String lang,
java.lang.String base)
throws RDFException
ModelPredefine languages are defined in RDFWriterF
write in interface Modelwriter - the output writerbase - the base uri for relative URI calculations.
null means use only absolute URI's.lang - the language in which the RDF should be written
RDFException - generic RDF exception
public Model remove(StmtIterator iter)
throws RDFException
ModelCon
remove in interface ModelConiter - the iterator which returns the statements to be removed.
RDFException - Generic RDF Exception
public Model remove(Model m)
throws RDFException
ModelCon
remove in interface ModelConm - the model containing the statements to be removed.
RDFException - Generic RDF Exception
public boolean contains(Resource s,
Property p,
boolean o)
throws RDFException
ModelCon
contains in interface ModelCons - The subject of the statment tested.p - The predicate of the statement tested.o - The object of the statement tested.
RDFException - Generic RDF Exception
public boolean contains(Resource s,
Property p,
long o)
throws RDFException
ModelCon
contains in interface ModelCons - The subject of the statment tested.p - The predicate of the statement tested.o - The object of the statement tested.
RDFException - Generic RDF Exception
public boolean contains(Resource s,
Property p,
char o)
throws RDFException
ModelCon
contains in interface ModelCons - The subject of the statment tested.p - The predicate of the statement tested.o - The object of the statement tested.
RDFException - Generic RDF Exception
public boolean contains(Resource s,
Property p,
float o)
throws RDFException
ModelCon
contains in interface ModelCons - The subject of the statment tested.p - The predicate of the statement tested.o - The object of the statement tested.
RDFException - Generic RDF Exception
public boolean contains(Resource s,
Property p,
double o)
throws RDFException
ModelCon
contains in interface ModelCons - The subject of the statment tested.p - The predicate of the statement tested.o - The object of the statement tested.
RDFException - Generic RDF Exception
public boolean contains(Resource s,
Property p,
java.lang.String o)
throws RDFException
ModelCon
contains in interface ModelCons - The subject of the statment tested.p - The predicate of the statement tested.o - The object of the statement tested.
RDFException - Generic RDF Exception
public boolean contains(Resource s,
Property p,
java.lang.String o,
java.lang.String l)
throws RDFException
ModelCon
contains in interface ModelCons - 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
RDFException - Generic RDF Exception
public boolean contains(Resource s,
Property p,
java.lang.Object o)
throws RDFException
ModelCon
contains in interface ModelCons - The subject of the statment tested.p - The predicate of the statement tested.o - The object of the statement tested.
RDFException - Generic RDF Exception
public boolean containsAny(StmtIterator iter)
throws RDFException
Model
containsAny in interface Modeliter - an iterator of the statements to be tested
RDFException - Generic RDF Exception
public boolean containsAll(StmtIterator iter)
throws RDFException
Model
containsAll in interface Modeliter - an iterator of the statements to be tested
RDFException - Generic RDF Exception
public boolean containsAny(Model model)
throws RDFException
Model
containsAny in interface Modelmodel - the model containing the statements to be tested
RDFException - Generic RDF Exception
public boolean containsAll(Model model)
throws RDFException
Model
containsAll in interface Modelmodel - the model containing the statements to be tested
RDFException - Generic RDF Exception
public ResIterator listSubjectsWithProperty(Property p,
boolean o)
throws RDFException
ModelCon
listSubjectsWithProperty in interface ModelConp - The predicate soughto - The value sought
RDFException - Generic RDF Exception
public ResIterator listSubjectsWithProperty(Property p,
long o)
throws RDFException
ModelCon
listSubjectsWithProperty in interface ModelConp - The predicate soughto - The value sought
RDFException - Generic RDF Exception
public ResIterator listSubjectsWithProperty(Property p,
char o)
throws RDFException
ModelCon
listSubjectsWithProperty in interface ModelConp - The predicate soughto - The value sought
RDFException - Generic RDF Exception
public ResIterator listSubjectsWithProperty(Property p,
float o)
throws RDFException
ModelCon
listSubjectsWithProperty in interface ModelConp - The predicate soughto - The value sought
RDFException - Generic RDF Exception
public ResIterator listSubjectsWithProperty(Property p,
double o)
throws RDFException
ModelCon
listSubjectsWithProperty in interface ModelConp - The property sought.o - The property value sought.
RDFException - Generic RDF Exception
public ResIterator listSubjectsWithProperty(Property p,
java.lang.String o)
throws RDFException
ModelCon
listSubjectsWithProperty in interface ModelConp - The predicate sought.o - The property value sought.
RDFException - Generic RDF Exception
public ResIterator listSubjectsWithProperty(Property p,
java.lang.String o,
java.lang.String l)
throws RDFException
ModelCon
listSubjectsWithProperty in interface ModelConp - The predicate sought.o - The property value sought.l - the language associated with the object
RDFException - Generic RDF Exception
public ResIterator listSubjectsWithProperty(Property p,
java.lang.Object o)
throws RDFException
ModelCon
listSubjectsWithProperty in interface ModelConp - The predicate soughto - The value sought
RDFException - Generic RDF Exception
public Resource createResource(Resource type)
throws RDFException
ModelConSubsequent 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.
createResource in interface ModelContype - A resource representing the RDF type of the new resource.
RDFException - Generic RDF exception
public Resource createResource(java.lang.String uri,
Resource type)
throws RDFException
ModelConSubsequent 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.
createResource in interface ModelConuri - The URI of the new resource.type - A resource representing the RDF type of the new resource.
RDFException - Generic RDF exception.
public Resource createResource(ResourceF f)
throws RDFException
ModelConSubsequent operations on the returned resource may modify this model.
createResource in interface ModelConf - A factory object to create the returned object.
RDFException - Generic RDF exception.
public Resource createResource(java.lang.String uri,
ResourceF f)
throws RDFException
ModelConSubsequent operations on the returned resource may modify this model.
createResource in interface ModelConuri - the URI of the resourcef - A factory to create the returned object.
RDFException - Generic RDF exception.
public Literal createLiteral(boolean v)
throws RDFException
ModelCon The value is converted to a string using its toString
method.
createLiteral in interface ModelConv - the value of the literal
RDFException - generic RDF exception
public Literal createLiteral(long v)
throws RDFException
ModelCon
createLiteral in interface ModelConv - the value of the literal
RDFException - generic RDF exception
public Literal createLiteral(char v)
throws RDFException
ModelCon
createLiteral in interface ModelConv - the value of the literal
RDFException - generic RDF exception
public Literal createLiteral(float v)
throws RDFException
ModelCon
createLiteral in interface ModelConv - the value of the literal
RDFException - generic RDF exception
public Literal createLiteral(double v)
throws RDFException
ModelCon
createLiteral in interface ModelConv - the value of the literal
RDFException - generic RDF exception
public Literal createLiteral(java.lang.String v)
throws RDFException
ModelCon
createLiteral in interface ModelConv - the value of the literal
RDFException - generic RDF exception
public Literal createLiteral(java.lang.String v,
java.lang.String l)
throws RDFException
ModelIf v is null, then a literal with an empty string is created.
createLiteral in interface Modelv - the value of the literall - the language associated with the literal
RDFException - generic RDF exception
public Literal createLiteral(java.lang.String v,
java.lang.String l,
boolean wellFormed)
ModelIf v is null, then a literal with an empty string is created.
createLiteral in interface Modelv - the value of the literall - the language associated with the literalwellFormed - true if the Literal is well formed XML
public Literal createLiteral(java.lang.Object v)
throws RDFException
ModelCon
createLiteral in interface ModelConv - the value of the literal.
RDFException - generic RDF exception
public Statement createStatement(Resource r,
Property p,
boolean o)
throws RDFException
ModelConSubsequent 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.
createStatement in interface ModelConr - the subject of the statementp - the predicate of the statemento - is the value to be the object of the statement
RDFException - generic RDF exception
public Statement createStatement(Resource r,
Property p,
long o)
throws RDFException
ModelConSubsequent 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.
createStatement in interface ModelConr - the subject of the statementp - the predicate of the statemento - is the value to be the object of the statement
RDFException - generic RDF exception
public Statement createStatement(Resource r,
Property p,
char o)
throws RDFException
ModelConSubsequent 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.
createStatement in interface ModelConr - the subject of the statementp - the predicate of the statemento - is the value to be the object of the statement
RDFException - generic RDF exception
public Statement createStatement(Resource r,
Property p,
float o)
throws RDFException
ModelConSubsequent 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.
createStatement in interface ModelConr - the subject of the statementp - the predicate of the statemento - is the value to be the object of the statement
RDFException - generic RDF exception
public Statement createStatement(Resource r,
Property p,
double o)
throws RDFException
ModelConSubsequent 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.
createStatement in interface ModelConr - the subject of the statementp - the predicate of the statemento - is the value to be the object of the statement
RDFException - generic RDF exception
public Statement createStatement(Resource r,
Property p,
java.lang.String o)
throws RDFException
ModelConSubsequent 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.
createStatement in interface ModelConr - the subject of the statementp - the predicate of the statemento - is the value to be the object of the statement
RDFException - generic RDF exception
public Statement createStatement(Resource r,
Property p,
java.lang.Object o)
throws RDFException
ModelConSubsequent 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.
createStatement in interface ModelConr - the subject of the statementp - the predicate of the statemento - is the value to be the object of the statement
RDFException - generic RDF exception
public Statement createStatement(Resource r,
Property p,
java.lang.String o,
boolean wellFormed)
throws RDFException
ModelConSubsequent 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.
createStatement in interface ModelConr - the subject of the statementp - the predicate of the statemento - is the value to be the object of the statementwellFormed - true if the string is well formed XML
RDFException - generic RDF exception
public Statement createStatement(Resource r,
Property p,
java.lang.String o,
java.lang.String l)
throws RDFException
ModelConSubsequent 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.
createStatement in interface ModelConr - the subject of the statementp - the predicate of the statemento - is the value to be the object of the statementl - the language associated with the object
RDFException - generic RDF exception
public Statement createStatement(Resource r,
Property p,
java.lang.String o,
java.lang.String l,
boolean wellFormed)
throws RDFException
ModelConSubsequent 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.
createStatement in interface ModelConr - the subject of the statementp - the predicate of the statemento - is the value to be the object of the statementl - the language associated with the objectwellFormed - true of the string is well formed XML
RDFException - generic RDF exception
public Bag createBag()
throws RDFException
ModelConSubsequent 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.
createBag in interface ModelConRDFException - Generic RDF exception.
public Alt createAlt()
throws RDFException
ModelConSubsequent 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.
createAlt in interface ModelConRDFException - Generic RDF exception.
public Seq createSeq()
throws RDFException
ModelConSubsequent 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.
createSeq in interface ModelConRDFException - Generic RDF exception.
public Resource getResource(java.lang.String uri)
throws RDFException
ModelSubsequent 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.
getResource in interface Modeluri - the URI of the resource
RDFException - Generic RDF exception.
public Property getProperty(java.lang.String uri)
throws RDFException
ModelConSubsequent 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.
getProperty in interface ModelConuri - the URI of the property
RDFException - Generic RDF Exception
public Property getProperty(java.lang.String nameSpace,
java.lang.String localName)
throws RDFException
ModelSubsequent 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.
getProperty in interface ModelnameSpace - the RDF namespace of the propertylocalName - the localName of the property in its namespace
RDFException - Generic RDF Exception
public Bag getBag(java.lang.String uri)
throws RDFException
ModelConSubsequent 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.
getBag in interface ModelConuri - the URI of the bag.
RDFException - Generic RDF Exception
public Bag getBag(Resource r)
throws RDFException
ModelConThis 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.
getBag in interface ModelConr - an untyped Resource instance
RDFException - Generic RDF Exception
public Alt getAlt(java.lang.String uri)
throws RDFException
ModelConSubsequent 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.
getAlt in interface ModelConuri - the URI of the alt
RDFException - Generic RDF Exception
public Alt getAlt(Resource r)
throws RDFException
ModelConThis 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.
getAlt in interface ModelConr - an untyped Resource instance
RDFException - Generic RDF Exception
public Seq getSeq(java.lang.String uri)
throws RDFException
ModelConSubsequent 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.
getSeq in interface ModelConuri - the URI of the seq
RDFException - Generic RDF Exception
public Seq getSeq(Resource r)
throws RDFException
ModelConThis 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.
getSeq in interface ModelConr - an untyped Resource instance
RDFException - Generic RDF Exception
public long size()
throws RDFException
Model
size in interface ModelRDFException - Generic RDF Exception
public ResIterator listSubjects()
throws RDFException
ModelSubsequent operations on those resource may modify this model.
listSubjects in interface ModelRDFException - Generic RDF Exception
public NsIterator listNameSpaces()
throws RDFException
Model
listNameSpaces in interface ModelRDFException - Generic RDF Exception
public StmtIterator listStatements()
throws RDFException
ModelSubsequent operations on those statements may modify this model.
listStatements in interface ModelRDFException - Generic RDF Exception
public StmtIterator listReifiedStatements()
throws RDFException
ModelSubsequent operations on those statements may modify this model.
listReifiedStatements in interface ModelRDFException - Generic RDF Exception
public Model add(Statement s)
throws RDFException
Model
add in interface Models - The statement to be added.
RDFException - Generic RDF Exception
public Model remove(Statement s)
throws RDFException
ModelThe statement with the same subject, predicate and object as that supplied will be removed from the model.
remove in interface Models - The statement to be removed.
RDFException - Generic RDF Exception
public boolean contains(Statement s)
throws RDFException
Model
contains in interface Models - The statement tested.
RDFException - Generic RDF Exception
public boolean contains(Resource s,
Property p)
throws RDFException
Model
contains in interface Models - The subject sought.p - The predicate sought.
RDFException - Generic RDF Exception
public boolean contains(Resource s,
Property p,
RDFNode o)
throws RDFException
Model
contains in interface Models - The subject of the statment tested.p - The predicate of the statement tested.o - The object of the statement tested.
RDFException - Generic RDF Exception
public boolean isReified(Statement s)
throws RDFException
Model
isReified in interface Models - The statement tested.
RDFException - Generic RDF Exception
public Statement getProperty(Resource s,
Property p)
throws RDFException
ModelIf more than one statement witht the given subject and property exists in the model, it is undefined which will be returned.
getProperty in interface Models - The subject of the statement to be returned.p - The property of the statement to be returned.
RDFException - Generic RDF Exception
public ResIterator listSubjectsWithProperty(Property p)
throws RDFException
Model
listSubjectsWithProperty in interface Modelp - the property sought.
RDFException - Generic RDF Exception
public ResIterator listSubjectsWithProperty(Property p,
RDFNode o)
throws RDFException
Model
listSubjectsWithProperty in interface Modelp - The predicate soughto - The value sought
RDFException - Generic RDF Exception
public NodeIterator listObjects()
throws RDFException
Model
listObjects in interface ModelRDFException - Generic RDF Exception
public NodeIterator listObjectsOfProperty(Property p)
throws RDFException
Model
listObjectsOfProperty in interface Modelp - The predicate sought
RDFException - Generic RDF Exception
public NodeIterator listObjectsOfProperty(Resource s,
Property p)
throws RDFException
Model
listObjectsOfProperty in interface Modelp - The predicate sought
RDFException - Generic RDF Exception
public StmtIterator listStatements(Selector selector)
throws RDFException
ModelA statment is considered to match if the test method
of s returns true when called on s.
listStatements in interface Modelselector - A selector object.
RDFException - Generic RDF exception.
public Model begin()
throws RDFException
ModelAll changes made to a model within a transaction, will either be made, or none of them will be made.
begin in interface ModelRDFException - Generic RDF Exception
public Model abort()
throws RDFException
Model
abort in interface ModelRDFException - Generic RDF Exception
public Model commit()
throws RDFException
Model
commit in interface ModelRDFException - Generic RDF Exceptionpublic boolean independent()
ModelFor 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.
independent in interface Model
public Resource createResource()
throws RDFException
ModelSubsequent operations on the returned resource may modify this model.
createResource in interface ModelRDFException - Generic RDF exception.
public Resource createResource(java.lang.String uri)
throws RDFException
ModelSubsequent operations on the returned resource may modify this model.
createResource in interface Modeluri - the URI of the resource to be created
RDFException - Generic RDF exception.
public Property createProperty(java.lang.String uri)
throws RDFException
ModelConSubsequent operations on the returned property may modify this model.
createProperty in interface ModelConuri - the URI of the property
RDFException - Generic RDF exception
public Property createProperty(java.lang.String nameSpace,
java.lang.String localName)
throws RDFException
ModelSubsequent operations on the returned property may modify this model.
createProperty in interface ModelnameSpace - the nameSpace of the propertylocalName - the name of the property within its namespace
RDFException - Generic RDF exception
public Statement createStatement(Resource r,
Property p,
RDFNode o)
throws RDFException
ModelSubsequent 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.
createStatement in interface Modelr - the subject of the statementp - the predicate of the statemento - the object of the statement
RDFException - generic RDF exception
public Bag createBag(java.lang.String uri)
throws RDFException
ModelConSubsequent 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.
createBag in interface ModelConuri - The URI of the new Bag.
RDFException - Generic RDF exception.
public Alt createAlt(java.lang.String uri)
throws RDFException
ModelConSubsequent 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.
createAlt in interface ModelConuri - The URI of the new alt.
RDFException - Generic RDF exception.
public Seq createSeq(java.lang.String uri)
throws RDFException
ModelConSubsequent 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.
createSeq in interface ModelConuri - The URI of the new seq.
RDFException - Generic RDF exception.
public NodeIterator listContainerMembers(Container cont,
NodeIteratorFactory f)
throws RDFException
listContainerMembers in interface ModelIcont - f -
RDFException
public int containerSize(Container cont)
throws RDFException
containerSize in interface ModelIcont -
RDFException
public int containerIndexOf(Container cont,
RDFNode n)
throws RDFException
containerIndexOf in interface ModelIcont - n -
RDFException
public boolean containerContains(Container cont,
RDFNode n)
throws RDFException
containerContains in interface ModelIcont - n -
RDFException
public Resource convert(Resource r)
throws RDFException
convert in interface ModelIr -
RDFException
public Property convert(Property p)
throws RDFException
convert in interface ModelIp -
RDFException
public RDFNode convert(RDFNode n)
throws RDFException
convert in interface ModelIn -
RDFExceptionpublic boolean equals(java.lang.Object model)
ModelTwo 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.
equals in interface Modelequals in class java.lang.Objectmodel - the model to be compared
public void close()
ModelNot 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.
close in interface Model
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||