Web Services and TopQuadrant Products » TopQuadrant, Inc

+1 919.300.7945     Blog     Downloads     Purchase     Contact

Web Services and TopQuadrant Products

Posted by Bob DuCharme on July 24, 2015

TopQuadrant's TopBraid platform provides Application Programming Interfaces (APIs) that make it easy to integrate TopBraid applications (both, customer built and TopQuadrant provided, such as TopBraid Reference Data Manager, TopBraid Enterprise Vocabulary Net) with other systems in your enterprise. APIs take the form of RESTful web services, and TopBraid also offers support for JMS (Java Messaging Service) to integrate with Enterprise Service Bus architectures.

Today we'll look at the API mechanisms included with the TopBraid platform and provide pointers to where you can get more detailed technical information. An overview of approaches for creating TopBraid web services is also available in the online help for TopBraid Composer, the Integrated Development Environment used to create TopBraid applications, at TopBraid Composer > Application Development Tools > Web Services. (You can download a fully-functional evaluation version of TopBraid Composer Maestro Edition and try it out for free for 30 days.)

Built-in Web Services

You can read about a built-in generic search service that allows you to find resources based on the parametrized search criteria in Composer's online help under TopBraid Composer > TopBraid Live Integration > The Search Servlet.

The W3C Linked Data Platform (LDP) specification defines a standard way to use HTTP GET requests to retrieve graphs of triples about named resources. For information on TopBraid’s support of the LDP standard, see TopBraid Composer > TopBraid Live Integration > LDP Servlet in the TopBraid Composer online help.

In addition to the generic built-in services, TopBraid products offer more specific web services created to support common API requests. When these web services are built into a product such as TopBraid EVN, you'll find full documentation of them by selecting “Available Web Services” from the Administration console. For example, in EVN, that page shows that you can call the AllBroaderConcepts service, which returns a list of all concepts that are transitively broader (that is, higher up in the taxonomy hierarchy) than the narrowerConcept value passed as a parameter, by appending /tbl/template/skostemplate/AllBroaderConcepts?narrowerConcept= to the domain name and port number where your copy of EVN is installed, with the parameter added after that. With EVN installed locally, you could find all concepts broader than Chicago in EVN's sample geography taxonomy with the following HTTP call (split here across three lines to fit on this page):

http://localhost:8083/tbl/template/skostemplate/AllBroaderConcepts?narrowerConcept=http://topquadrant.com/ns/examples/geography%23Chicago
&_base=urn:x-evn-master:geo

Additional parameters in this URL can specify, among other things, that you want the results returned as XML, JSON, or in a delimited format.

Defining Your Own Read and Write Web Services

When you need more than the built-in services, you can easily create your own custom APIs as web services. One simple way to create a web service is to define a parameterized query in the W3C SPARQL query language and then store that query as part of a model that can be accessed as a web service. Such parametrized queries are called SPIN templates and you can access them as RESTful web services. This is actually how the AllBroaderConcepts web service mentioned above is implemented, and the documentation described there includes the actual SPARQL query.

Storing these queries as templates makes it possible to also define one or more parameters (in the case above, ?narrowerConcept) to pass into the query, making the web service more flexible. SPIN templates can use SELECT queries to read data managed by TopBraid and UPDATE queries for modifying data.

Any custom web service you create will also be listed in the Administration console together with information on how to invoke it. The auto-documentation facility built into the platform will generate API descriptions for you from the relevant description information.

For information on creating web services as SPIN templates see TopBraid Composer > TopBraid Live Integration > SPIN Template Service in the Composer online help. You can find more information about SPIN at its home page.

Using TopBraid Applications as a SPARQL Endpoint

Along with the W3C SPARQL query language, the TopBraid platform fully supports the SPARQL Protocol, letting you use the TopBraid Live application server underlying the applications as a SPARQL endpoint. This means that arbitrary queries (subject to authentication on any particular server) can be embedded in both HTTP GET and POST requests.

For example, the following URL (split to fit on this page) requests the definition of the term “environment” according to the International Press Telecommunications Council's taxonomy:

http://localhost:8083/tbl/sparql?default-graph-uri=urn:x-evn-master:iptc
  &query=SELECT ?definition WHERE {

  ?c skos:prefLabel "environment"@en-GB; skos:definition ?definition}

TopBraid applications also support SPARQL UPDATE queries, letting other applications (subject to authentication) add and modify data stored with these applications. For further information, see TopBraid Composer > TopBraid Live Integration > SPARQL Endpoint in the TopBraid Composer online help.

Data Processing Web Services

When you need to go beyond a service that can be expressed as a single query, TopBraid application development tools such as SPARQL Web Pages (SWP) and SPARQLMotion provide a range of ways to define your own sophisticated web services, whether you're creating a custom application, augmenting an existing application such as TopBraid RDM or EVN, or interfacing your existing application with TopBraid-based solutions.

The SPARQLMotion scripting language lets you create pipelines of data processing tasks from a broad choice of available modules. You can save these pipelines as scripts that can be called as web services and that can also play other roles in TopBraid applications. For example, one of these web services can retrieve data from TopBraid and other sources (including relational databases), transform it, and return the output as custom XML or JSON or save it as a disk file. Such a script could also pull data from XML files or URLs, aggregate it, run transformation rules, and add the resulting information to the TopBraid datastore.

The selection of over one hundred SPARQLMotion modules available for these pipelines include several that can read data from remote sources specified by URLs. Once that data is retrieved, other modules can parse, query, and perform other manipulations of that data to serve your application's needs.

The SWP templating and scripting technology provides additional capabilities for developing web-based user interfaces and web services. Most of the SPARQLMotion modules are available when you develop with SWP, including those that can call other RESTful web services and work with the returned data.

The decision of whether to use SPARQLMotion or SWP depends on the complexity of the processing logic and the skills and preferences of developers defining the services:

  • SPARQLMotion provides an intuitive drag-and-drop visual programming tool that appeals to business analysts and data managers. It is easy to get started with and is great for straightforward processing pipelines.
  • SWP will appeal to more traditional developers, especially those with JavaScript skills. It is better for scripts that involve more than a dozen processing modules or more complex data processing control logic.

You can learn more about both SPARQLMotion and SWP by selecting TopBraid Composer > Application Development Tools in the Composer online help. (See TopBraid Composer > Reference > SPARQLMotion Module Library Reference for information on specific SPARQLMotion modules.) Further information about SWP is available at its home page.

If you are using TopBraid EVN or TopBraid RDM and the files you need to import are spreadsheets, you may not even need to create a data processing script; you can take advantage of the built-in Import Spreadsheet service. For more information on this, see TopBraid Composer > TopBraid Live Integration >The Import Spreadsheet From Template.htm Service in the TopBraid Composer online help. (Note that this is a new help page in TopBraid 5.0.)

Integrating with Your Systems

For integration with Enterprise Service Bus-based architectures, the SPARQLMotion module ExportToJMS lets you write messages to Java Message Service queues. For more information, see the online help's SPARQLMotion Modules Library Reference described above.

TopBraid offers several mechanisms to trigger the execution of one of the services described here. For example, it can run on a scheduled basis or be called on demand by another web service. TopBraid products such as TopBraid EVN and TopBraid RDM that are built on the Teamworks Framework also let you trigger services based on changes in data. For more information on this, see TopBraid EVN Developer Guide > Event-Condition-Actions Rules in the TopBraid EVN help.

As the RESTful system interaction style becomes more popular, it's getting easier to connect up different tools and systems into the configuration that's best for your business. TopBraid applications can take advantage of this to retrieve data from other systems and then use all of the power of semantic technologies to work with that data. They can also provide web services that let your other systems take advantage of that power, whether it's a Content Management System making calls to TopBraid EVN for synonyms to help with a search or an order entry system calling TopBraid RDM to get an updated list of currency codes. Contact TopQuadrant to find out more about how you can explore this power to meet your business needs as you build a semantic ecosystem in your enterprise.

Archives

About TopQuadrant | Glossary | Privacy Statement | Legal | Terms of Use
© Copyright 2001-2017 TopQuadrant, Inc. All Rights Reserved.