S2S Framework

Printer-friendly version

S2S is a framework for deploying user interfaces for data catalog search from reusable modules called widgets.

S2S Screenshot
This image is of a prototype jointly developed with BCO-DMO at Woods Hole Oceanographic Institution. The prototype can be accessed directly at http://mapservice.bco-dmo.org/mapserver/mapsdev-ol/index.php.


Providing a user interface for browsing and searching data catalogs is a common task for data managers and other data publishers. Many components of such search interfaces are reusable or can be easily borrowed from other interfaces. Frameworks such as jQuery UI and ExtJS are great for quickly putting together static UIs and even those with dynamic data components. However, there is a significant degree of choreography required to align the UI components of those frameworks with data providing services. Additionally, there is no knowledge of the underlying data structures and semantics, so the UI developer is solely responsible for determining the proper modalities for interacting with the services.

What is S2S?

S2S is a user interface framework that leverages the machine-readable semantics of data, services, and user interface components, or "widgets". S2S automates various tasks in UI development for search interfaces.

  • It choreographs the service requests required to populate the interface with dynamic content.
  • It dynamically loads UI JavaScript (and supporting libraries) as needed based on which UI components are selected.
  • The current framework can implement the behavior of faceted browsers.
  • And, if your data catalog is in RDF, it can generate SPARQL queries over your data with only minimal annotation of the vocabulary your data uses (using the FacetOntology [1]).

In addition to this automation, we claim other benefits to using the S2S framework.

  • The UI code you develop is highly modular, and thus can be more easily maintained.
  • Plus, its reusable, and you can borrow widgets from anyone who shares the URIs.
  • Once set up, it provides a rapid prototyping environment, where new facets or search modalities can be swapped in and out quickly.

How it works

The S2S Framework has both a client and server component. The server component is a Java servlet that uses Jena [2] and Ripple [3] to crawl and query semantic metadata required to align data and services with UI components of matching modalities. The client component is based on JavaScript and jQuery, and provides various hooks to use UI widgets (or faceted browsing panels) as a stand-alone pieces or as part of a complete UI experience.

S2S Server

The S2S server has two responsibilities:

  • To provide the semantic metadata about data, services, and UI components.
  • To match service inputs and outputs to compatible UI components using the semantic metadata.
  • To act as a proxy to OpenSearch services and SPARQL endpoints (or other service types as implemented).

The Getting Started Tutorial has all the details required to deploy an S2S Server on your machine.

The S2S Server provides an abstract JSON proxy request protocol for accessing the data from services, but does not do any transformation on the results coming from the data providers. Thus, the client UI components are responsible for parsing and interpreting the results from the individual services. More information about the proxy request protocol can be found on the Proxy servlet section of S2S Servlet API Overview.

S2S requires semantic metadata for describing your service, inputs, outputs, operations, and widgets, as well as a few other things. S2S provides a vocabulary in the form of an OWL ontology. For more information on setting up your semantic metadata, see Creating Semantic Metadata for s2s:Services. There is also a JSON API for accessing the semantic metadata of services (which is currently being used by the client core). More details can be found on the Metadata servlet section of S2S Servlet API Overview.

Currently, to build an S2S UI for your data, it must be provided by either an OpenSearch service or a SPARQL endpoint. OpenSearch is a specification for defining templates for HTTP GET and POST services (essentially, form-based services). OpenSearch is the best option for S2S users who already have a set of APIs available that could be easily transformed into faceting operations, and for users who do not plan on providing an RDF catalog for there datasets. For more information on how OpenSearch services are created for S2S, check out Creating OpenSearch Services for S2S.

OpenSearch is great for users with catalogs contained in relational databases, or existing APIs. However, users with RDF dataset catalogs may want to consider leveraging the FacetOntology capability of S2S. FacetOntology was created for the mSpace project [4], but is generally applicable to any faceted browsing application for RDF data. The user annotates their ontology with terms denoting which classes are facets, and which are results, as well as the paths to correlate facets with results. For more information on setting up FacetOntology and S2S, check out Creating FacetOntology Services for S2S.

Beyond OpenSearch and FacetOntology services, users can extend the S2S Server and ontology in many ways to provide compatibility for new types of services. Those interested should check out the tutorial on Creating S2S Web Service Adapters.

S2S Client Core

The server is merely a provider of S2S metadata and a proxy for Web service requests. Most of the dynamic behavior of S2S browsers is coordinated by the S2S Client Core. Here are some of the responsibilities of the client core:

  • Request service metadata (e.g., inputs, outputs, operations) from the S2S Server
  • Request compatible widgets for service inputs and outputs
  • Dynamically load and execute widget scripts and libraries
  • Initiate Web service requests through the S2S Server proxy
  • Maintain the state of user inputs for future requests

The data provider (or UI developer) is responsible for:

  • Establishing the placement of S2S widgets and panels in HTML
  • Setting default widgets to use for service inputs and outputs (if desired)

Widgets for facets or for results can be placed arbitrarily on a page for a data portal (within the constraints of HTML). For more information on how to achieve this, consult the Deploying an S2S Browser tutorial. This tutorial will also give information on how to choose the default widgets for each facet and results interface.

Users also have the option of creating new widgets, or creating more "panels", which act as controllers for multiple widgets to implement specific behaviors. For information on creating s2s:Widgets, check out these tutorials: Creating s2s:InputWidgets and Creating s2s:ResultWidgets.

The "faceting" behavior of S2S is not actually implemented in the server, or in any specific widget. Rather, it is implemented at the panel level, which has the ability to intercept S2S core events to have more fine-grained control over Web service data requests/updates, and other behaviors. For example, when the top level SearchService JavaScript object controls each s2s:Input widget individually, all panels are updated on every user constraint. Using the hierarchical search paradigm, the FacetPanel can accept update events from the parent service, and update only those widgets that fall "below" the previously constrained widget.

In addition to callbacks for choreographing the behavior of multiple widgets, there is also the option to write "hook" panels, which merely intercept S2S updates or push update events to the SearchService object. These hook panels are useful when embedding an S2S browser into another UI, or when prototyping UI before encapsulating in an s2s:Widget. For more information on how these are implemented, consult the Hooks for Customized or Embedded S2S Browsers tutorial.


As S2S is a framework, there is a significant amount of work to set up. Plan on at least one full day to get the browser set up for the first time. First-timers will most likely be interested in the Getting Started Tutorial, more advanced users should check out detailed tutorials below:

For power users interested in extending the S2S Server, check out:

For issues not addressed in the tutorials, check out some of the Frequently Asked Questions.

Future Work

  • Extend the alignment of s2s:Widget and s2s:QueryInterface instances to use classes instead of just instances
  • Create state-saving capability for S2S
  • Create "ToolMatch-like" architecture for matching widgets to services and parameters
  • Create "Linked Data Widget" ontology/architecture for connecting external vocabularies to facet vocabularies.
  • Create forms for S2S metadata creation/editing
  • Implement dynamic facet capabilities
    • Create Apache Solr adapter
    • Create TWFacet adapter (Jin's facet service)

External Resources


Rozell, E., Wang, H., West, P., Zednik, S., Fox, P. (2011), Configurable User Interface Framework for Data Discovery in Cross-Disciplinary and Citizen Science, Abstract EGU2012-12859 to be presented at General Assembly 2012, EGU, Vienna, Austria, 22-27 Apr

Eric Rozell. High-Performace Faceted Interfaces Using S2S. TWed Talk. 25 January 2012. (slides) (video)

Rozell, E., Maffei, A., West, P., Zednik, S., Fox, P. (2011), Open Standards and Technologies in the S2S Framework, Abstract IN31A-1435 presented at 2011 Fall Meeting, AGU, San Francisco, Calif., 5-9 Dec (poster)

Rozell, E., Fox, P., Maffei, A., Zednik, S. (2011), A Framework for Earth Science Search Interface Development, Abstract EGU2011-13413 presented at General Assembly 2011, EGU, Vienna, Austria, 03-08 Apr (slides)

Maffei, A., Rozell, E., Fox, P. (2010), A Framework for Integrating Oceanographic Repositories, Abstract IN23A-1349 presented at 2010 Fall Meeting, AGU, San Francisco, Calif., 13-17 Dec (poster)


  1. FacetOntology Tech. Report
  2. Jena Apache Project
  3. Ripple Linked Data Crawler
  4. mSpace Faceted Browser
  5. Polowinski's Widgets for Faceted Browsing