org.daml.rdf.jena.mem
Class SourceModelMem

java.lang.Object
  |
  +--com.hp.hpl.mesa.rdf.jena.common.ModelCom
        |
        +--com.hp.hpl.mesa.rdf.jena.mem.ModelMem
              |
              +--org.daml.rdf.jena.mem.SourceModelMem
All Implemented Interfaces:
com.hp.hpl.mesa.rdf.jena.model.Model, com.hp.hpl.mesa.rdf.jena.model.ModelCon, com.hp.hpl.mesa.rdf.jena.common.ModelI, com.hp.hpl.mesa.rdf.jena.model.RDFReaderF, com.hp.hpl.mesa.rdf.jena.model.RDFWriterF, SourceModel
Direct Known Subclasses:
DynamicSourceModelMem

public class SourceModelMem
extends com.hp.hpl.mesa.rdf.jena.mem.ModelMem
implements SourceModel, com.hp.hpl.mesa.rdf.jena.common.ModelI

An implementation of a RDF Model that keeps statements grouped by source.


Field Summary
 
Fields inherited from class com.hp.hpl.mesa.rdf.jena.common.ModelCom
readerFactory, store, writerFactory
 
Constructor Summary
SourceModelMem()
           
SourceModelMem(Source source)
           
 
Method Summary
 com.hp.hpl.mesa.rdf.jena.model.Model add(com.hp.hpl.mesa.rdf.jena.model.Model m, Source source)
          Add all the statements in another model to this model and associate with a source.
 com.hp.hpl.mesa.rdf.jena.model.Model add(SourceModel m)
          Add all the statements in a SourceModel to this model.
 com.hp.hpl.mesa.rdf.jena.model.Model add(com.hp.hpl.mesa.rdf.jena.model.Statement s, Source source)
          Add a statement to this model and associate with a source.
 com.hp.hpl.mesa.rdf.jena.model.Model add(com.hp.hpl.mesa.rdf.jena.model.StmtIterator iter, Source source)
          Add all the statements in an interator to this model and associate with a source.
 com.hp.hpl.mesa.rdf.jena.model.Resource createResource(java.lang.String uri)
           
 Source createSource(java.lang.String uri)
          Create a new source object from a URI.
 Source getDefaultSource()
          Get the default source that will be assigned to any new statements added to the model.
 com.hp.hpl.mesa.rdf.jena.model.Model getModelForSource(Source source)
          Return a model that contains all the statements associated with a source.
 Source getSource(com.hp.hpl.mesa.rdf.jena.model.Statement s)
          Get the source for a statement.
 java.util.Iterator listSources()
          List all sources with statements in the model.
 com.hp.hpl.mesa.rdf.jena.model.StmtIterator listStatementsOfSource(Source source)
          Return an iterator over all the statements associated with a source.
 com.hp.hpl.mesa.rdf.jena.model.Model read(java.io.Reader reader, java.lang.String base, Source source)
          Read RDF from a reader into the model.
 com.hp.hpl.mesa.rdf.jena.model.Model read(java.io.Reader reader, java.lang.String base, java.lang.String lang, Source source)
          Read RDF from a reader into the model.
 com.hp.hpl.mesa.rdf.jena.model.Model read(java.lang.String url)
          Read a URL into the model.
 com.hp.hpl.mesa.rdf.jena.model.Model read(java.lang.String url, java.lang.String lang)
          Read a URL into the model.
 Source setDefaultSource(Source source)
          Set the default source for any new statements that are added to the model.
 com.hp.hpl.mesa.rdf.jena.model.Model setSource(com.hp.hpl.mesa.rdf.jena.model.Statement s, Source source)
          Change the source associated with a statement.
 com.hp.hpl.mesa.rdf.jena.model.Model setSource(com.hp.hpl.mesa.rdf.jena.model.StmtIterator iter, Source source)
          Change the source associated with the statements in the iterator.
 com.hp.hpl.mesa.rdf.jena.model.Model write(java.io.Writer writer, Source source)
          Write the model of statements associated with a source to an XML file.
 com.hp.hpl.mesa.rdf.jena.model.Model write(java.io.Writer writer, java.lang.String lang, Source source)
          Write out to a file just the statements associated with a source.
 com.hp.hpl.mesa.rdf.jena.model.Model write(java.io.Writer writer, java.lang.String lang, java.lang.String base, Source source)
          Write out to a file just the statements associated with a source.
 
Methods inherited from class com.hp.hpl.mesa.rdf.jena.mem.ModelMem
difference, intersection, query, supportsSetOperations, supportsTransactions, union
 
Methods inherited from class com.hp.hpl.mesa.rdf.jena.common.ModelCom
abort, add, add, add, add, add, add, add, add, add, add, add, add, add, add, begin, close, commit, containerContains, containerIndexOf, containerSize, contains, contains, contains, contains, contains, contains, contains, contains, contains, contains, contains, containsAll, containsAll, containsAny, containsAny, convert, convert, convert, createAlt, createAlt, createBag, createBag, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createProperty, createProperty, createResource, createResource, createResource, createResource, createResource, createSeq, createSeq, createStatement, createStatement, createStatement, createStatement, createStatement, createStatement, createStatement, createStatement, createStatement, createStatement, createStatement, equals, getAlt, getAlt, getBag, getBag, getProperty, getProperty, getProperty, getReader, getReader, getResource, getResource, getSeq, getSeq, getWriter, getWriter, independent, isReified, listContainerMembers, listNameSpaces, listObjects, listObjectsOfProperty, listObjectsOfProperty, listReifiedStatements, listStatements, listStatements, listStatements, listSubjects, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, read, read, remove, remove, remove, setReaderClassName, setWriterClassName, size, write, write, write
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.hp.hpl.mesa.rdf.jena.model.Model
abort, add, add, add, begin, close, commit, contains, contains, contains, containsAll, containsAll, containsAny, containsAny, createLiteral, createLiteral, createProperty, createResource, createStatement, difference, equals, getProperty, getProperty, getResource, independent, intersection, isReified, listNameSpaces, listObjects, listObjectsOfProperty, listObjectsOfProperty, listReifiedStatements, listStatements, listStatements, listSubjects, listSubjectsWithProperty, listSubjectsWithProperty, query, read, read, remove, size, supportsSetOperations, supportsTransactions, union, write, write, write
 
Methods inherited from interface com.hp.hpl.mesa.rdf.jena.model.ModelCon
add, add, add, add, add, add, add, add, add, add, add, contains, contains, contains, contains, contains, contains, contains, contains, createAlt, createAlt, createBag, createBag, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createLiteral, createProperty, createResource, createResource, createResource, createResource, createSeq, createSeq, createStatement, createStatement, createStatement, createStatement, createStatement, createStatement, createStatement, createStatement, createStatement, createStatement, getAlt, getAlt, getBag, getBag, getProperty, getResource, getSeq, getSeq, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, remove, remove
 
Methods inherited from interface com.hp.hpl.mesa.rdf.jena.model.RDFReaderF
getReader, getReader, setReaderClassName
 
Methods inherited from interface com.hp.hpl.mesa.rdf.jena.model.RDFWriterF
getWriter, getWriter, setWriterClassName
 
Methods inherited from interface com.hp.hpl.mesa.rdf.jena.common.ModelI
containerContains, containerIndexOf, containerSize, convert, convert, convert, listContainerMembers
 

Constructor Detail

SourceModelMem

public SourceModelMem()

SourceModelMem

public SourceModelMem(Source source)
Method Detail

add

public com.hp.hpl.mesa.rdf.jena.model.Model add(SourceModel m)
                                         throws com.hp.hpl.mesa.rdf.jena.model.RDFException
Add all the statements in a SourceModel to this model. The Sources of each statement remain the same.

Specified by:
add in interface SourceModel
com.hp.hpl.mesa.rdf.jena.model.RDFException

add

public com.hp.hpl.mesa.rdf.jena.model.Model add(com.hp.hpl.mesa.rdf.jena.model.Model m,
                                                Source source)
                                         throws com.hp.hpl.mesa.rdf.jena.model.RDFException
Add all the statements in another model to this model and associate with a source.

Specified by:
add in interface SourceModel
com.hp.hpl.mesa.rdf.jena.model.RDFException

add

public com.hp.hpl.mesa.rdf.jena.model.Model add(com.hp.hpl.mesa.rdf.jena.model.Statement s,
                                                Source source)
                                         throws com.hp.hpl.mesa.rdf.jena.model.RDFException
Add a statement to this model and associate with a source.

Specified by:
add in interface SourceModel
com.hp.hpl.mesa.rdf.jena.model.RDFException

add

public com.hp.hpl.mesa.rdf.jena.model.Model add(com.hp.hpl.mesa.rdf.jena.model.StmtIterator iter,
                                                Source source)
                                         throws com.hp.hpl.mesa.rdf.jena.model.RDFException
Add all the statements in an interator to this model and associate with a source.

Specified by:
add in interface SourceModel
com.hp.hpl.mesa.rdf.jena.model.RDFException

listSources

public java.util.Iterator listSources()
List all sources with statements in the model.

Specified by:
listSources in interface SourceModel

listStatementsOfSource

public com.hp.hpl.mesa.rdf.jena.model.StmtIterator listStatementsOfSource(Source source)
Return an iterator over all the statements associated with a source.

Specified by:
listStatementsOfSource in interface SourceModel

getModelForSource

public com.hp.hpl.mesa.rdf.jena.model.Model getModelForSource(Source source)
                                                       throws com.hp.hpl.mesa.rdf.jena.model.RDFException
Return a model that contains all the statements associated with a source. TBD - Allow user to specify what type of model to return.

Specified by:
getModelForSource in interface SourceModel
com.hp.hpl.mesa.rdf.jena.model.RDFException

getSource

public Source getSource(com.hp.hpl.mesa.rdf.jena.model.Statement s)
Get the source for a statement.

Specified by:
getSource in interface SourceModel

setSource

public com.hp.hpl.mesa.rdf.jena.model.Model setSource(com.hp.hpl.mesa.rdf.jena.model.Statement s,
                                                      Source source)
Change the source associated with a statement.

Specified by:
setSource in interface SourceModel

setSource

public com.hp.hpl.mesa.rdf.jena.model.Model setSource(com.hp.hpl.mesa.rdf.jena.model.StmtIterator iter,
                                                      Source source)
                                               throws com.hp.hpl.mesa.rdf.jena.model.RDFException
Change the source associated with the statements in the iterator.

Specified by:
setSource in interface SourceModel
com.hp.hpl.mesa.rdf.jena.model.RDFException

write

public com.hp.hpl.mesa.rdf.jena.model.Model write(java.io.Writer writer,
                                                  Source source)
                                           throws com.hp.hpl.mesa.rdf.jena.model.RDFException
Write the model of statements associated with a source to an XML file.

Specified by:
write in interface SourceModel
com.hp.hpl.mesa.rdf.jena.model.RDFException

write

public com.hp.hpl.mesa.rdf.jena.model.Model write(java.io.Writer writer,
                                                  java.lang.String lang,
                                                  Source source)
                                           throws com.hp.hpl.mesa.rdf.jena.model.RDFException
Description copied from interface: SourceModel
Write out to a file just the statements associated with a source. The source information is not stored with the statements in the output.

Specified by:
write in interface SourceModel
com.hp.hpl.mesa.rdf.jena.model.RDFException

write

public com.hp.hpl.mesa.rdf.jena.model.Model write(java.io.Writer writer,
                                                  java.lang.String lang,
                                                  java.lang.String base,
                                                  Source source)
                                           throws com.hp.hpl.mesa.rdf.jena.model.RDFException
Description copied from interface: SourceModel
Write out to a file just the statements associated with a source. The source information is not stored with the statements in the output.

Specified by:
write in interface SourceModel
com.hp.hpl.mesa.rdf.jena.model.RDFException

read

public com.hp.hpl.mesa.rdf.jena.model.Model read(java.lang.String url)
                                          throws com.hp.hpl.mesa.rdf.jena.model.RDFException
Read a URL into the model. The Source for the statements will be the url.

Specified by:
read in interface com.hp.hpl.mesa.rdf.jena.model.Model
Overrides:
read in class com.hp.hpl.mesa.rdf.jena.common.ModelCom
com.hp.hpl.mesa.rdf.jena.model.RDFException

read

public com.hp.hpl.mesa.rdf.jena.model.Model read(java.io.Reader reader,
                                                 java.lang.String base,
                                                 Source source)
                                          throws com.hp.hpl.mesa.rdf.jena.model.RDFException
Read RDF from a reader into the model. The Source for the statements will be the base uri.

Specified by:
read in interface SourceModel
com.hp.hpl.mesa.rdf.jena.model.RDFException

read

public com.hp.hpl.mesa.rdf.jena.model.Model read(java.lang.String url,
                                                 java.lang.String lang)
                                          throws com.hp.hpl.mesa.rdf.jena.model.RDFException
Read a URL into the model. The Source for the statements will be the url.

Specified by:
read in interface com.hp.hpl.mesa.rdf.jena.model.Model
Overrides:
read in class com.hp.hpl.mesa.rdf.jena.common.ModelCom
com.hp.hpl.mesa.rdf.jena.model.RDFException

read

public com.hp.hpl.mesa.rdf.jena.model.Model read(java.io.Reader reader,
                                                 java.lang.String base,
                                                 java.lang.String lang,
                                                 Source source)
                                          throws com.hp.hpl.mesa.rdf.jena.model.RDFException
Read RDF from a reader into the model. The Source for the statements will be the base uri.

Specified by:
read in interface SourceModel
com.hp.hpl.mesa.rdf.jena.model.RDFException

createResource

public com.hp.hpl.mesa.rdf.jena.model.Resource createResource(java.lang.String uri)
                                                       throws com.hp.hpl.mesa.rdf.jena.model.RDFException
Specified by:
createResource in interface com.hp.hpl.mesa.rdf.jena.model.Model
Overrides:
createResource in class com.hp.hpl.mesa.rdf.jena.common.ModelCom
com.hp.hpl.mesa.rdf.jena.model.RDFException

setDefaultSource

public Source setDefaultSource(Source source)
Description copied from interface: SourceModel
Set the default source for any new statements that are added to the model.

Specified by:
setDefaultSource in interface SourceModel

getDefaultSource

public Source getDefaultSource()
Description copied from interface: SourceModel
Get the default source that will be assigned to any new statements added to the model.

Specified by:
getDefaultSource in interface SourceModel

createSource

public Source createSource(java.lang.String uri)
Description copied from interface: SourceModel
Create a new source object from a URI.

Specified by:
createSource in interface SourceModel