Last active
May 27, 2018 15:15
-
-
Save veganstraightedge/6179849 to your computer and use it in GitHub Desktop.
http://json-ld.org claims to be a format of JSON to organize and link data on the web. HTML already provides a way to link data with the <a href> tag and microformats (in this case h-card and xfn) already provide a way to add additional machine readable semantics.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"@context": "http://json-ld.org/contexts/person.jsonld", | |
"@id": "http://dbpedia.org/resource/John_Lennon", | |
"name": "John Lennon", | |
"born": "1940-10-09", | |
"spouse": "http://dbpedia.org/resource/Cynthia_Lennon" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="h-card"> | |
<a href="http://dbpedia.org/resource/John_Lennon" class="u-url u-uid p-name">John Lennon</a> | |
was born on | |
<time class="dt-bday" datetime="1940-10-09">October 9<sup>th</sup>, 1940</time> | |
and was married to | |
<a rel="spouse" href="http://dbpedia.org/resource/Cynthia_Lennon">Cynthia Lennon</a>. | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="h-card"> | |
<a href="http://dbpedia.org/resource/John_Lennon" class="u-url u-uid p-name">John Lennon</a> | |
<time class="dt-bday">1940-10-09</time> | |
<a rel="spouse" href="http://dbpedia.org/resource/Cynthia_Lennon">Cynthia Lennon</a> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
JSON is a common data format. The data parsed from Microformats 2 is described in terms of its JSON representation: http://microformats.org/wiki/microformats-2-parsing. Data is transformed between a variety of representations all the time - such as for this web page you're now reading, which is generated by interpolating the appropriate data from a database into the HTML. If people want a JSON view of my data without the HTML that they can use their JSON parsers / databases on, I don't see the harm in accommodating them.
You can see an example of this in action on e.g. http://calagator.org/events/1250464699, where the same data is available in microformats, microdata, JSON, and XML formats, or on my home page.