| com.hp.hpl.jena.mem.faster.GraphMemFaster com.hp.hpl.jena.graph.impl.FileGraph
All known Subclasses: com.hp.hpl.jena.graph.impl.FileGraphMaker,
FileGraph | public class FileGraph extends GraphMemFaster (Code) | | A FileGraph is a memory-based graph that is optionally read in from a file
when it is created, and is written back when it is closed. It supports
(weak) transactions by using checkpoint files.
author: hedgehog |
Inner Class :public interface NotifyOnClose | |
Field Summary | |
final public String | lang The language used to read and write the graph, guessed from the filename's
suffix. | final protected Model | model A model used to wrap the graph for the IO operations (since these are not
yet available at the graph level). | final public File | name | final protected NotifyOnClose | notify | protected TransactionHandler | th |
Constructor Summary | |
public | FileGraph(File f, boolean create, boolean strict) See FileGraph( f, create, strict, Reifier.ReificationStyle ). | public | FileGraph(NotifyOnClose notify, File f, boolean create, boolean strict, ReificationStyle style) Construct a new FileGraph who's name is given by the specified File,
If create is true, this is a new file, and any existing file will be destroyed;
if create is false, this is an existing file, and its current contents will
be loaded. | public | FileGraph(NotifyOnClose notify, File f, String lang, boolean create, boolean strict, ReificationStyle style) Construct a new FileGraph who's name is given by the specified File,
If create is true, this is a new file, and any existing file will be destroyed;
if create is false, this is an existing file, and its current contents will
be loaded. | public | FileGraph(String s, boolean create) As for FileGraph(File,boolean), except the name is given as a String. |
lang | final public String lang(Code) | | The language used to read and write the graph, guessed from the filename's
suffix.
|
model | final protected Model model(Code) | | A model used to wrap the graph for the IO operations (since these are not
yet available at the graph level).
|
name | final public File name(Code) | | The File-name of this graph, used to name it in the filing system
|
notify | final protected NotifyOnClose notify(Code) | | |
FileGraph | public FileGraph(File f, boolean create, boolean strict)(Code) | | See FileGraph( f, create, strict, Reifier.ReificationStyle ).
|
FileGraph | public FileGraph(NotifyOnClose notify, File f, boolean create, boolean strict, ReificationStyle style)(Code) | | Construct a new FileGraph who's name is given by the specified File,
If create is true, this is a new file, and any existing file will be destroyed;
if create is false, this is an existing file, and its current contents will
be loaded. The language code for the file is guessed from its suffix.
Parameters: f - the File naming the associated file-system file Parameters: create - true to create a new one, false to read an existing one Parameters: strict - true to throw exceptions for create: existing, open: not found Parameters: style - the reification style for the graph |
FileGraph | public FileGraph(NotifyOnClose notify, File f, String lang, boolean create, boolean strict, ReificationStyle style)(Code) | | Construct a new FileGraph who's name is given by the specified File,
If create is true, this is a new file, and any existing file will be destroyed;
if create is false, this is an existing file, and its current contents will
be loaded. The language code for the file is supplied.
Parameters: f - the File naming the associated file-system file Parameters: lang - the language string for the file Parameters: create - true to create a new one, false to read an existing one Parameters: strict - true to throw exceptions for create: existing, open: not found Parameters: style - the reification style for the graph |
FileGraph | public FileGraph(String s, boolean create)(Code) | | As for FileGraph(File,boolean), except the name is given as a String.
|
close | public void close()(Code) | | Write out and then close this FileGraph.
|
delete | public void delete()(Code) | | Delete the backing file. Primarily intended for test cleanup.
|
isPlausibleGraphName | public static boolean isPlausibleGraphName(String name)(Code) | | Answer true iff the filename string given is plausibly the name of a
graph, ie, may have RDF content. We appeal to FileUtils - if it can
guess an RDF language name, we deliver true, otherwise false.
Parameters: name - the leaf component of a filename true if it is likely to be an RDF file |
readModel | protected void readModel(Model m, boolean strict)(Code) | | |
readModelFrom | protected void readModelFrom(Model m, boolean strict, File name)(Code) | | |
saveContents | protected void saveContents(File targetName)(Code) | | The graph is written out to the
named file in the language guessed from the suffix, and then the
parent close is invoked. The write-out goes to an intermediate file
first, which is then renamed to the correct name, to try and ensure
that the output is either done completely or not at all.
|
updateFrom | protected void updateFrom(File targetName, File intermediate)(Code) | | The file intermediate has the new file contents. We want to move
them to the current file. renameTo doesn't have a powerful enough
semantics, so we anticipate failure and attempt to bypass it ...
If the rename works, that's fine. If it fails, we delete the old file if it
exists, and try again.
|
|
|