jzhao.xyz


.
\_.
/


RDF

Last updated June 9, 2022

RDF is a standard model for data interchange on the Web

RDF can be understood as a linking structure which forms a directed, labeled graph, where the edges represent the named link between two resources, represented by the graph nodes.

# RDF Triple

RDF extends the linking structure of the Web to use URIs to name the relationship between things as well as the two ends of the link (this is usually referred to as a “triple”)

# Turtle

A textual syntax for RDF called Turtle that allows an RDF graph to be completely written in a compact and natural text form, with shorthands for common usage patterns and datatypes

  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15  @base . @prefix rdf: . @prefix rdfs: . @prefix foaf: . @prefix rel: . <#green-goblin> rel:enemyOf <#spiderman> ; a foaf:Person ; # in the context of the Marvel universe foaf:name "Green Goblin" . <#spiderman> rel:enemyOf <#green-goblin> ; a foaf:Person ; foaf:name "Spiderman", "Человек-паук"@ru . 

# JSON-LD

JSON-LD document is both an RDF document and a JSON document and correspondingly represents an instance of an RDF data model

 1 2 3 4 5 6 7  { "@context": "[https://json-ld.org/contexts/person.jsonld](https://json-ld.org/contexts/person.jsonld)", "@id": "[http://dbpedia.org/resource/John_Lennon](http://dbpedia.org/resource/John_Lennon)", "name": "John Lennon", "born": "1940-10-09", "spouse": "[http://dbpedia.org/resource/Cynthia_Lennon](http://dbpedia.org/resource/Cynthia_Lennon)" }