Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

How RDFa works


Published on

How RDFa Works. Part of an introductory workshop on RDFa and its relevance. Session 2/4.

Published in: Technology
  • Be the first to comment

How RDFa works

  1. 1. How RDFa works
  2. 2. How does RDFa work Session 2/4
  3. 3. An RDFa basics tutorial by Manu Sporny
  4. 4. Real metadata Resource description framework ‣ RDF is a generic "way" of using definitive metadata with web resources. ‣ RDF describes "things" (entities, defined by uniform resource identifiers, URIs) by assigning properties and corresponding values—statements are known as "triples" consisting of [subject] [predicate] [object]. ‣ The predicate URI usually references a term in a standard metadata vocabulary, resulting in unambiguous meaning. ‣ Any part of the triple can be a URI and URIs can point to other URIs that can be read using HTTP and extended (or related) in other web resources, thus a scalable model and very flexible.
  5. 5. RDFa distiller Extract RDF from HTML + RDFa W3C service to identify and list RDF from a web page ‣ using web address, local file or direct text inputs ‣ provides “clean” view of data hierarchy ‣ enables simple check on markup validation *and* intended meaning
  6. 6. Distilled RDFa page <?xml version="1.0" encoding="utf-8"?> <rdf:RDF xmlns:rdf="" xmlns:rdfs="" xmlns:v="" xmlns:xhv="" xmlns:xml="" > <v:Person> <v:nickname>mungeo</v:nickname> <v:address> <v:Address> <v:region>Ulster</v:region> <v:locality>Donegal</v:locality> </v:Address> </v:address> <v:url rdf:resource=""/> <v:name>George Munroe</v:name> <v:title>consultant trainer</v:title> <v:affiliation>Netskills</v:affiliation> </v:Person> </rdf:RDF> RDFa
  7. 7. Validating the RDF extracted from an RDFa file and exploring the data structure ‣ obtain a tabular description of entity classes and corresponding properties ‣ list inherent RDF triples ‣ visualise relationships with simple graphical representations
  8. 8. View RDF triples within RDF file RDFa
  9. 9. View graph of entities and properties RDFa
  10. 10. Practical exercise Extracting RDF from RDFa ‣ open the W3C RDFa distiller service with your web browser ‣ use the “Distill by file upload” option, select your sample RDFa file and “Go!” ‣ view the page source of the output file and note the RDF tagging ‣ copy all of the page source of the output file (RDF) ‣ open the W3C RDF validation service with your web browser ‣ use the “Check by direct input” option and paste in your RDF source ‣ select “Triples and graph” from the “Display result options” section ‣ click the “Parse RDF” button and explore the RDF triples and graph produced by selecting “Grid view” and “SVG graph” ‣ if time permits repeat the above process with the W3C RDF primer sample file ( only use the validator directly by selecting the “Check by URI” option and supplying the distiller service address with the sample RDFa file in a query string as follows: RDFa/primer/alice-example.html
  11. 11. Metadata vocabularies The importance of shared metadata Everyone (and every computer) must have a common understanding of what particular entities and properties actually are ‣ concept of XML namespaces, used to make descriptions of entity classes and corresponding properties available via the web ‣ these descriptions supplied as RDF (or RDFa) files with a URL (URI) And there’s more to it than just a flat list of entities and properties ‣ a real understanding involves being aware of the relationships between entity classes as well as what properties are associated with an entity ‣ possibly a very complex “ontology” but built very simply from triples where the object of one triple may be the subject of another RDFa
  12. 12. Namespaces These namespaces are used to describe entities in X number of documents Namespaces (819 known namespaces) Number of documents 1,261,416 645,210 584,781 451,113 252,361 183,228 157,659 117,621 64,281 50,514
  13. 13. Entities The number of each entity type known by Entity types (10,500 known entity types) Count 19,015,352 5,115,311 1,418,899 999,893 753,812 644,652 626,684 585,188 446,664 374,456
  14. 14. Exploring vocabularies Commonly used metadata vocabularies Google (person, organisation, review, event, recipe) ‣ FOAF (Friend Of A Friend) ‣ GoodRelations (ecommerce) ‣ Dublin Core (generic document) ‣ Creative Commons (licensing) ‣ SKOS (Simple Knowledge Organisation System) ‣ RDFa
  15. 15. Viewing complex vocabularies—ontologies Use the OpenLink Data Explorer extension in Firefox
  16. 16. Exploring vocabularies Digging into metadata vocabularies Use the Firefox browser with OpenLink Data Explorer extension and/ or W3C RDF validator and grapher online service to view the following vocabularies: ‣ Dublin Core at: ‣ GoodRelations at: Use the pyRdfa distiller service to extract and view the RDF vocabulary information from the following descriptions: ‣ FOAF at: ‣ Creative Commons at:
  17. 17. RDFa tools Summary of useful RDFa related tools RDFa distiller (extract pure RDF from HTML + RDFa) ‣ ‣ get RDF directly from using single address RDF validator and grapher ‣ OpenLink Data Explorer extension for Firefox ‣ List global namespaces and entities ‣ RDFa