com.hp.hpl.mesa.rdf.jena.mem
Class ModelMem

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

public class ModelMem
extends ModelCom
implements Model, ModelI

A main memory implemention of the RDF API.

This implementation of the RDF API stores its all its data in main memory. It supports all methods except the transaction calls.

This is a prototype implementation, and should be considered to be alpha quality code. It has not yet been performance optimised and is known to be wasteful of memory. It has been tested by loading the wordnet database (see Sample3) which results in a model containing over 600,000 statements.

Version:
Release='$Name: $' Revision='$Revision: 1.7 $' Date='$Date: 2001/09/23 13:51:18 $'
Author:
bwm

Constructor Summary
ModelMem()
          Create an empty model.
 
Method Summary
 Model difference(Model model)
          Create a new model containing all the statements in this model which are not in another.
 Model intersection(Model model)
          Create a new model containing all the statements which are in both this model and another.
 Model query(Selector selector)
          Create a new model containing the statements matching a query.
 boolean supportsSetOperations()
          Determine whether this model supports set operations.
 boolean supportsTransactions()
          Determine whether this model supports transactions.
 Model union(Model model)
          Create a new model containing all the statements in this model together with all of those in another given model.
 
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, 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, listSubjects, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, listSubjectsWithProperty, read, read, read, read, remove, remove, remove, setReaderClassName, setWriterClassName, size, write, write, write
 
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
abort, add, add, add, begin, close, commit, contains, contains, contains, containsAll, containsAll, containsAny, containsAny, createLiteral, createLiteral, createProperty, createResource, createResource, createStatement, equals, getProperty, getProperty, getResource, independent, isReified, listNameSpaces, listObjects, listObjectsOfProperty, listObjectsOfProperty, listReifiedStatements, listStatements, listStatements, listSubjects, listSubjectsWithProperty, listSubjectsWithProperty, read, read, read, read, remove, size, 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

ModelMem

public ModelMem()
Create an empty model.
Method Detail

supportsTransactions

public boolean supportsTransactions()
Description copied from interface: Model
Determine whether this model supports transactions.
Specified by:
supportsTransactions in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Returns:
true if this model supports transactions.

supportsSetOperations

public boolean supportsSetOperations()
Description copied from interface: Model
Determine whether this model supports set operations.
Specified by:
supportsSetOperations in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Returns:
true if this model supports set operations.

query

public Model query(Selector selector)
            throws RDFException
Description copied from interface: Model
Create a new model containing the statements matching a query.

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

Specified by:
query 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.

union

public Model union(Model model)
            throws RDFException
Description copied from interface: Model
Create a new model containing all the statements in this model together with all of those in another given model.
Specified by:
union in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Parameters:
model - The other model whose statements are to be included.
Returns:
A new model containing all the statements that are in either model
Throws:
RDFException - Generic RDF Exception

intersection

public Model intersection(Model model)
                   throws RDFException
Description copied from interface: Model
Create a new model containing all the statements which are in both this model and another. As models are sets of statements, a statement contained in both models will only appear once in the resulting model.
Specified by:
intersection in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Parameters:
model - The other model.
Returns:
A new model containing all the statements that are in both models.
Throws:
RDFException - Generic RDF Exception

difference

public Model difference(Model model)
                 throws RDFException
Description copied from interface: Model
Create a new model containing all the statements in this model which are not in another.
Specified by:
difference in interface Model
Following copied from interface: com.hp.hpl.mesa.rdf.jena.model.Model
Parameters:
model - the other model whose statements are to be excluded.
Returns:
a new model containing all the statements in this model that are not in the given model.
Throws:
RDFException - Generic RDF Exception


Copyright © 2001 Hewlett-Packard. All Rights Reserved.