Provides an in-memory implementation of the {@link com.ibm.team.jfs.app.rdf RDF API}. In particular the {@link com.ibm.team.jfs.app.rdf.IGraphStore store} implementation can persist graphs to disk but does not index them in any way.
rdf
Package ContainsWhen the in-memory store is committed to disk it creates a standard Zip file with one entry per graph. For named graphs the name of the graph is the name of the entry in the zip file, otherwise names are constructed using two leading underscores and an integer value. Each graph is stored in a standard NTriples format.
$ unzip -l rdf-store.zip Archive: rdf-store.zip Length Date Time Name -------- ---- ---- ---- 201 11-18-08 10:37 __1 201 11-18-08 10:37 __2 201 11-18-08 10:37 http://people.org/david -------- ------- 603 3 files
The following example demonstrates how the in-memory store can be used to load a set of graphs from disk, add graphs and then store the resulting set back to disk.
GraphStore store = new GraphStore(); Properties config = newnew Graph(); URI subject = new URI("http://example.org/things/thing/simon"); graph.add(new Statement(new URINode(subject), new URINode(new URI("http://example.org/properties/name")), new LiteralNode("Simon"))); graph.addStatement(new Statement(new URINode(subject), new URINode(new URI("http://example.org/properties/project")), new LiteralNode("Jazz Foundation"))); store.add(graph); graph = new Graph(); subject = new URI("http://example.org/things/thing/james"); graph.add(new Statement(new URINode(subject), new URINode(new URI("http://example.org/properties/name")), new LiteralNode("James"))); graph.add(new Statement(new URINode(subject), new URINode(new URI("http://example.org/properties/project")), new LiteralNode("Jazz Foundation"))); store.add(graph); graph = new NamedGraph(new URI("http://people.org/david")); subject = new URI("http://example.org/things/thing/david"); graph.add(new Statement(new URINode(subject), new URINode(new URI("http://example.org/properties/name")), new LiteralNode("David"))); graph.add(new Statement(new URINode(subject), new URINode(new URI("http://example.org/properties/project")), new LiteralNode("Jazz Foundation"))); store.add(graph); store.commit(); store.disconnect();
@since 0.1