How to use New York Times Linked Data

From Data-gov Wiki

Jump to: navigation, search
Infobox (How-To) edit with form
  • name: How to use New York Times Linked Data

  • description: overview of linked data published by New York Times
  • creator(s): Tim Lebo
  • created: 2010/04/07
  • modified: 2010-4-12


Contents

Overview

New York Times offers 4 types of data: People, Organizations, Locations, and (Something to the effect of "Miscellaneous"). The first three are available, and they are working to release the fourth.

(Please note that there are also notes on this page's talk tab)

Exploring with a web browser

The page http://data.nytimes.com/ provides a browser based on the first letter of the topic. For example, http://data.nytimes.com/home/m.html lists all People, Organizations, and Locations starting with 'M'. Clicking any topic's URI will go to a page describing the topic using RDF predicates (relations) and objects (values). New York Times is reusing established RDF predicates where appropriate (e.g., owl, wgs84, skos, cc, foaf, dcterms, etc.), making it easier to consume and understand their data.

Perhaps the most important predicate describing any topic is the nyt:search_api_query predicate. This literal value can be used to query for all articles relating to the topic. Note, though, that New York Times requires an API key to submit queries, so the literal value as is will not work. New York Times Article Search API describes how to get the right API key and also describes the components for the article search, in case you want to build your own query or modify the one they provide.

For example, http://data.nytimes.com/10121140202004157983 lists a nyt:search_api_query of:

http://api.nytimes.com/svc/search/v1/article ​?query=+nytd_per_facet%3A%5BNair%2C+Mira%5D​
&rank=newest​ &fields=abstract,​author,​body,​byline,​classifiers_facet,​ column_facet,​date,​
day_of_week_facet,​des_facet,​desk_facet,​fee,​ geo_facet,​lead_paragraph,​material_type_facet,
​multimedia,​nytd_byline, ​nytd_des_facet,​nytd_geo_facet,​nytd_lead_paragraph,​nytd_org_facet,​ 
nytd_per_facet,​nytd_section_facet,​nytd_title,​ nytd_works_mentioned_facet,​org_facet,​page_facet,​
per_facet,​ publication_day,​publication_month,​publication_year,​ section_page_facet,​
small_image_height,​small_image_url,​ small_image_width,​source_facet,​title,​url,​word_count,​
works_mentioned_facet

Appending your API key will get the query to work:

http://api.nytimes.com/svc/search/v1/article ​?query=+nytd_per_facet%3A%5BNair%2C+Mira%5D​
&rank=newest​ &fields=abstract,​author,​body,​byline,​classifiers_facet,​ column_facet,​date,​
day_of_week_facet,​des_facet,​desk_facet,​fee,​ geo_facet,​lead_paragraph,​material_type_facet,
​multimedia,​nytd_byline, ​nytd_des_facet,​nytd_geo_facet,​nytd_lead_paragraph,​nytd_org_facet,​ 
nytd_per_facet,​nytd_section_facet,​nytd_title,​ nytd_works_mentioned_facet,​org_facet,​page_facet,​
per_facet,​ publication_day,​publication_month,​publication_year,​ section_page_facet,​
small_image_height,​small_image_url,​ small_image_width,​source_facet,​title,​url,​word_count,​
works_mentioned_facet&api-key=YOUR_API_KEY_HERE

Exploring as linked data

Although navigating to the URI with a web browser provides HTML for human users to view, requesting the same URI with Accept: application/rdf+xml will return RDF instead of HTML. An example unix command to do this is:

curl -H "Accept: application/rdf+xml" -L "http://data.nytimes.com/10121140202004157983"

Other Linked Data browsing tools may also be used, such as ripple and Tabulator.

Using downloadable SKOS files as a seed for exploration

At http://data.nytimes.com/, you can download a SKOS file for People, Organizations, and Locations. A direct link cannot be provided because you need to accept the license agreement before downloading.

Each file contains RDF in the RDF/XML syntax. The following three sections illustrate the principle connections for an example topic.

People

http://data.nytimes.com/10121140202004157983

Organizations

http://data.nytimes.com/10331225672768371902

Locations

http://data.nytimes.com/14192138827082289301

Facts about How to use New York Times Linked DataRDF feed
Dcterms:created7 April 2010  +
Dcterms:creatorTim Lebo  +
Dcterms:descriptionoverview of linked data published by New York Times
Dcterms:modified2010-4-12
Foaf:homepagehttp://data.nytimes.com/  +
Foaf:nameHow to use New York Times Linked Data
Skos:altLabelHow to use New York Times Linked Data  +, how to use new york times linked data  +, and HOW TO USE NEW YORK TIMES LINKED DATA  +
Personal tools
internal pages