An overview of a Web services and Linked Data

Linked Data

The Linked Data paradigm emerged in the context of Semantic Web technologies for publishing and sharing data over the Web. It connects related individual Web resources in a Graph database, where resources represent the graph nodes, and an edge connects a pair of nodes. Publishing and linking scientific resources using Semantic Web technologies require that the user community follows the three principles of the linked Data. First, each resource needs to be represented using a unique Uniform Resource Identifier (URI), which consists of: (i) A Uniform Resource Locator (URL) to define the server path over the Web, and (ii) A Uniform Resource Name (URN) to describe the exact name of the resource. Second, the relationships between resources are described using the triple format, where a subject S has a predicate P with an object O. A predicate is either an undirected relationship (bi-directional), where it connects two entities in both ways or a directed relationship (uni-directional), where the presence of a relationship between two entities in one direction does not imply the presence of a reverse relationship. The triple format is the structure unit for the Linked Data system. Finally, the HyperText Transfer Protocol (HTTP) is used as a universal access mechanism for resources on the Web. More detials are avilable here (http://linkeddata.org/)

Web Services

A web service is a function that can be accessed by other programs over the web using Hypertext Transfer Protocol (HTTP). Web service was introduced by the World Wide Web Consortium (W3C) to characterize machine- to -machine communication built over HTTP. A set of standards has been developed by the W3C working groups over time to describe machine processable formats and communications protocols such as the Web Services Description Language (WSDL) and the Simple Object Access Protocol (SOAP). Over time, some of these standards have fallen out of popularity because of their complexity and have been replaced by simpler software architecture styles such as Representational State Transfer (REST); conceptually it built upon the same principles of HTTP and provides methods to facilitate the development of Web services. Most RESTful web services are written as plain HTTP services using eXtensible Markup Language (XML) or JavaScript Object Notation (JSON) for content representation. XML was developed by the W3C for data exchange over the Web. It is a flexible, self-describing markup language format and provides a hierarchical syntax structure for encoding data and their relationships. However using XML can produce syntactic heterogeneity because data can be organized in many different ways. JSON is a lightweight interchange format native to the Web, easy for both humans and machines to read and write. Although Web Application Programming Interface (API) can refer to both types, over time it is becoming a synonymous with the RESTful approach. Both RESTful and API use simple protocols, but they have shortcomings in self-description methods, and built-in ways to support interoperation among services. Today many resources are available through Web API, but the format in which these resources are made available and described varies greatly.

Quick Tutorial on using Web Services in Programming languges

In these examples, we will use a get to reterive the attrbuites of a CSDMS standard name stored in the knowledge base of the Geosemantics framework.

POSTMAN (Chrome App)

_images/Postman.png

* Python

import requests
import json
# Get the feed
r = requests.get("hcgs.ncsa.illinois.edu/gsis/CSNqueryName?graph=csdms&name=air__dynamic_shear_viscosity ")
r.text

# Convert it to a Python dictionary
data = json.loads(r.text)