SourceModel and DynamicModel Extensions to Jena-1.6.1Home | About DAML | Announcements | Roadmap | Site Search
This code contains two extensions the the Jena 1.6.1 API ModelMem class.
SourceModel - Keeps track of source information for statements in the model. Each statement can be assigned a Source when it is read from a file or when a new statement is created. The underlying Store keeps track of the association between a statement and a Source. The Statement object has not be modified. The model supports listing all Sources, listing statements of a Source, and writing all statements of a single source to an output file. This makes it easier to work with multiple source files in one model and then write them back out to the individual files.
DynamicModel - Provides a mechanism to dynamically load referenced namespaces on an as needed basis. When the properties of a Resource are accessed the model checks to see if the namespace of the resource has been loaded into the model. If not the namespace is loaded before the accessor method returns. This model makes the assumption that the namespace of a resource is the URL of the file that defines the resource. Please be careful when using StmtIterators on a DynamicModel because a dynamic load modifes the model supporting the iterator which causes an error.
The code implements the following two models:
You will also need to install the Jena API.