org.openrdf.sesame.sailimpl.nativerdf
Class NamespaceStore
java.lang.Object
org.openrdf.sesame.sailimpl.nativerdf.NamespaceStore
- public class NamespaceStore
- extends Object
An in-memory store for namespace information that uses a file for persistence.
Namespaces are encoded in the file as records as follows:
byte 1 - 3 : internal namespace ID
byte 4 : reserved byte for storing some boolean properties
byte 5 - 6 : the length of the encoded namespace prefix
byte 7 - A : the UTF-8 encoded namespace prefix
byte A+1 - A+2 : the length of the encoded namespace name
byte A+3 - end : the UTF-8 encoded namespace name
- Version:
- $Revision: 1.9.4.3 $
- Author:
- Arjohn Kampman
NamespaceStore
public NamespaceStore(File dataDir)
throws IOException
getID
public int getID(String namespace)
getID
public int getID(String namespace,
boolean dirtyReads)
getNamespace
public org.openrdf.sesame.sailimpl.nativerdf.Namespace getNamespace(int id)
getNamespace
public org.openrdf.sesame.sailimpl.nativerdf.Namespace getNamespace(int id,
boolean dirtyReads)
getNamespaceName
public String getNamespaceName(int id)
getNamespaceName
public String getNamespaceName(int id,
boolean dirtyReads)
getNamespaces
public NamespaceIterator getNamespaces()
startTransaction
public void startTransaction()
commitTransaction
public void commitTransaction()
throws IOException
- Throws:
IOException
rollbackTransaction
public void rollbackTransaction()
close
public void close()
clear
public void clear()
storeNamespace
public int storeNamespace(String namespace)
setNamespacePrefix
public void setNamespacePrefix(String prefix,
String name)
main
public static void main(String[] args)
throws Exception
- Throws:
Exception
Copyright © 2002-2006 Aduna BV, GNU LGPL License applies.