graphic with four colored squares
Cover page images (keys)

Mission Possible: Deploying Government Linked Data (Pt1)

Sandro Hawke, (, W3C/MIT, @sandhawke
John L. Sheridan, @johnlsheridan
gov 2.0 expo, May 25-26, 2010, Washington DC (wiki)

Mission Possible

Part 1:

Part 2:

Part 3:

please send comments and questions to subject 'tutorial'

Part 1: Fundamentals

About Us

About You (Just Curious)


Download and Programmatic Access

About the "Semantic Web"


See Kate Ray's Web 3.0 Video (esp. until 3:37 or 6:50)

Linked Data has a narrower goal; uses some of the same technologies.

What Is Linked Data?

Extending spreadsheets and databases to work over the Web.

  1. Give web identifiers (URIs) to things
  2. Publish information about them as Web Resources (good website architecture)
  3. Use Triples (subject, property, value)


Data at
SubjectPropertyValue"Bay State"

Benefits of Linked Data

Why does Linked Data make sense for government?

RDF Triples


Quick Demo

Data at
SubjectPropertyValue"Bay State"

So How Do You Add Your Data?

  1. Think in Subject-Property-Value Triples
  2. Use URIs
  3. Publish on the Web

URIs (A Little Web Architecture)

URIs are like URLs, with a few extra tricks.

Long history, "Web Architecture", lots of debate.

Here it is, put simply.

Information Resource



art credit

URLs identify Information Resources

URIs identify Resources

Any resource. Using filenames for things that aren't files.

Hash and Slash

Two kinds of indirection:

Hash vs Slash

Hash URIs:

Slash URIs:

You'll see both.

When publishing, your software may choose for you.


  1. Use URIs to identify things
  2. Think in Triples
  3. Publish on the web

Publishing Data

Publication Method Advantages Disadvantages
RDF/XML Document Oldest, best supported Confusingly like normal XML
Turtle (N3) Document Simplest Not technically a standard yet
HTML Document with RDFa Fits inside HTML attributes Can get very complicated
JSON Normal JSON, but also RDF Promising, but still being developed
GRDDL Use the XML you have/want Needs to download+run XSLT
SPARQL Query Protocol Query Protocol

RDF/XML Example

<rdf:RDF xmlns:rdf=""
  <rdf:Description rdf:about="">
      <rdf:Description rdf:about="" />
    <db:Nickname>Bay State</db:Nickname>
      <rdf:Description rdf:about=""> 


Turtle Prefixes

First triple:

       <> .

Abbreviate it:

@prefix db: <>

db:Massachusetts db:Governor db:Deval_Patrick.

Turtle Example

@prefix db: <> 

db:Massachusetts db:Governor db:Deval_Patrick;
                 db:Nickname "Bay State";
                 db:Capital db:Boston.
db:Boston        db:Nickname "Beantown".

RDFa Example

<?xml version="1.0" encoding="UTF-8"?>
<html xmlns=""
      version="XHTML+RDFa 1.0">
    <title>About Massachusetts</title>
    <div about="">The
    Massachusetts governor is
      <span rel="db:Governor">
	<span about="">Deval
      the nickname is "<span property="db:Nickname">Bay State</span>",
      and the capital
      <span rel="db:Capital">
	<span about="">
	  has the nickname "<span property="db:Nickname">Beantown</span>".

distiller community site

One Possible RDF-JSON Example

{ "__iri": "db:Massachusetts",
  "db:Nickname": "Bay State",
  "db:Governor": { "__iri": "db:Deval_Patrick"  },
  "db:Capital": {  "__iri": "db:Boston",
                   "db:Nickname": "Beantown"
  "__prefixes": { "db:": "" }

One Possible GRDDL Example

<MyDataSet xmlns="">
    <nickname>Bay State</nickname>

All the hard work is done by an XSLT program downloaded via the XML namespace URL. (Not implemented for this demo, sorry.)

spec demo service


prefix db: <>
prefix dbo: <>
SELECT ?dnym WHERE { db:Massachusetts dbo:demonym ?dnym }
prefix db: <>
prefix dbo: <>
SELECT ?cap WHERE { db:Massachusetts dbo:capital ?cap }

dbpedia sparql service and sparql tutorial

Content Negotiation

How do you manage all these options?


curl -L --header "Accept: application/rdf+xml"
curl -L --header "Accept: text/turtle"
curl -L --header "Accept: text/html"