Database Reference
In-Depth Information
When a request is received by the server publishing the restricted-access Linked
Data set, negotiations must take place between client and server to allow subscrib-
ers to be authenticated. The use of authentication protocols such as OAuth 4 or the
World Wide Web Consortium (W3C) WebID protocol (Story and Corlosquet, 2011)
have been proposed, although at the time of writing not yet tried in any commercial
system. The idea is that if the user is successfully authenticated, the paid-for data
can be served; if not, the server redirects nonpaying customers to the free data.
New vocabulary is needed so that the free content can indicate that there is further
content of interest behind the pay wall. There are also calls for standardization of
how payment can be made, beyond the somewhat limited HTTP (Hypertext Transfer
Protocol) “402 Payment Required” response code. We discussed how to describe
data provenance in Chapter 7; however, there are not yet any well-established ways
of automatically understanding license conditions and ensuring that they are met
before providing the data.
In summary, it is very early days in the Linked Data market, and neither the tech-
nical nor the business details have yet been ironed out or tested in the wild.
8.3
SPARQL
We mentioned the SPARQL RDF query language several times in Chapter 7. Since
SPARQL is taught in great detail by many other publications (Feigenbaum and
Prud'hommeaux, 2008; du Charme, 2011), we do not go into great detail about the
inner workings of the query-answering logic, but just provide the basics to enable read-
ers to recognize and construct their own SPARQL queries and understand the results.
SPARQL, pronounced “sparkle,” the recursively named SPARQL Protocol and RDF
Query Language (Prud'hommeaux and Seaborne, 2008), is a W3C standard for query-
ing RDF data. The standard also includes a protocol that defines how to query remote
RDF data that has been published as Linked Data elsewhere on the Web. There are
four main forms of SPARQL query: SELECT, ASK, DESCRIBE, and CONSTRUCT;
these allow read operations (that is, to return results from the RDF graph). 5
Most forms of SPARQL query start with one of these four keywords, which are
applied to a set of triple patterns called a basic graph pattern. Like RDF, a SPARQL
triple pattern consists of a subject, predicate, and object, but in SPARQL, one or more
of these can be a variable. For example, in the following triple pattern, the object is
the variable number, denoted with a ? (although $ is also valid to denote a variable).
@prefix mm_address: < http://id.mereamaps.gov.me/addresses >.
mm_address:0001 mm_address:hasHouseNumber ?number.
Note that we are using Turtle syntax here; the statement terminates in a full stop,
and it is quite acceptable to have more than one or even all three of the subject,
predicate, and object as variables. The triple pattern is matched against a subgraph
of the RDF data, where the subject, predicate, or object in the RDF is substituted
for the variable in the SPARQL triple pattern. In more complex queries, there will
be a collection of triple patterns (which is called the graph pattern) that is matched
against the RDF graph, for example:
Search WWH ::




Custom Search