Tupelo's server protocol is a modified and greatly extended variant of URIQA's "Semantic Web Service" interface. In addition to URIQA methods, Tupelo supports a number of other methods.
Tupelo Server methods take a variety of parameters. Common ones include:
Tupelo Server is a servlet that should be hosted in a web application container. It is configured to be backed with a single Tupelo Context and all operations requested by the client are performed against that Context.
A client Context implementation is provided that translates all supported Operators into requests to a server. The client must be configured with the URL of the servlet representing a Tupelo Server instance. There are no restrictions on what URL can be used.
The Context abstraction is the basis of Tupelo's flexible, distributed architecture for managing information. Each Context represents one or more sources of and/or destinations for information, including binary data, text data, and RDF metadata. Contexts act as brokers between an application and any of a variety of different ways of accessing, storing, querying, and managing information, including filesystems, relational databases, web services, and RDF triple stores.
Tupelo Contexts provide a generic set of Operators, which are tasks that read or write information to or from a Context. Each Operator is designed as much as possible to behave consistently regardless of which Context is used to perform it.
For example, the BlobFetcher Operator is used to read binary data associated with a given URI, and can be used to read web pages:
Context c = new HttpContext(); BlobFetcher bf = new BlobFetcher(); bf.setUri(URI.create("http://apod.nasa.gov/apod/image/0909/butterfly_hst_big.jpg")); c.perform(bf); InputStream image = bf.getInputStream();
or files:
Context c = new SimpleFileContext(); c.setPathPrefix("/home/johndoe/images/"); c.setUriPrefix("tag:johndoe@email.com,2005:images#"); BlobFetcher bf = new BlobFetcher(); bf.setUri(URI.create("tag:johndoe@email.com,2005:images#lolCat23.jpg")); c.perform(bf); InputStream image = bf.getInputStream();
or from a variety of other ways of storing and retrieving octet streams, including relational databases and remote web services.
The Tupelo kernel provides a small core set of Operator classes including:
Note: in Tupelo 2.5 much of this functionality is available using the Tupelo Chains API.
Not all Contexts support all Operator classes. For example, filesystem-backed Contexts generally cannot perform SPARQL queries or other metadata operations. An application can interrogate a Context at runtime to determine which operations can be performed and if not why not, which for instance allows a Context to reject operations because it is busy.
To open a context means allowing the context to acquire any resources (e.g., database connections) it needs to enable your application to interact with the context's contents. To close a context means releasing these resources. This document describes the usage of these two calls and a related call, validate().
When using RDF, it is necessary to use a globally-unique URI reference for anything that you want to describe: a person, a document, a dataset, a gene, a web page, a sensor, a region on a map, etc. In addition to allowing the use of existing URI schemes, Tupelo provides several ways of creating globally-unique URI references.
You can use any context configuration supported by Tupelo by writing your own default.rdf context configuration file. The file is a serialized version of a completely configured and initialized Tupelo Context. You can create such a file by writing a Java program using the Tupelo API to completely configure then serialize your Context.
The following Java code example will configure and write a Tupelo context that is backed by a Jena-managed persistent MySQL database for storing triples and a directory/folder for storing blobs.
How should you use Thing? How does this compare with using a bean and Bean Session? This small tutorial gives a basic comparison. It is intended both as a small first tutorial and as a way to evaluate which approach might better serve your needs.