<h1>Resource Description Framework</h1>
Resource Description Framework (RDF) is a family of (link: "W3C")[<exp><em>W3C</em> (World Wide Web Consortium)</exp>] specifications which originally developed as a general metadata model.
Data on the web is not always easy to <a target="_blank" href="http://linkeddatabook.com/editions/1.0/#htoc3">"discover, access, integrate, and use"</a>. RDF is part of a larger set of initiatives seeking to standardize and improve the availability of data on the web, principally through Web APIs and user agents like web crawlers. RDF is a technology used to publish (link: "\"Linked Data\".")[Linked Data. <exp>Linked Data is a method of exposing, sharing, and connecting data on the Semantic Web using HTTP Uniform Resource Identifiers (URIs) and RDF.</exp>]
The RDF data model is based on the assertion of statements which take the form of "triples". Just like very simple natural language sentences, these triple statements include a subject, a predicate, and an object. The components of a triple statement are made up of URIs, or in the case of objects, they can be either URIs or data literals, "strings". Referring to an object class or property by its URI instead of it's natural language name assists us in the tricky task of unambiguously expressing information, since <a target="_blank" href="http://babelnet.org/synset?word=bn:00010720n">"things"</a> are referenced in place <a target="_blank" href="https://en.wikipedia.org/wiki/Buffalo_buffalo_Buffalo_buffalo_buffalo_buffalo_Buffalo_buffalo">"strings"</a>.
<h3>Triple statements can be chained together in order to form knowledge graphs. For example, consider how <i>1)</i> and <i>2)</i> represent the same information:</h3>
<h4>1)</h>
<em>"There is a music group called Spoon."</em>
<h4>2)</h4>
<img src="spoon.png">
<h3>Here's another example:</h3>
<h4>1)</h4>
<em>"Richard Cyganiak is a person who is based in Berlin, a German city with a population of 3,405,259. Hamburg and Muenchen are also cities in Germany."</em>
<h4>2)</h4>
<img src="cygri.gif">
<h3>And for good measure, here's another:</h3>
<img src="example-graph.jpg">
RDF is a method for conceptualizing and representing graph data models but does not describe any particular data serialization format. There are multiple data serialization formats for encoding RDF data which include (link: "JSON-LD,")[
<em>JSON-LD</em><exp>, a syntax for encoding Linked Data using JSON, JavaScript Object Notation <a target="_blank" href="https://www.w3.org/TR/json-ld/">
(more info)</a></exp>
] (link: "RDF/XML,")[
<em>RDF/XML</em><exp>, an XML-based syntax for encoding RDF <a target="_blank" href="https://www.w3.org/TR/rdf-syntax-grammar/">
(more info)</a></exp>
](link: " and Turtle")[
<em>Turtle</em><exp>, a terse syntax for RDF, meant to be easier for humans to read <a target="_blank" href="https://www.w3.org/TR/turtle/">
(more info)</a></exp>].
Another syntax which we'll be go into a little further here is <em>[[RDFa]]</em>.
<h2>Resource Description Framework in Attributes (RDFa)</h2>
<em>RDFa</em> was created as a way to add structured data to documents in various XML-based languages, including XHTML, HTML, and SVG. <em>RDFa</em> generalizes the attributes on meta and link elements, which allows them to be used on any element, not just meta and link. This permits their use in the body of a document as well as in the head.
The web was designed primarily to host content with human readability in mind, but it's becoming increasingly important for documents on the web to be machine-readable as well. The use of RDFa with HTML allows human visible text to have structured data woven into it. This empowers content creators, who may have limited privleges to the authoring system they are using, with the ability to semantically annotate content right in their HTML code.
<em>RDFa</em> provides a number of beginner and advanced features that enable web authors to express complex data, such as explicit representation of named entities like people and companies, as well as relationships.
Currently there are two flavors of <em>RDFa</em>, <em>RDFa 1.1 Core</em> and <em>RDFa 1.1 Lite</em>. <em>RDFa 1.1 Lite</em> is simpler to implement as it only uses a minimal subset of the attributes found in (link: "RDFa 1.1 Core.")[<exp><em>RDFa 1.1 Core</em>.
For more information about RDFa 1.1 Core, see the specification for it <a target="_blank" href="https://www.w3.org/TR/rdfa-core/">here</a>.</exp>
]
For the purpose of this presentation, we'll address [[RDFa 1.1 Lite]].
<h1>RDFa 1.1 Lite</h1>
<em>RDFa 1.1 Lite</em> uses a subset of attributes available in the full RDFa specification, <em>RDFa 1.1 Core</em>. It provides a gentler introduction to authors who are new to structured data.
One benefit of starting out with <em>RDFa 1.1 Lite</em> is that it is upwards compatible, meaning you can start incorporating additional attributes from <em>RDFa 1.1 Core</em> at any time, without having to change your existing RDFa 1.1 Lite attributes.
Something that characterizes encoding RDF data is being able to separation of concerns between what is being encoded and how. <em>RDFa</em> and the other syntaxes mentioned provide the means for representing RDF data models, but for providing description of what those models are actually about involves the use of independent resources such as <em>vocabularies</em> and <em>ontologies</em>.
Speaking of attributes, let's go ahead and take a look at [[the ones that are available->attributes]] in <em>RDFa Lite</em>.
<h1>RDFa Lite Attributes</h1>
<em>RDFa 1.1 Lite</em> uses five attributes which can be used to embed semantic meaning into HTML documents.
Consider the following paragraph about an imaginary pet store:
<i>Pets R Us is a pet store located on 345 Frisbee Alley in Katinatrei, KS. As payment, they only accept credit cards.</i>
Below are brief definitions of these five attributes which reference example at the bottom of the page to demo how they can be used to semantically enrich the pet store paragraph:
(link:"<h2>vocab</h2>")[
<h2>vocab</h2>
The <em>vocabulary attribute</em> allows us to point to a specific vocabulary on the web that uses terms we want to use.
Look for <code>vocab="schema.org/"</code> in the example below.
](link:"<h2>typeof</h2>")[
<h2>typeof</h2>
The <em>type of attribute</em> allows us to do one of the things we do best, name what "type of" a thing a thing is.
Look for <code>typeof="PetStore"</code> in the example below
] (link:"<h2>property</h2>")[
<h2>property</h2>
<em>Property attributes</em> allow properties of the thing (in this case the pet store) to be pointed out to search engines.
Look for the <code>property=".."</code> attributes in the example below.
] (link:"<h2>resource</h2>")[
<h2>resource</h2>
You may want to describe more than one thing on your web page. <em>Resource attributes</em> can be assigned to distinguish multiple resources on a page, similarly to how identifiers are assigned to parts of a page using the id attribute in HTML.
See where <code>resource="#PetsRUs"</code> occurs in the example below.
] (link:"<h2>prefix</h2>")[
<h2>prefix</h2>
You may end up in a situation where you want to use more than one vocabulary to describe a resource on a page. When this happens, you can use the <em>prefix attribute</em> to distinguish different vocabularies in use.
See <code>prefix="gr: http://purl.org/goodrelations/v1/"</code> in the example below.
]
<h1>RDFa Example</h1>
<code>
```<p vocab="schema.org/" prefix="gr: http://purl.org/goodrelations/v1/" resource="#PetsRUs" typeof="PetStore">
<span property="name">Pets R Us</span> is a pet store located on <span property="address">345 Frisbee Alley in Katinatrei, KS. </span>As payment, they only accept <span property="gr:acceptedPaymentMethods">credit cards</span>.
</p>```
</code>
<h3>Now that we've briefly gone over the mechanics of RDFa, let's take a closer look at [[vocabularies]].</h3><h1>Linked Data Vocabularies</h1>
There are numerous vocabularies available to semantically enrich web resources!
There were two vocabularies used in the previous example: (link:"schema.org")[
"<em>Schema.org</em> is a collaborative, community activity with a mission to create, maintain, and promote schemas for structured data on the Internet. In addition to people from the founding companies (Google, Microsoft, Yahoo and Yandex), there is substantial participation by the larger Web community, through public mailing lists such as public-vocabs@w3.org and through GitHub. See the releases page for more details."
Source: <a target="_blank" href="http://schema.org/">http://schema.org/</a>
] & (link:"Good Relations")[
"<em>GoodRelations</em> is the most powerful vocabulary for publishing all of the details of your products and services in a way friendly to search engines, mobile applications, and browser extensions. By adding a bit of extra code to your Web content, you make sure that potential customers realize all the great features and services and the benefits of doing business with you, because their computers can extract and present this information with ease."
Source: <a target="_blank" href="http://wiki.goodrelations-vocabulary.org/Main_Page">http://wiki.goodrelations-vocabulary.org/Main_Page</a>]
(link:"But wait, there's more!")[
No matter what kind of data you want to describe on the web, it's likely there is an existing vocabulary which you can reuse. A useful place to explore what is currently out there is <a target="_blank" href="http://lov.okfn.org/dataset/lov"><em>Linked Open Vocabularies (LOV)</em></a>. I challenge you to visit <em>LOV</em> and locate vocabularies and terms which match your interests!
(link:"Want to learn more about RDFa and other Linked Data goings-ons?")[<em>You do?! Awesome!</em> Check out this list of [[resources]] that might help you get started. If you're on the fence, you may want to take a look at the project pages for <a href="http://babelnet.org/">http://babelnet.org/</a> and <a href="http://dbpedia.org/">http://dbpedia.org/</a>, which I think are particullary cool illustrations of what can be done with Linked Data. Thanks for clicking through!]
]
<h1>RDFa in HTML</h1>
This is a whirlwind tour of <em>RDFa</em> in HTML meant to offer a small taste of why it exists, what it can do, and hopefully pique your interest to learn more.
This presentation will cover:
<ul>
<li>Resource Description Framework (RDF)</li>
<li>Resource Description Framework in Attributes (RDFa)</li>
<li>RDFa 1.1 Core vs. RDFa 1.1 Lite</li>
<li>RDFa Attributes</li>
<li>Linked Data Vocabularies</li>
</ul>
Let's get started by first introducing [[RDF]].<h1>Resources</h1>
Here's a random collection of potentially useful links. It's in no particular order at the moment.
<a target="_blank" href="http://patterns.dataincubator.org/book/">http://patterns.dataincubator.org/book/ </a>
<a target="_blank" href="https://json-ld.org/">https://json-ld.org/ </a>
<a target="_blank" href="https://www.w3.org/DesignIssues/LinkedData.html">https://www.w3.org/DesignIssues/LinkedData.html </a>
<a target="_blank" href="http://ldodds.com/foaf/foaf-a-matic">http://ldodds.com/foaf/foaf-a-matic </a>
<a target="_blank" href="https://developers.google.com/search/docs/guides/intro-structured-data">https://developers.google.com/search/docs/guides/intro-structured-data </a>
<a target="_blank" href="http://lov.okfn.org/dataset/lov">http://lov.okfn.org/dataset/lov </a>
<a target="_blank" href="https://www.w3.org/TR/rdfa-core/">https://www.w3.org/TR/rdfa-core/ </a>
<a target="_blank" href="https://medium.com/metaphorical-web/how-structured-is-your-data-4e6fb25cba5a">https://medium.com/metaphorical-web/how-structured-is-your-data-4e6fb25cba5a </a>
<a target="_blank" href="https://rdf-translator.appspot.com/">https://rdf-translator.appspot.com/ </a>
<a target="_blank" href="https://www.w3.org/TR/rdfa-primer/">https://www.w3.org/TR/rdfa-primer/ </a>
<a target="_blank" href="https://www.w3.org/TR/rdfa-lite/">https://www.w3.org/TR/rdfa-lite/ </a>
<a target="_blank" href="https://www.w3.org/TR/rdfa-core/">https://www.w3.org/TR/rdfa-core/ </a>
<a target="_blank" href="https://www.w3.org/TeamSubmission/turtle/">https://www.w3.org/TeamSubmission/turtle/ </a>
<a target="_blank" href="https://rdf-translator.appspot.com/">https://rdf-translator.appspot.com/ </a>
<a target="_blank" href="https://www.w3.org/RDF/Validator/">https://www.w3.org/RDF/Validator/ </a>
<a target="_blank" href="https://project-open-data.cio.gov/v1.1/schema/">https://project-open-data.cio.gov/v1.1/schema/ </a>
<a target="_blank" href="http://lov.okfn.org/dataset/lov/about">http://lov.okfn.org/dataset/lov/about" </a>