Simple Linked Data Deployment Tutorial — using RDF-Turtle Notation
Here is a simple tutorial that demonstrates the fact that Linked Data deployment is easier than is generally assumed.
Why?
I want observations that I document to be "webby", or "web-like", in nature; i.e., I want entity relationships that can be navigated by clicking on hyperlinks (HTTP URIs) using a follow-your-nose pattern.
What?
Describe how several entities are related, leveraging the data connectivity and access prowess of Linked Data and the descriptive power of RDF sentences:
- a lady named “Alice”
- a man named “Bob”
- a car manufacturer named “Example Cars & Co”
- an unbranded red automobile (car)
How?
To achieve my goal, I have to adhere to a few fundamental principles:
- Identify (name) entities using HTTP URIs so that anyone can look up their description documents — i.e., leverage the fact that HTTP URIs resolve to documents.
- Use RDF Language subject→predicate→object structured sentences/statements (using a variety of notations) to store entity descriptions in a document that’s also identified by an HTTP URI (more specifically in this case, a URL, since we are dealing with a document on an HTTP network).
- Repeat the process whenever I encounter something of interest — i.e., take notes about what I observe using simple RDF Language sentences.
Steps:
- Create a folder on my local drive.
- Create a document for each entity that I plan to describe —
doc1.ttl
for “Bob” [1],doc2.ttl
for “Alice”[2],org.ttl
for “Example Cars & Co” [3],product.ttl
for the automobile [4]. - Add content in the form of RDF statements (triples) that represent how these entities are related to each document.
- Copy all of my files to an HTTP accessible folder that’s published to a public (e.g., World Wide Web) or private (e.g., Intranet) network.
- Done!
Turtle Statements (using Nanotation)
doc1.ttl
— about Bob (friend of Alice who seeks a Car)
{
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ldp: <http://www.w3.org/ns/ldp#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix gr: <http://purl.org/goodrelations/v1#> .
@prefix wdrs: <http://www.w3.org/2007/05/powder-s#> .<>
a foaf:Document ;
foaf:name "A Document that describes a Person literally identified as 'Bob'" ;
dcterms:description "A collection of RDF sentences that describe a Person literally identified (or labeled) as 'Bob'" ;
foaf:primaryTopic <#bob> .<#bob>
a foaf:Person ;
foaf:name "Bob" ;
foaf:depiction <http://www.silhouettegraphics.net/wp-content/uploads/2013/10/young-man-silhouettegraphics-.jpg> ;
gr:seeks <product.ttl#CoolRedCar> ;
foaf:knows <doc2.ttl#alice> ;
wdrs:describedby <> .
}
doc2.ttl
— about Alice (friend of Bob who is employed by a Car Manufacturer)
{
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ldp: <http://www.w3.org/ns/ldp#> .
@prefix wdrs: <http://www.w3.org/2007/05/powder-s#> .
@prefix rel: <http://purl.org/vocab/relationship/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix gr: <http://purl.org/goodrelations/v1#> .<>
a foaf:Document ;
foaf:name "A Document that describes a Person literally identified as 'Alice'" ;
dcterms:description "A collection of RDF sentences that describe a Person literally identified (or labeled) as 'Alice'" ;
foaf:primaryTopic <#alice> .<#alice>
rdf:type foaf:Person ;
foaf:name "Alice" ;
foaf:knows <doc1.ttl#bob> ;
foaf:depiction <http://clipart-library.com/images/kiMb8ggKT.jpg> ;
rel:employedBy <org.ttl#exampleCars> ;
wdrs:describedby <> .
}
org.ttl
— about Car Maker (who manufactures Cars and employs Alice)
{
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ldp: <http://www.w3.org/ns/ldp#> .
@prefix gr: <http://purl.org/goodrelations/v1#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ldp: <http://www.w3.org/ns/ldp#> .
@prefix gr: <http://purl.org/goodrelations/v1#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix wdrs: <http://www.w3.org/2007/05/powder-s#> .<>
a foaf:Document ;
foaf:name "A Document that describes an Organization literally identified as 'Example Cars & Co.'" ;
dcterms:description "A collection of RDF sentences that describe an Organization literally identified (or labeled) as 'Example Cars & Co.'" ;
foaf:primaryTopic <#exampleCars> .<#exampleCars>
rdf:type gr:BusinessEntity , foaf:Organization ;
foaf:name "Example Cars & Co." ;
foaf:depiction <https://thumb1.shutterstock.com/display_pic_with_logo/3648824/532862638/stock-vector-silhouette-automated-production-line-robotic-factory-banner-532862638.jpg> ;
foaf:made <product.ttl#CoolRedCar> ;
wdrs:describedby <> .}
product.ttl
— about Car (Product made by Car Maker that employs Alice)
{
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ldp: <http://www.w3.org/ns/ldp#> .
@prefix gr: <http://purl.org/goodrelations/v1#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix wdrs: <http://www.w3.org/2007/05/powder-s#> .<>
a foaf:Document ;
foaf:name "A Document that describes a Product literally identified as 'Gift Wrapped Cool Red Car -- Brand Unknown'" ;
dcterms:description "A collection of RDF sentences that describe a Product literally identified (or labeled) as 'Gift Wrapped Cool Red Car -- Brand Unknown'" ;
foaf:primaryTopic <#CoolRedCar> .<#CoolRedCar>
rdf:type gr:ProductOrService ;
foaf:name "Gift Wrapped Cool Red Car -- Brand Unknown" ;
foaf:depiction <http://highroaddigital.com/wp-content/uploads/2015/01/wonanewcar.jpg> ;
foaf:maker <org.ttl#exampleCars> ;
wdrs:describedby <> .
}
illustration.ttl
— an additional document functioning as an index of all the entity description documents
{
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ns4: <http://kingsley.idehen.net/dataspace/person/kidehen#> .
@prefix ldp: <http://www.w3.org/ns/ldp#> .
@prefix wdrs: <http://www.w3.org/2007/05/powder-s#> .
@prefix gr: <http://purl.org/goodrelations/v1#> .
@prefix dcterms: <http://purl.org/dc/terms/> .<>
a foaf:Document ;
foaf:name "A Document about illustrating a simple Linked Data Deployment exercise" ;
dcterms:description "A collection of RDF sentences that describe a Linked Data Deployment exercise" ;
foaf:depiction <http://kingsley.idehen.net/DAV/home/kidehen/Public/Linked%20Data%20Documents/Tutorials/slide38_linked_data_network_v2_SPO%20_latest_relative_uris.png> ;
foaf:topic <GlossaryOfTerms.ttl>, <doc1.ttl>, <doc2.ttl>, <product.ttl>, <org.ttl> .
}
Additional Notes
RDF-Turtle and/or Nanotation
I am using Turtle (due to its human readability) as the notation for inscribing RDF statements to my documents.
By using nanotation, I am able to use this document (this Medium post) as a 5-Star Linked Data source, as you will see if you install our Structured Data Sniffer extension and/or via the depiction below.
Using Relative URIs is the key to simple Linked Data Deployment. The HTTP Fragment Identifier is a powerful feature that enables HTTP URIs (Hyperlinks) to identify anything. More importantly, it enables their use when identifying the subject, predicate, and object of an RDF sentence; i.e., this is what makes the notion of a Semantic Web viable.
Due to what’s outlined above, I am able to deploy this Linked Data Deployment tutorial using the age-old File Create, Save, Copy, and Share pattern across the proprietary storage services provided by Dropbox, Google Drive, Microsoft OneDrive, Amazon S3, etc, starting from my local file system.
Conclusion
By following the steps outlined above, you would have successfully described how four entities (two people, a company, and a product) are related. Even better, you would have achieved the goal of making your effort native to the Web; i.e., your document viewers (human or bots) can simply follow links presented in your documents to better understand the information encoded in the entity relationships you’ve represented in RDF sentences.
At this juncture, I strongly encourage you to watch this video excerpt from a recent documentary about Tim Berners-Lee that sheds light on the inspiration and insights that lead to the creation of the platform known as the World Wide Web.
Links
doc1.ttl
— document that describes “Bob”doc2.ttl
— document that describes “Alice”org.ttl
— document that describes “Example Cars & Co.”product.ttl
— document that describes an automobile- My HTTP accessible folder — which contains each description document while also being exposed to the World Wide Web
- Google Drive Folder mounted to an ODS-Briefcase Folder for Linked Data Deployment
- Microsoft OneDrive Folder mounted to an ODS-Briefcase Folder for Linked Data Deployment
- Amazon S3 Bucket mounted to an ODS-Briefcase Folder for Linked Data Deployment
- Rackspace Drive mounted to an ODS-Briefcase Folder for Linked Data Deployment
- Dropbox Folder mounted to an ODS-Briefcase Folder for Linked Data Deployment
- Box Folder mounted to an ODS-Briefcase Folder for Linked Data Deployment
Related
Here are some tools that enable viewing and exploration of Linked Data using existing browsers:
- Simple Linked Data Deployment Tutorial using JSON-LD Notation
- Using the Briefcase module of our ODS (OpenLink Data Spaces) platform to mount 3rd Party Storage Services (Google Drive, Dropbox, Microsoft OneDrive, Amazon S3, and others)
- About Nanotation — a mechanism for embedding RDF sentences (using RDF-Turtle or JSON-LD notations) wherever plain text is accepted.
- OpenLink Data Explorer — browser extensions for all the major browsers, which are useful in situations where the document publisher doesn’t generate HTML based representations of your description content
- URIBurner Service — a free service for hooking your existing content into the Linked Open Data cloud
- Understanding Data — a presentation that explains what Data actually is and how it’s ultimately about digital terms, statements, and collections of statements (like paragraphs in natural language)
- Revisiting Linked Data meme using Natural Language anecdote — RDF subject→predicate→object statements (triples) are simply digital renditions of natural language sentences; both represent data, albeit in different computing realms
- Linked Data in a Single Slide — a slide from a presentation by Tim Berners-Lee that showcases HTTP Denotation and Connotation duality via the use of fragment Identifier (
#
) part of an HTTP URI - Excerpts from documentary about Tim Berners-Lee and the invention of the Web — a shim that brought the Internet to the masses