Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX


Sesame 3.0 Preview: An Open Source Framework for RDF Data : Page 2

Sesame is an open source framework for storing, inferencing, and querying of RDF data. The first preview release of the upcoming 3.0 version is now available.



The Sesame Server and Console have changed the way they manage repository configurations. Previously, in 2.x, the configurations were hidden in a proprietary format that you needed to modify through a Java API. In 3.0, the Java API still exists, but the configurations are stored in RDF files under the configurations directory and you can modify them with any text editor. This makes setting up complicated repositories easier. The Console also continues to support configuration templates with the create command. These templates are stored in RDF under the templates directory. Templates allow you to reuse common configurations and the Console prompts you for simple configuration settings, such as repository id, description, and other known properties. The location of these directories is set using the -d option of the Console or Server.

The following code represents an in-memory RDF store configuration (or template):

@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>. @prefix rep: <http://www.openrdf.org/config/repository#>. @prefix sr: <http://www.openrdf.org/config/repository/sail#>. @prefix sail: <http://www.openrdf.org/config/sail#>. @prefix ms: <http://www.openrdf.org/config/sail/memory#>. [] a rep:Repository ; rep:repositoryTitle "Memory store" ; rep:repositoryImpl [ rep:repositoryType "openrdf:SailRepository" ; sr:sailImpl [ sail:sailType "openrdf:MemoryStore" ; ms:persist true ; ms:syncDelay 0 ] ].

The following code is a memory RDF store wrapped in a RDFS inferencer and a dataset sail that auto-loads any query-referenced datasets (memory-rdfs-dataset.ttl):

@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>. @prefix rep: <http://www.openrdf.org/config/repository#>. @prefix sr: <http://www.openrdf.org/config/repository/sail#>. @prefix sail: <http://www.openrdf.org/config/sail#>. @prefix ms: <http://www.openrdf.org/config/sail/memory#>. [] a rep:Repository ; rep:repositoryTitle "Memory Dataset store" ; rep:repositoryImpl [ rep:repositoryType "openrdf:SailRepository" ; sr:sailImpl [ sail:sailType "openrdf:DatasetSail" ; sail:delegate [ sail:sailType "openrdf:ForwardChainingRDFSInferencer" ; sail:delegate [ sail:sailType "openrdf:MemoryStore" ; ms:persist true ; ms:syncDelay 0 ] ] ] ].


The Sesame Workbench is no longer packaged with Sesame. However, much of the functionality provided by the Workbench is available through the Sesame Server and Console. When the Sesame Server is launched with the -u option (resolve URLs to URI descriptions), the server acts as an RDF resource resolver for URLs that resolve to it. Furthermore, it sorts the RDF triples in the result, to provide a more comprehensive view (you can control the order of the triples by listing the desired order in META-INF/org.openrdf.model.order-predicates). You can use this, combined with the new support for RDFa, to turn an HTML browser into an RDF browser. RDFa is a new standard that allows RDF attributes to embed into XHTML content. Using this standard with an RDF server, the traditional lines between an RDF browser and an HTML browser start to blur, as both an RDF client and an HTML client can use the response. By using predicates like <http://www.w3.org/1999/xhtml#title> and <http://www.w3.org/1999/xhtml/vocab#stylesheet> that are understood by HTML clients, you can improve the raw RDFa result in a visually appealing format.

The Sesame Server and protocol was revamped to support transactions; now, a remote repository behaves the same as a local repository. This allows applications to develop using an embedded RDF store and later move to a remote RDF store, while keeping the same behavior. The protocol was also extended to support server-side prepared queries. Large queries that are executed multiple times within a connection can be stored on the server and parsed only once reducing evaluation overhead.

The Sesame Server was extended to support weak consistency when the -c option (number of seconds clients can use their cache before validating) is given a value greater then zero. This allows clients to store results from the server for a period of time before validating the value on the server, and is appropriate when speed is more important than seeing the effects of all write operations. This enables RDF stores to scale much higher by enabling intermediate proxies to cache the results. The Sesame HTTP repository uses weak consistency (if enabled) when running in auto-commit mode for sizeMatch and hasMatch results. By using an intermediate proxy between the client and server, you can cache other results such as match and query evaluation.


The Federation SAIL is a new feature that allows you to unify multiple Sesame Repositories as a single Repository. The Federation supports writing to one member and does not fully support transactions across members. You can find sample federation configurations on the Aduna Open Source web site.

The Federation SAIL uses the new sizeMatch method of the RepositoryConnection for query optimizations. This causes noticeable delays when evaluating queries over large repositories. Changing the members to use weak consistency can help, but does not effect the time it takes to optimize new queries with new basic graph patterns. However, the Federation does have a few configuration options that can improve the query performance. The most significant is to ensure the members use the openrdf:SailRepository. This allows the Federation to transfer portions of the query to the members and significantly reduces bandwidth and evaluation latency. Setting the distinct configuration option to true allows you to stream results from the members without further processing; thus reducing memory and CPU usage in the Federation. The localPropertySpace configuration option reduces the cross-member joins done during query evaluation for members partitioned by statement subject. This combined with the openrdf:SailRepository drastically reduces the query processing overhead of multiple members. You can only use this option with predicates that are used with subjects that are co-located in the same member.

The HTTPRepository was overhauled to enable effective use within a Federation. It has two new configuration options that are specifically related to the Federation. These are the readOnly option and the subjectSpace option. The readOnly option prevents clients from writing to the remote store and informs the Federation which member should receive new statements. The subjectSpace option is an optimization that reduces redundant bandwidth by informing the Federation where a statement is located based on its subject.

The Expansion of Sesame

The Sesame API has expanded in both breadth and depth in this 3.0 release. It now covers more configuration options and supports multiple levels of transaction isolation, while still providing more convenient ways to perform RDF analysis and manipulation. The 3.0 branch causes some upgrade problems with the new API and the way BNodes are now being handled. However, many of these changes are necessary to support the wider growing interest in the Sesame platform. The new API represents the growing maturity of the semantic web community and the need for more convenient and reliable tools that will help build the next generation of semantic web applications.

James Leigh is an independent software consultant based in Toronto, has experience modeling business problems and concepts in software, and specializes in performance and technology integration. James has a background in semantic web technologies and decentralized networks. He is an active member in the OpenRDF community, and he's a developer of Sesame and Elmo.
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.