{"id":11650,"date":"2016-03-28T12:11:41","date_gmt":"2016-03-28T09:11:41","guid":{"rendered":"https:\/\/www.webcodegeeks.com\/?p=11650"},"modified":"2016-03-18T20:42:17","modified_gmt":"2016-03-18T18:42:17","slug":"json-ld-building-meaningful-data-apis","status":"publish","type":"post","link":"https:\/\/www.webcodegeeks.com\/javascript\/json-ld-building-meaningful-data-apis\/","title":{"rendered":"JSON-LD: Building Meaningful Data APIs"},"content":{"rendered":"<p>Everybody loves <a href=\"http:\/\/json.org\/\">JSON<\/a>!<\/p>\n<p>However, JSON by itself is pretty meaningless. Well. It has meaning, but only to the original creator of that format. They can share that meaning via documentation, conversation, or usage, but those often exist in places far removed from the JSON document you\u2019re looking at.<\/p>\n<p>What if the meaning itself was encoded directly into the document? What if every key in a JSON document had its own unique identity which you could look up (because web!) and read about its meaning? Wouldn\u2019t that be slick?<\/p>\n<p>Well. It\u2019s quite possible, actually.<\/p>\n<p>Here\u2019s what I mean. Below is a pretty typical bit of \u201cperson\u201d information written in JSON with English key names (to match this article\u2019s content):<\/p>\n<pre class=\"brush:php\">{\r\n  \"first_name\": \"Benjamin\",\r\n  \"last_name\": \"Young\",\r\n  \"alias\": \"BigBlueHat\",\r\n  \"email\": \"byoung@bigbluehat.com\"\r\n}<\/pre>\n<p>You likely know what all that means (more or less). However, your software doesn\u2019t, unless you coded it exactly to those string names. While there\u2019s some possibility we picked the same keys (yay us!), there\u2019s a higher likelihood we didn\u2019t. We probably fix our <code>:coffee:<\/code> differently too. Who knows.<\/p>\n<p>Currently, we\u2019d need to write some code that took my JSON and turned the <code>first_name<\/code> key into your <code>firstName<\/code> key (or into <code>first<\/code> which is inside your <code>name<\/code> object or into <code>given<\/code> or\u2026 whatever). We\u2019d then need to do that again the next time we found someone else with information about a person that used different key names. Rinse. Repeat.<\/p>\n<p>What if we could match <code>first_name<\/code>, <code>name.first<\/code>, <code>given<\/code>, and even an obfuscated <code>sadfeqpoif<\/code> key into a meaningful <em>Thing<\/em> which made each of these \u201cmean\u201d the same thing? It can be done!<\/p>\n<p><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/03\/json-ld-button.png\" rel=\"attachment wp-att-11660\"><img decoding=\"async\" class=\"aligncenter wp-image-11660\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/03\/json-ld-button.png\" alt=\"json-ld-button\" width=\"610\" height=\"214\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/03\/json-ld-button.png 700w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/03\/json-ld-button-300x105.png 300w\" sizes=\"(max-width: 610px) 100vw, 610px\" \/><\/a><\/p>\n<p>Meet <a href=\"http:\/\/json-ld.org\/\">JSON-LD<\/a>! JSON-LD stands for \u201cJSON for Linked Data.\u201d It\u2019s a specification for encoding contextualized meaning into otherwise meaningless JSON documents.<\/p>\n<p>Here\u2019s an example:<\/p>\n<pre class=\"brush:php\">{\r\n  \"@context\": {\r\n    \"@vocab\": \"http:\/\/schema.org\/\",\r\n    \"first_name\": \"givenName\",\r\n    \"last_name\": \"familyName\",\r\n    \"alias\": \"alternateName\",\r\n    \"email\": \"email\"\r\n  },\r\n  \"first_name\": \"Benjamin\",\r\n  \"last_name\": \"Young\",\r\n  \"alias\": \"BigBlueHat\",\r\n  \"email\": \"byoung@bigbluehat.com\"\r\n}<\/pre>\n<p>In this <em>upgraded<\/em> version of the earlier JSON document, you\u2019ll see a new <code>@context<\/code> object. This object handles the mapping from my ad hoc terminology to the <a href=\"http:\/\/schema.org\/\">Schema.org<\/a> vocabulary which is referenced via value of <code>@vocab<\/code>.<\/p>\n<p>The key\/value pairs below the <code>@vocab<\/code> key map directly to meaningful URLs at <code>http:\/\/schema.org\/<\/code>. Now, my keys have meaning. Each key now has:<\/p>\n<ul>\n<li>an <strong>identity<\/strong> in the form of a URL: <code>last_name<\/code> now maps to <a href=\"http:\/\/schema.org\/familyName\">http:\/\/schema.org\/familyName<\/a> for instance.<\/li>\n<li>a <strong>definition<\/strong> found by visiting the URL for <code>familyName<\/code>: <em>\u201cFamily name. In the U.S., the last name of a Person. This can be used along with givenName instead of the name property.\u201d<\/em><\/li>\n<\/ul>\n<p>Pretty handy, no? Now. If you found that JSON \u2014 or got it back from my API \u2014 you could know what the keys meant by looking up their URLs.<\/p>\n<h2>Mapping to Meaning<\/h2>\n<p>Knowing what keys mean within a JSON document is already an upgrade over the status quo, but let\u2019s not stop there!<\/p>\n<p>Here\u2019s an example of the same JSON using the Schema.org terms (key names) directly:<\/p>\n<pre class=\"brush:php\">{\r\n  \"@context\": \"http:\/\/schema.org\/\",\r\n  \"givenName\": \"Benjamin\",\r\n  \"familyName\": \"Young\",\r\n  \"alternateName\": \"BigBlueHat\",\r\n  \"email\": \"byoung@bigbluehat.com\"\r\n}<\/pre>\n<p>This Schema.org JSON example has the same meaning as the earlier version. \u201cBigBlueHat\u201d in both cases means an <a href=\"http:\/\/schema.org\/alternateName\">alternateName<\/a> for Benjamin Young.<\/p>\n<p>In the world of JSON-LD, my JSON with <code>first_name<\/code> and this JSON with <code>givenName<\/code> are equivalent, identical, the exact same, they match, and son. Crazy, right?<\/p>\n<h2>Coding for the @context<\/h2>\n<p>So wait. We\u2019ve got two different JSON documents which mean the same thing. Fabulous. However, most current JSON code for processing these likely looks a bit like this:<\/p>\n<pre class=\"brush:php\">var doc = {...}; \/\/ one of the documents above\r\nvar first = doc.first_name || doc.givenName;\r\nconsole.log('First Name', first);<\/pre>\n<p>How does the <code>@context<\/code> object help get around that? We\u2019re still just looking for the strings not the Things.<\/p>\n<p>We have two options:<\/p>\n<ul>\n<li>expansion<\/li>\n<li>compaction<\/li>\n<\/ul>\n<h3>Expansion<\/h3>\n<p>Expansion in JSON-LD parlance means taking those meaningful, URL-based names and making them (at least within the processing code) actually <em>be<\/em> the URLs. Here\u2019s the output from the expansion process done on both the above contextualized examples (remember! They\u2019re identicial now!):<\/p>\n<pre class=\"brush:php\">[\r\n  {\r\n    \"http:\/\/schema.org\/alternateName\": [\r\n      {\r\n        \"@value\": \"BigBlueHat\"\r\n      }\r\n    ],\r\n    \"http:\/\/schema.org\/email\": [\r\n      {\r\n        \"@value\": \"byoung@bigbluehat.com\"\r\n      }\r\n    ],\r\n    \"http:\/\/schema.org\/givenName\": [\r\n      {\r\n        \"@value\": \"Benjamin\"\r\n      }\r\n    ],\r\n    \"http:\/\/schema.org\/familyName\": [\r\n      {\r\n        \"@value\": \"Young\"\r\n      }\r\n    ]\r\n  }\r\n]<\/pre>\n<p>Yeah. Sorry. This is the sausage making bit.<\/p>\n<p>The above is the internal, identical representation in a JSON-LD processing system of both the above documents. It\u2019s structured that way because there\u2019s much more data that can (and likely will, in a real-life example) be added to those arrays, objects, etc.<\/p>\n<p>However, you\u2019re likely not currently inspired to switch all your JSON processing code to use this format. No worries! That\u2019s where <em>compaction<\/em> comes in!<\/p>\n<h3>Compaction<\/h3>\n<p>JSON-LD processors will take the above two example docs, turn them into that <em>expanded<\/em> format, and then (if asked) turn them into a much more human-friendly <em>compacted<\/em> variation that looks like this:<\/p>\n<pre class=\"brush:php\">{\r\n  \"@context\": {\r\n    \"@vocab\": \"http:\/\/schema.org\/\",\r\n    \"first_name\": \"givenName\",\r\n    \"last_name\": \"familyName\",\r\n    \"alias\": \"alternateName\",\r\n    \"email\": \"email\"\r\n  },\r\n  \"alias\": \"BigBlueHat\",\r\n  \"email\": \"byoung@bigbluehat.com\",\r\n  \"last_name\": \"Young\",\r\n  \"first_name\": \"Benjamin\"\r\n}<\/pre>\n<p>\u201cWait, what?\u201d I hear you say. \u201cYou just copy\/pasted the first example again! You, just now.\u201d<\/p>\n<p>Actually, I didn\u2019t. Don\u2019t trust me? Check it out in the <a href=\"http:\/\/tinyurl.com\/z77crzk\">JSON-LD Playground<\/a>. Here\u2019s a screenshot for the doubters who don\u2019t want to click:<\/p>\n<p><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/03\/Recontextualized-JSON-LD.png\" rel=\"attachment wp-att-11661\"><img decoding=\"async\" class=\"aligncenter wp-image-11661\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/03\/Recontextualized-JSON-LD-1024x628.png\" alt=\"Recontextualized-JSON-LD\" width=\"860\" height=\"527\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/03\/Recontextualized-JSON-LD-1024x628.png 1024w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/03\/Recontextualized-JSON-LD-300x184.png 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/03\/Recontextualized-JSON-LD-768x471.png 768w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/03\/Recontextualized-JSON-LD.png 1192w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><\/p>\n<p>Yep. That\u2019s the \u201cstraight\u201d Schema.org example (on the left), re-contextualized via my idosyncratic <code>@context<\/code> (seen on the right) with the fully realized and re-contextualized output document at the bottom.<\/p>\n<p>So, yeah. Round tripped someone else\u2019s JSON into my own key names. Nice, yeah? Let\u2019s code for that.<\/p>\n<h3>The codes<\/h3>\n<p>Here\u2019s the magic using <a href=\"https:\/\/github.com\/digitalbazaar\/jsonld.js\">json-ld.js<\/a>:<\/p>\n<pre class=\"brush:php\">var recontextualized = {};\r\njsonld.compact(schema_org_doc, my_context,\r\n  function(err, compacted) {\r\n    recontextualized = compacted;\r\n  });<\/pre>\n<p>Running that code, I now have this output you just saw above. Not much code for so much magic, eh?<\/p>\n<p>Here\u2019s a live environment with the content from this example, so you can test it out: <a href=\"http:\/\/jsbin.com\/finore\/3\/edit?html,js,output\">JS Bin on jsbin.com<\/a><\/p>\n<h3>Meaningful People APIs<\/h3>\n<p>Now that we can transform simple JSON documents into magically meaningful JSON-LD documents, let\u2019s look at what this gets us in practice.<\/p>\n<p>Let\u2019s look at three JSON API endpoints from three different people-information-providers (commonly called Social Networks):<\/p>\n<ul>\n<li>Meetup<\/li>\n<li>Twitter<\/li>\n<li>LinkedIn<\/li>\n<\/ul>\n<p>First, here\u2019s the full idiosyncratic <code>@context<\/code> to cover the content I want \u201cnormalized\u201d from these three social networks:<\/p>\n<pre class=\"brush:php\">{\r\n  \"@vocab\": \"http:\/\/schema.org\/\",\r\n  \"first_name\": \"givenName\",\r\n  \"last_name\": \"familyName\",\r\n  \"alias\": \"alternateName\",\r\n  \"job_title\": \"jobTitle\",\r\n  \"city\": \"addressLocality\",\r\n  \"country\": \"addressCountry\"\r\n}<\/pre>\n<p>Below are the URLs, plain-old-JSON, and the site-specific custom <code>@context<\/code> needed to map their key names to the Schema.org standard URLs. There\u2019s also a JSBIN workspace you can fork for each of them!<\/p>\n<h3>Meetup<\/h3>\n<p>URL: <code>https:\/\/api.meetup.com\/2\/member\/19524571?&amp;sign=true&amp;photo-host=public&amp;page=20&amp;only=country,city,link,bio,name<\/code><\/p>\n<p>JSON:<\/p>\n<pre class=\"brush:php\">{\r\n  \"link\": \"http:\/\/www.meetup.com\/members\/19524571\",\r\n  \"name\": \"Benjamin Young\",\r\n  \"country\": \"us\",\r\n  \"bio\": \"aka BigBlueHat -=- Developer, Web, &amp; Open Source Advocate, Invited Expert in the Annotation and Digital Publishing Working Groups at the W3C. Previously an inventor and evangelist for IBM's Cloudant, Couchbase, and also CTO at InnoVenture.\",\r\n  \"city\": \"Greenville\"\r\n}<\/pre>\n<p>Meetup Mapping <code>@context<\/code>:<\/p>\n<pre class=\"brush:php\">{\r\n  \"city\": \"http:\/\/schema.org\/addressLocality\",\r\n  \"country\": \"http:\/\/schema.org\/addressCountry\",\r\n  \"bio\": \"http:\/\/schema.org\/description\",\r\n  \"name\": \"http:\/\/schema.org\/name\"\r\n}<\/pre>\n<p>You can test it out:\u00a0<a href=\"http:\/\/jsbin.com\/wenanu\/3\/edit?html,js,output\">JS Bin on jsbin.com<\/a><\/p>\n<h2>Twitter<\/h2>\n<p>URL: <code>https:\/\/api.twitter.com\/1.1\/users\/show.json?screen_name=bigbluehat&amp;user_id=15841047<\/code><\/p>\n<p>JSON <em>(only partial results below \u2019cause it\u2019s huge!)<\/em><\/p>\n<pre class=\"brush:php\">{\r\n  \"id\": 15841047,\r\n  \"id_str\": \"15841047\",\r\n  \"name\": \"bigbluehat\",\r\n  \"screen_name\": \"bigbluehat\",\r\n  \"location\": \"Greenville, SC\",\r\n  \"profile_location\": null,\r\n  \"description\": \"inventor &amp; evangelist - I :heart: hypothes.is, @couchdb, open source, open communities. I organize @RESTFest &amp; @OpenUpstate.\"\r\n  ...\r\n}<\/pre>\n<p>Twitter Mapping <code>@context<\/code>:<\/p>\n<pre class=\"brush:php\">{\r\n  \"name\": \"http:\/\/schema.org\/alternateName\",\r\n  \"screen_name\": \"http:\/\/schema.org\/alternateName\",\r\n  \"description\": \"http:\/\/schema.org\/description\",\r\n  \"location\": \"http:\/\/schema.org\/location\"\r\n}<\/pre>\n<p>You can test it out:\u00a0<a href=\"http:\/\/jsbin.com\/gejewo\/4\/edit?html,js,output\">JS Bin on jsbin.com<\/a><\/p>\n<h2>LinkedIn<\/h2>\n<p>URL: <code>https:\/\/api.linkedin.com\/v1\/people\/~?format=json<\/code><\/p>\n<p>JSON:<\/p>\n<pre class=\"brush:php\">{\r\n  \"firstName\": \"Benjamin\",\r\n  \"headline\": \"Invited Expert, W3C\",\r\n  \"id\": \"Ol-pwbI97V\",\r\n  \"lastName\": \"Young\",\r\n  \"siteStandardProfileRequest\": {\r\n    \"url\": \"https:\/\/www.linkedin.com\/profile\/view?id=AAoAAAAAx4oBxNlPOjsrspSms5FMi7Tx0c-EBSk&amp;authType=name&amp;authToken=XFwT&amp;trk=api*a3227641*s3301901*\"\r\n  }\r\n}<\/pre>\n<p>LinkedIn Mapping <code>@context<\/code>:<\/p>\n<pre class=\"brush:php\">{\r\n  \"firstName\": \"http:\/\/schema.org\/givenName\",\r\n  \"lastName\": \"http:\/\/schema.org\/familyName\",\r\n  \"headline\": \"http:\/\/schema.org\/jobTitle\"\r\n}<\/pre>\n<p>You can test it out:\u00a0<a href=\"http:\/\/jsbin.com\/godaro\/9\/edit?html,js,output\">JS Bin on jsbin.com<\/a><\/p>\n<h2>Conclusion<\/h2>\n<p>I now have three different but meaningfully normalized variations of\u2026 myself. I can merge these in a number of ways depending on which data store I\u2019m using. The keys all match now. They all have meaningful identifiers that, when followed, result in documentation for the key names. That\u2019s far more than I got from the raw <code>GET<\/code> requests to these various APIs.<\/p>\n<p>Next time you sit down to code up some JSON document \u2014 even one you think only you will use \u2014 consider mapping your key names to meaningful vocabulary terms via JSON-LD. Your future self will thank you.<\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td><span class=\"reference\">Reference: <\/span><\/td>\n<td><a href=\"http:\/\/blog.codeship.com\/json-ld-building-meaningful-data-apis\/\">JSON-LD: Building Meaningful Data APIs<\/a> from our <a href=\"http:\/\/www.webcodegeeks.com\/join-us\/wcg\/\">WCG partner<\/a> Florian Motlik at the <a href=\"http:\/\/blog.codeship.com\/\">Codeship Blog<\/a> blog.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Everybody loves JSON! However, JSON by itself is pretty meaningless. Well. It has meaning, but only to the original creator of that format. They can share that meaning via documentation, conversation, or usage, but those often exist in places far removed from the JSON document you\u2019re looking at. What if the meaning itself was encoded &hellip;<\/p>\n","protected":false},"author":147,"featured_media":920,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[351],"class_list":["post-11650","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-javascript","tag-json-ld"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>JSON-LD: Building Meaningful Data APIs - Web Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"Everybody loves JSON! However, JSON by itself is pretty meaningless. Well. It has meaning, but only to the original creator of that format. They can share\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webcodegeeks.com\/javascript\/json-ld-building-meaningful-data-apis\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JSON-LD: Building Meaningful Data APIs - Web Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"Everybody loves JSON! However, JSON by itself is pretty meaningless. Well. It has meaning, but only to the original creator of that format. They can share\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webcodegeeks.com\/javascript\/json-ld-building-meaningful-data-apis\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webcodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2016-03-28T09:11:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Benjamin Young\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Benjamin Young\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/json-ld-building-meaningful-data-apis\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/json-ld-building-meaningful-data-apis\/\"},\"author\":{\"name\":\"Benjamin Young\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/caa7920cfde365335817761979a72407\"},\"headline\":\"JSON-LD: Building Meaningful Data APIs\",\"datePublished\":\"2016-03-28T09:11:41+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/json-ld-building-meaningful-data-apis\/\"},\"wordCount\":1139,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/json-ld-building-meaningful-data-apis\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg\",\"keywords\":[\"JSON-LD\"],\"articleSection\":[\"JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webcodegeeks.com\/javascript\/json-ld-building-meaningful-data-apis\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/json-ld-building-meaningful-data-apis\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/javascript\/json-ld-building-meaningful-data-apis\/\",\"name\":\"JSON-LD: Building Meaningful Data APIs - Web Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/json-ld-building-meaningful-data-apis\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/json-ld-building-meaningful-data-apis\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg\",\"datePublished\":\"2016-03-28T09:11:41+00:00\",\"description\":\"Everybody loves JSON! However, JSON by itself is pretty meaningless. Well. It has meaning, but only to the original creator of that format. They can share\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/json-ld-building-meaningful-data-apis\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webcodegeeks.com\/javascript\/json-ld-building-meaningful-data-apis\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/json-ld-building-meaningful-data-apis\/#primaryimage\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/json-ld-building-meaningful-data-apis\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JavaScript\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/javascript\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"JSON-LD: Building Meaningful Data APIs\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"name\":\"Web Code Geeks\",\"description\":\"Web Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webcodegeeks\",\"https:\/\/x.com\/webcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/caa7920cfde365335817761979a72407\",\"name\":\"Benjamin Young\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/793ddd7d9809b369c04dbc92ea77a896112cc0a0e9a25417a43c17f4afb06f39?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/793ddd7d9809b369c04dbc92ea77a896112cc0a0e9a25417a43c17f4afb06f39?s=96&d=mm&r=g\",\"caption\":\"Benjamin Young\"},\"description\":\"Benjamin Young is a User Experience Engineer and Information Architect. He also organizes @RESTFest &amp; @OpenUpstate.\",\"url\":\"https:\/\/www.webcodegeeks.com\/author\/benjamin-young\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"JSON-LD: Building Meaningful Data APIs - Web Code Geeks - 2026","description":"Everybody loves JSON! However, JSON by itself is pretty meaningless. Well. It has meaning, but only to the original creator of that format. They can share","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webcodegeeks.com\/javascript\/json-ld-building-meaningful-data-apis\/","og_locale":"en_US","og_type":"article","og_title":"JSON-LD: Building Meaningful Data APIs - Web Code Geeks - 2026","og_description":"Everybody loves JSON! However, JSON by itself is pretty meaningless. Well. It has meaning, but only to the original creator of that format. They can share","og_url":"https:\/\/www.webcodegeeks.com\/javascript\/json-ld-building-meaningful-data-apis\/","og_site_name":"Web Code Geeks","article_publisher":"https:\/\/www.facebook.com\/webcodegeeks","article_published_time":"2016-03-28T09:11:41+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg","type":"image\/jpeg"}],"author":"Benjamin Young","twitter_card":"summary_large_image","twitter_creator":"@webcodegeeks","twitter_site":"@webcodegeeks","twitter_misc":{"Written by":"Benjamin Young","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webcodegeeks.com\/javascript\/json-ld-building-meaningful-data-apis\/#article","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/json-ld-building-meaningful-data-apis\/"},"author":{"name":"Benjamin Young","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/caa7920cfde365335817761979a72407"},"headline":"JSON-LD: Building Meaningful Data APIs","datePublished":"2016-03-28T09:11:41+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/json-ld-building-meaningful-data-apis\/"},"wordCount":1139,"commentCount":0,"publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/json-ld-building-meaningful-data-apis\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg","keywords":["JSON-LD"],"articleSection":["JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webcodegeeks.com\/javascript\/json-ld-building-meaningful-data-apis\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webcodegeeks.com\/javascript\/json-ld-building-meaningful-data-apis\/","url":"https:\/\/www.webcodegeeks.com\/javascript\/json-ld-building-meaningful-data-apis\/","name":"JSON-LD: Building Meaningful Data APIs - Web Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/json-ld-building-meaningful-data-apis\/#primaryimage"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/json-ld-building-meaningful-data-apis\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg","datePublished":"2016-03-28T09:11:41+00:00","description":"Everybody loves JSON! However, JSON by itself is pretty meaningless. Well. It has meaning, but only to the original creator of that format. They can share","breadcrumb":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/json-ld-building-meaningful-data-apis\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webcodegeeks.com\/javascript\/json-ld-building-meaningful-data-apis\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/javascript\/json-ld-building-meaningful-data-apis\/#primaryimage","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.webcodegeeks.com\/javascript\/json-ld-building-meaningful-data-apis\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"JavaScript","item":"https:\/\/www.webcodegeeks.com\/category\/javascript\/"},{"@type":"ListItem","position":3,"name":"JSON-LD: Building Meaningful Data APIs"}]},{"@type":"WebSite","@id":"https:\/\/www.webcodegeeks.com\/#website","url":"https:\/\/www.webcodegeeks.com\/","name":"Web Code Geeks","description":"Web Developers Resource Center","publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.webcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webcodegeeks","https:\/\/x.com\/webcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/caa7920cfde365335817761979a72407","name":"Benjamin Young","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/793ddd7d9809b369c04dbc92ea77a896112cc0a0e9a25417a43c17f4afb06f39?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/793ddd7d9809b369c04dbc92ea77a896112cc0a0e9a25417a43c17f4afb06f39?s=96&d=mm&r=g","caption":"Benjamin Young"},"description":"Benjamin Young is a User Experience Engineer and Information Architect. He also organizes @RESTFest &amp; @OpenUpstate.","url":"https:\/\/www.webcodegeeks.com\/author\/benjamin-young\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/11650","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/users\/147"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/comments?post=11650"}],"version-history":[{"count":0,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/11650\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media\/920"}],"wp:attachment":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media?parent=11650"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/categories?post=11650"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/tags?post=11650"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}