\name{readRDF}
\alias{readRDF}
\alias{restoreBDB}
\title{read an RDF document identified by URI (or deserialize a
redland Berkeley DB representation)
 into a librdf model object  }
\description{read an RDF document identified by URI  (or
deserialize a redland Berkeley DB representation)
 into a librdf model object
}
\usage{
readRDF(uri, storageType=c("internal", "bdb")[1], storageName="test", world=..GredlWorld, stoHash=NULL)
restoreBDB(storageName, world=..GredlWorld, stoHash="hash-type='bdb',dir='.'")
}
\arguments{
  \item{uri}{ a redlURI instance, or a string encoding a URI}
  \item{storageType}{ character string, with value "internal" or "bdb"}
  \item{storageName}{ basename of file to store the hashes, if \code{storageType}
is "bdb"}
  \item{world}{ librdf world (\code{redlWorld} class instance)}
  \item{stoHash}{ a librdf hash specification of parameters to the
new storage request; non-default values
for advanced users only. }
}
\details{
}
\value{
}
\references{  }
\author{Vince Carey <stvjc@channing.harvard.edu>}
\note{  }


\seealso{  }

\examples{
# use character string URI 
ii = readRDF(paste("file:", system.file("RDF/gopart.rdf", package="Rredland"),
	sep=""))
ii
freeRedl(ii)
	# make a URI for a fragment from GO distributed with the package
example(makeRedlURI)
	# read from it with defaults
mm = readRDF(uu)
mm
	# excerpt after transformation to data.frame
as(mm, "data.frame")[1:3,]
	# now we will do some disk operations with BDB
curd = getwd()
tt = tempdir()
	# change dir
setwd(tt)
	# read contents of previous URI, but use external storage
hh = readRDF(uu, storageType="bdb", storageName="gopart")
	# see the created files; note that they are not
	# populated until the storage/model is freed
dir()
	# free the model, so the BDB hashes are populated
freeRedl(hh)
hh
	# now restore the hashes and create a redlModel
ff = restoreBDB("gopart")
ff
	# cleanup
unlink("gopart-so2p.db")
unlink("gopart-po2s.db")
unlink("gopart-sp2o.db")
setwd(curd)
cat(paste("to clean up completely, execute unlink(\"",
	tt,"\", recursive=TRUE) in R, if it looks safe to do so.\n", sep=""))
}
\keyword{ models }