Movatterモバイル変換


[0]ホーム

URL:


Peter Mika, profile picture
Uploaded byPeter Mika
PPT, PDF1,264 views

Publishing data on the Semantic Web

The document discusses several options for publishing data on the Semantic Web. It describes Linked Data as the preferred approach, which involves using URIs to identify things and including links between related data to improve discovery. It also outlines publishing metadata in HTML documents using standards like RDFa and Microdata, as well as exposing SPARQL endpoints and data feeds.

Related topics:

Embed presentation

Downloaded 49 times
Publishing Data on the Semantic Web Peter Mika  Researcher, Data Architect Yahoo! Research
Intro to the Semantic Web
Vague, but exciting… Berners-Lee and the dawn of the Web
Semantic Web Publish information in a way that is easier to process for machines Web of Data instead of Web of Documents Two main architectural challenges A common format for sharing data Sharing the meaning of data Through social means (shared schemas) By using powerful schema languages Semantic Web standards from W3C Languages (RDF, OWL, RIF) Serializations (RDF/XML, RDFa) Protocols (SPARQL, HTTP) Semantic Web research into knowledge representation and reasoning, data integration, data quality and many other topics Community efforts to publish data and develop schemas
RDF (Resource Description Framework) The basic data model of the Semantic Web A universal model to capture all sorts of data: networks, relational, object-oriented… Basic unit of information is a triple  A tuple of (subject, predicate, object) Example: (Joe, loves, Mary) Each triple gives the value of a property for a given resource or relates two objects to one another Object is either a resource or a literal An RDF model is a set of triples Ordering of statements in an RDF document is irrelevant (unlike XML)
Resources vs. literals Resources are identified by a URI or otherwise the are  called a blank node URIs are a generalization of URLs Notation:  <http://www.example.org/Person>  or  ex:Person Literals have an optional language and datatype (string, integer etc.) Literals can not be subjects of statements Datatypes are identified by URIs, e.g. XML Schema datatypes Two literals are the same if their components are the same Notation:  “Joe B.”  or  Joe@en^^http://…#string
Advanced topic: Resources vs Literals Resources are objects, Literals are strings Resources are instances of classes, Literals have datatypes Whether something is a resource or literal sometimes depends on the detail of modeling <meta property=“myvocab:knows”>Paris Hilton</meta> <item rel=“foaf:knows”> <meta property=“foaf:name”>Paris Hilton</meta> </item> You cannot make statements about literals (literals are always the object in a triple) Resources can carry a globally unique identifier, literals have no identity Web resources such as documents and images are resources <item rel=“rdfs:seeAlso” resource=“http://www.some.related.page.com/”/> <item rel=“foaf:img” resource=“http://photosite.example.org/photo.jpg”/> When in doubt: it’s a resource
Graphical and textual notation A number of ways to serialize an RDF model into an RDF document RDF/XML, Turtle, N3, N-Triples Example: http://www.cs.vu.nl/~pmika/foaf.rdf my:Joe “ Joe A.” name foaf:Person type
Informational versus non-informational resources Informational resource: an HTML document, image, any other file on the Web Retrievable in its entirety from the Web Retrieving it can return a 200 OK Conceptual (non-informational) resource: a person, an event, a place, etc. A description of it may be retrievable from the Web When identified by a URL, retrieving it should return a 303 Redirect Never confuse a webpage with what it describes! You are not your Facebook profile: one is a document, the other is a person. A document has properties such as byte-size, media-type etc, a person has name, age, etc. Make sure you don’t use the URL of an existing webpage as the URI of a resource
Vocabularies (ontologies) Ontologies are collections of classes and properties used to describe objects in a particular domain OWL (the Web Ontology Language) is the standard ontology language OWL has an RDF serialization: ontologies are part of the Semantic Web Classes can be described by sub- and superclasses, required properties Class membership in RDF is expressed using the rdf:type property An instance can have multiple classes (types) A class can have multiple superclasses Properties can be described by their domain, range, cardinalities, etc.
RDF is designed for distributed systems URIs provide web-wide global identification across documents A resource may be described by multiple documents We know it’s the same resource because the same URI is used or through reasoning (advanced topic…) URIs are intented to be reused Unique, but not single identifiers: two URIs may denote the same thing URIs are dereferencable (can be retrieved) A well-behaved URI returns a description of the resource  Provides authority: the definition of foaf:Person lives at that URI Ontologies can be looked up as well Typically at the root of the URIs, also known as the namespace Example:  http://xmlns.com/foaf/0.1/Person  redirects to the specification
URIs implicitly link data together  (#joe, #name, “Joe A.”) (#joe, #email, mailto:joe@joe.com) (#mary, name, “Mary B.”) (#mary, gender, “female”) (#joe, #loves, #mary) Joe’s homepage A dating site Mary’s homepage (#name, #type, #Property) (#name, #domain, #Person) Schema doc
Put together, triples form a single ‘global’ graph “ Joe A.” #joe #name “ joe@joe.com” #email #mary #loves “ Mary B.” “ female” #name #gender
Publishing for the Semantic Web
Motivation Why publish data on the (Semantic) Web? In a business context Increase the potential for linking, reuse and aggregation Drive traffic back from other sites on the Web Pre-competitive data integration (e.g. drug discovery) Make your data more easily findable Drive traffic from search engines In a non-profit context Increase industry or government transparency, accountability Support research and education by making data accessible
Publishing and consuming data on the Semantic Web Publishing data involves Deciding in which format to publish your data Deciding which schema (ontology, vocabulary) to use OR you can create a new schema and publish it as well Multiple ways of publishing RDF data: Linked Data Metadata in HTML SPARQL endpoints Feeds GRDDL Automated tools Note: you may implement more than one
Option 1: Linked Data A web of RDF documents in parallel to the current Web Most often implemented as wrappers around databases or APIs The four rules of Linked Data: Use  URIs  to identify things. Use  HTTP  URIs so that these things can be referred to and looked up (&quot; dereference &quot;) by people and  user agents . Provide useful information about the thing when its URI is dereferenced, using standard formats such as RDF-XML. Include links to other, related URIs in the exposed data to improve discovery of other related information on the Web. . . . #PeterM #Bud born “ Peter Mika” label “ Budapest” label #Hun capital-of “ 2,000,000” population #PeterM #Bud born “ Peter Mika” label “ Budapest” label #Hun capital-of “ 2,000,000” population #PeterM #Bud born “ Peter Mika” label “ Budapest” label #Hun capital-of “ 2,000,000” population
Option 1: Linked Data Advantages:  No change to the publishing of the HTML documents Data can be published by third party (e.g. Dbpedia) Disadvantages: Web servers need to be configured to properly handle URIs that identify concepts instead of documents Not favored by search engines  Lack of use cases Crawling needs to be changed Authority is difficult to determine Tools Triple stores (Virtuoso, Oracle etc.) and front-ends ( Pubby ) RDB-to-RDF mappers (e.g.  D2RQ ,  Triplify ) Validators ( Vapour ) Linked Data browsers ( many )
Linked Data as a movement Rapidly growing community effort to (re)publish open datasets as Linked Data In particular, scientific and government datasets see  linkeddata.org
Option 2: Metadata in HTML Using microformats, RDFa, Microdata (more later) Advantages: Data and document are always in sync Browser plug-in friendly Search engine friendly Copy-paste friendly Tools:  XML editors (e.g. Oxygen) Triplr RDFa Distiller RDFa bookmarklet Ubiquity RDFa plugin Optimus microformat parser Examples: many, including SlideShare, YouTube, LinkedIn, Digg, Myspace, Facebook… Peter Mika was born in Budapest. Peter Mika was born in Budapest. #PeterM #Bud born “ Peter Mika” label “ Budapest” label #Hun capital-of “ 2,000,000” population #PeterM #Bud born “ Peter Mika” label “ Budapest” label #Hun capital-of “ 2,000,000” population
Option 3: SPARQL endpoints An API for accessing RDF databases on the Web A query language and an HTTP protocol Advantages: Flexible access: make any query you want Also possible to expose a traditional RDBMs via a wrapper Disadvantages: For the publisher: cost of supporting arbitrary queries For the search engine: discovery of SPARQL servers is unsolved Tools:  Triple stores (Oracle, Virtuoso, Sesame, Jena, OWLIM etc.) RDB-to-RDF mappers such as D2RQ and Triplify #PeterM #Bud born “ Peter Mika” label “ Budapest” label #Hun capital-of “ 2,000,000” population
Option 4: Feeds Disadvantages: No standard feed format for RDF: data needs to be formatted and often manually submitted for each search engine Advantages Submit your data without making it public Competing and incompatible formats DataRSS (Yahoo!) Google Data Protocol  Open Data Protocol (Microsoft) . #PeterM #Bud born “ Peter Mika” label “ Budapest” label #Hun capital-of “ 2,000,000” population #PeterM #Bud born “ Peter Mika” label “ Budapest” label #Hun capital-of “ 2,000,000” population #PeterM #Bud born “ Peter Mika” label “ Budapest” label #Hun capital-of “ 2,000,000” population
Option 5: Publishing a transformation of the data  Publish the rule to transform the HTML to structured data GRDDL  is a standard for linking an HTML page to a transformation that produces RDF data Advantages No change to the page Disadvantages Transformation needs to be executed to get to the data Not much support by search engines Tools Intel MashMaker Dapper Glue API from AdaptiveBlue <XSLT> xx yy 1 2
Option 6: Automatic markup Web services that annotate HTML automatically Advantages No manual effort Disadvantages Limited to finding relevant entities in text Tools OpenCalais Zemanta API Peter Mika was born in Budapest. <person>Peter Mika</person> was born in <location>Budapest</location>.
Example:  Zemanta A personal writing assistant for bloggers Plugin for popular blogging platforms and web mail clients Analyzes text as you type and suggests hyperlinks, tags, categories, images and related articles API available with the same functionality
Choosing a vocabulary No vocabularies in many domains Books, movies, stuff people care about… Too many competing proposals in other domains Often versions of the same proposal Example: vocabularies for microformats Not maintained I cannot maintain your vocabulary for you Limited tool support Too many expert tools until now Many vocabularies are not designed for annotation Missing meeting point and social process An ontology is a  shared , formal representation of a domain
Choosing a vocabulary Search the Web or ask for advice on mailing lists [email_address] [email_address] Wikis semanticweb.org vocamp.org Beware of people who claim to have the vocabulary of everything Preferably you want something small and targeted Never a 100% fit    you will need to introduce vocabulary terms (classes and properties) Do not introduce new classes/properties in existing namespaces Example: the namespace http://xmlns.com/foaf/0.1/ is used by the FOAF project. Try not to introduce a new term without contacting the owner, i.e. the membership of the FOAF mailing list.
Advanced topic: creating a vocabulary Get advice on methodology vocamp.org and semanticweb.org Choose a namespace and a prefix Give sensible names, e.g. name it after your site, but don’t call it searchmonkey Namespace ends either with a slash or a hash Create   an RDF or OWL document describing your classes and properties Use an ontology editor such as Protégé 4.0 Follow naming conventions Publish your vocabulary Make sure the URIs of your properties and classes are resolvable E.g. myvocab:digicam should resolve to a document containing the definition of myvocab:digicam Convince others to adopt your vocabulary If you are in fishing, convince other fishing businesses
How do we build communities? www.vocamp.org
Metadata in HTML
Brief history of the Annotated Web 1995: HTML meta tags 1996: Simple HTML Ontology Extensions (SHOE) 1998: RDF/XML RDF/XML in HTML RDF linked from HTML 2003: Web 2.0 Tagging Microformats Metadata in Wikipedia Machine tags in Flickr 2005: eRDF  2008: RDFa 1.0 2011: RDFa 1.1 2012: Microdata?
HTML meta tags <HTML> <HEAD profile=&quot;http://dublincore.org/documents/dcq-html/&quot;> <META  name=&quot;DC.author &quot; content=&quot; Peter Mika &quot;> <LINK  rel=&quot;DC.rights  copyright&quot; href=&quot; http://www.example.org/rights.html &quot; />  <LINK  rel=&quot;meta&quot;  type=&quot;application/rdf+xml&quot; title=&quot;FOAF&quot;    href= &quot; http://www.cs.vu.nl/~pmika/foaf.rdf &quot;>  </HEAD>  … </HTML>
SHOE example  (Hefflin & Hendler, 1996)  <ONTOLOGY &quot;our-ontology&quot; VERSION=&quot;1.0&quot;>  <ONTOLOGY-EXTENDS &quot;organization-ontology&quot; VERSION=&quot;2.1&quot; PREFIX=&quot;org&quot; URL=&quot;http://www.ont.org/orgont.html&quot;>  <ONTDEF CATEGORY=&quot;Person&quot; ISA=&quot;org.Thing&quot;>  <ONTDEF RELATION=&quot;lastName&quot; ARGS=&quot;Person STRING&quot;>  <ONTDEF RELATION=&quot;firstName&quot; ARGS=&quot;Person STRING&quot;>  <ONTDEF RELATION=&quot;marriedTo&quot; ARGS=&quot;Person Person&quot;>  <ONTDEF RELATION=&quot;employee&quot; ARGS=&quot;org.Organization Person&quot;> </ONTOLOGY >   <HEAD> <META HTTP-EQUIV=&quot;Instance-Key&quot; CONTENT=&quot;http://www.cs.umd.edu/~george&quot;>  <USE-ONTOLOGY &quot;our-ontology&quot; VERSION=&quot;1.0&quot; PREFIX=&quot;our&quot; URL=&quot;http://ont.org/our-ont.html&quot;>  </HEAD> <BODY> <CATEGORY &quot;our.Person&quot;>  <RELATION &quot;our.marriedTo&quot; TO=&quot;http://www.cs.umd.edu/~helena&quot;>  <RELATION &quot;our.employee&quot;   FROM=&quot;http://www.cs.umd.edu&quot;>   My name is  <ATTRIBUTE &quot;our.firstName&quot;>  George  </ATTRIBUTE> <ATTRIBUTE &quot;our.lastName&quot;> Cook </ATTRIBUTE>  and I live at...
SHOE system
SHOE Text-based query interface
SHOE Graphical Query Interface
Example: Creative Commons Embedding CC license in HTML (now deprecated): <HTML> <HEAD>… </HEAD> <BODY> … <!–-   <rdf:RDF xmlns=&quot;http://creativecommons.org/ns#&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot;> <Work rdf:about=&quot;http://www.yergler.net/averages/&quot;> <dc:title>The Law of Averages</dc:title> <dc:description>...because eventually i&apos;ll be right...</dc:description> <license rdf:resource=&quot;http://creativecommons.org/licenses/by-nc/1.0/&quot; /> </Work> <License rdf:about=&quot;http://creativecommons.org/licenses/by-nc/1.0/&quot;> <requires rdf:resource=&quot;http://web.resource.org/cc/Notice&quot; /> <permits rdf:resource=&quot;http://web.resource.org/cc/Reproduction&quot; /> <permits rdf:resource=&quot;http://web.resource.org/cc/Distribution&quot; /> <prohibits rdf:resource=&quot;http://web.resource.org/cc/CommercialUse&quot; /> </License> </rdf:RDF> -->
Example: Creative Commons Current: rel attribute (HTML4) This work is licensed under a <a  rel=&quot;license&quot;  href=&quot;http://creativecommons.org/licenses/by/3.0/us/&quot;>Creative Commons Attribution 3.0 United States License</a>. Use of the “rel” attribute for semantic annotation is the birth of the microformat…
Microformats (μf) Agreements on the way to encode certain kinds metadata in HTML Reuse of semantic-bearing HTML elements Based on existing standards Minimality Microformats exist for a limited set of objects hCard (persons and organizations) hCalendar (events) hResume hProduct hRecipe Varying degrees of support and stability hCard and rel-tag are widely supported Community centered around microformats.org Specifications and discussions are hosted there
Microformats: limitations No shared syntax Each microformat has a separate syntax tailored to the vocabulary  No formal schemas Limited reuse, extensibility of schemas Unclear which combinations are allowed No datatypes No  namespaces, unique  identifiers  (URIs)  no interlinking mapping between instances is required Always appears in the HTML <body>
Example: the hCard microformat <cite  class=&quot;vcard&quot; > <a  class=&quot;fn url&quot;  rel=&quot;friend colleague met” href=&quot;http://meyerweb.com/&quot;> Eric Meyer</a> </cite> wrote a post (<cite> <a href=&quot;http://meyerweb.com/eric/thoughts/2005/12/16/tax-relief/&quot;> Tax Relief</a></cite>) about an unintentionally humorous letter he received from  the <span  class=&quot;vcard” > <a  class=&quot;fn org url&quot;  href=&quot;http://irs.gov/&quot;> Internal Revenue Service</a>  </span>.  <div  class=&quot;vcard&quot; >  <a  class=&quot;email fn&quot;  href=&quot;mailto:jfriday@host.com&quot;>Joe Friday</a>  <div  class=&quot;tel&quot; >+1-919-555-7878</div>  <div  class=&quot;title&quot; >Area Administrator, Assistant</div>  </div>
RDFa W3C standard for embedding RDF data in HTML documents A set of new HTML attributes to be used in head or body A specification of how to extract the data from these attributes  RDFa is just a syntax, you have to choose a vocabulary separately RDFa 1.0 is a W3C Recommendation since October, 2008 RDFa Primer RDFa 1.1 is a small update on RDFa to make it easier to use Currently  Working Draft (March 31, 2011) Updated version of the  RDFa Primer (April 19, 2011) RDFa API for accessing RDFa data in a webpage in the browser from JavaScript Currently  Working Draft (April 19, 2011)
RDFa 1.1 Changes New  vocab  attribute to define the default namespace for the document or subtree Profile documents  to define multiple namespace prefixes The  prefix  attribute as a recommended replacement of xmlns You can use URIs even where only CURIEs where allowed before RDFa 1.1 is backward compatible with RDFa 1.0 RDFa 1.1 is recommended if you want to use HTML5
When to use RDFa Choose microformats when you find a microformat that fits your needs and supported by your consumers Microformats are first option because they are simple Yahoo supports all major microformats, see the documentation It’s a common misconception that RDFa requires XHTML or that it’s compatible with HTML5 It’s compatible with HTML4, HTML5, XHTML If you find none that  perfectly  fits your needs then you need RDFa Microformats have a fixed schema: you can not add your own attributes Example: a social networking site with user profiles VCard is a good candidate, but for example it doesn’t have a way to express the user’s social connections You either live without this, or go with RDFa
RDFa intro: metadata in the header More info in the <html  prefix=&quot;og: http://ogp.me/ns#&quot; > <head> <title>The Trouble with Bob</title> <meta  property=&quot;og:title&quot; content=&quot;The Trouble with Bob&quot;  /> <meta  property=&quot;og:type&quot; content=&quot;text&quot;  /> <meta  property=&quot;og:image&quot; content=&quot;http://example.com/alice/bob-ugly.jpg &quot; /> ... </head>
RDFa intro: links with a flavor More info in the All content on this site is licensed under <a  rel=&quot;license&quot;  href=&quot;http://creativecommons.org/licenses/by/3.0/&quot;> a Creative Commons License </a>.
RDFa links: talking about subjects other than the page More info in the The trouble with Bob is that he takes much better photos than me:  <div  about=&quot;http://example.com/bob/photos/sunset.jpg&quot; >  <img src=&quot;http://example.com/bob/photos/sunset.jpg&quot; />  <span property=&quot;og:title&quot;>Beautiful Sunset</span> by <span property=&quot;dc:creator&quot;>Bob</span>.  </div>
RDFa links: talking about subjects other than the page More info in the <div  typeof=”foaf:Person&quot; >  <p property=”foaf:name&quot;> Alice Birpemswick </p>  <p> Email:  <a rel=”foaf:mbox” href=&quot;mailto:alice@example.com&quot;>  alice@example.com  </a>  </p>  <p> Phone:  <a rel=”foaf:phone&quot; href=&quot;tel:+1-617-555-7332&quot;>+1 617.555.7332</a>  </p>  </div>
The process of annotating with RDFa  Find a vocabulary that fits your needs and supported by your consumers A vocabulary describes a set of types and attributes within a given domain  If you don’t find a good candidate, extend an existing one or create a new one Annotate your page. Before you start, you might want to validate your page for (X)HTML conformance using the W3C’s  (X)HTML Validator  to reduce the chance of errors. Choose Document Type XHTML + RDFa. No specific tool support. If you have an HTML or XML editor that supports DTDs, you will have syntax checking and highlighting. Use the  RDFa Distiller  to validate which data can be extracted from your page. If you fancy, use the  RDF Validator  to graphically visualize the RDF graph that is outputted. Put the annotated page online The data will be extracted by Google/Bing/Yahoo the next time your page is crawled and indexed The data will be available to browser extensions, bookmarklets etc. See  http://rdfa.info/rdfa-implementations  for new tools and APIs
RDFa can be hard to get right… Validation problems can stop us from extracting data Use the W3C validator Use the right DOCTYPE declaration if using XHTML Set the encoding of your page properly (using HTTP headers or XML declaration) Prefixes need to be defined using the xmlns attribute Unless you are making statements about the document, set the subject using the about attribute Do not include HTML elements in literal values Incorrect: <div property=“foaf:name”><b>Peter Mika</b></div> Use absolute URIs as the value of the resource attribute Or make sure you specify HTML base
RDFa can be hard to get right… II. Be careful when using rel and typeof in combination because of the precedence rules BAD example: <div about=“#id”> <span property=“foaf:name“>Peter Mika</span> <span rel=“foaf:img“ typeof=“foaf:Image”> <span property=“dc:format”>jpg</span> … </span </div> To correct, you need to put the typeof inside the <span> node with rel=“foaf:img”
RDFa can be hard to get right… III. Typeof does two things at once: it creates a new subject resource and assigns the type to it BAD example: <div about=“#id”> <span property=“foaf:name“>Peter Mika</span> <span rel=“foaf:img“ resource=“http://www.example.org/photo.jpg”> <span typeof=“foaf:Image”>   <span property=“dc:format”>jpg</span> </span </span </div> To correct, you have to repeat the resource attiribute on the span node with the typeof
RDFa can be hard to get right… IV. Marking up <h1>: <h1 property=“dc:title”>My homepage</h1> NOT: <h1><div property=“dc:title”>My homepage</h1>   Marking up an image:  <span rel=”foaf:img&quot;>         <img alt=&quot;Alex&quot; src=&quot;http://example.org/alex.jpg&quot;/>  </span>  NOT: <img rel=“foaf:img” src=“photo.jpg/> Header  <meta property=“…” content=“…”> NOT  <meta name=“…” content=“…”>
RDFa can be hard to get right… V. You can not break up a description like this: <span rel=“foaf:knows&quot;>    <span property=“foaf:name&quot;>Peter Mika</span> </span> …. <span rel=“foaf:knows&quot;>    <a rel=“foaf:email“ href=“mailto:pmika@yahoo-inc.com /> </span> This is not the same as: <span rel=“foaf:knows&quot;>    <span property=“foaf:name&quot;>Peter Mika</span>       <a rel=“foaf:email“ href=“mailto:pmika@yahoo-inc.com /> </span> In the first case there are two related resources, with one attribute each, in the second case there is a single related resource with two attributes.
Tips Hiding information from being displayed Links without content will not be rendered Use <span property=“foaf:name” content=“Peter Mika”/> Use datatypes to provide the expected type of a literal. This helps validation because any tool can check whether the literal is indeed of that type.
Example: Facebook’s Like and the Open Graph Protocol The ‘Like’ button provides publishers with a way to promote their content on Facebook and build communities  Shows up in profiles and news feed Site owners can later reach users who have liked an object Facebook Graph API allows 3 rd  party developers to access the data  Open Graph Protocol is an RDFa-based format that allows to describe the object that the user ‘Likes’
Example: Facebook’s Open Graph Protocol RDF vocabulary to be used in conjunction with RDFa Simplify the work of developers by restricting the freedom in RDFa Activities, Businesses, Groups, Organizations, People, Places, Products and Entertainment Only HTML <head> accepted http://opengraphprotocol.org/ <html  xmlns:og=&quot;http://opengraphprotocol.org/schema/&quot; >  <head>  <title>The Rock (1996)</title>  <meta  property=&quot;og:title&quot;  content=&quot;The Rock&quot; />  <meta  property=&quot;og:type&quot;  content=&quot;movie&quot; />  <meta  property=&quot;og:url&quot;  content=&quot;http://www.imdb.com/title/tt0117500/&quot; />  <meta  property=&quot;og:image&quot;  content=&quot;http://ia.media-imdb.com/images/rock.jpg&quot; /> … </head> ...
Example: Yahoo! Enhanced Results (was: SearchMonkey) Guide for publishers to mark-up their pages for common types of objects Product, Local, News, Video, Events, Documents, Discussion, Games Using popular microformats and RDF vocabularies Copy-paste code  Validator Yahoo as a consumer See later
Example: Google’s Rich Snippets Google accepts popular microformats and its own RDFa vocabulary Similar approach to RDFa as Facebook Validator  to check if the markup is correct Google displays enhanced results based on this metadata Rich Snippets
Microdata example <div  itemscope itemid=“http://www.yahoo.com/resource/person ”> <p>My name is <span  itemprop=&quot;name&quot; >Neil</span>.</p> <p>My band is called  <span  itemprop =&quot;band&quot;>Four Parts Water</span>. I was born on  <time  itemprop=&quot;birthday&quot;  datetime=&quot;2009-05-10&quot;>May 10th 2009</time>. <img  itemprop=&quot;image&quot;  src=”me.png&quot; alt=”me”> </p> </div
Microdata Currently under standardization at the W3C Originally part of the HTML5 spec, but now a separate document Similar to microformats, but with the extensibility of RDFa Introduce new terms using reverse domain names or full URIs HTML5 also has a number of “semantic” elements such as <time>, <video>, <article>…
RDFa on the rise Percentage of URLs with embedded metadata in various formats 510% increase between March, 2009 and October, 2010
The state of metadata in HTML 5-10% of webpages contain some explicit metadata Depending on how you count… Too many competing approaches Too many formats: microformats vs RDFa vs Microdata When using RDFa, publishers may need to use multiple different vocabularies to satisfy everyone

Recommended

PPT
Linked Data Tutorial
PDF
An introduction to Semantic Web and Linked Data
PPT
Semantic Web Austin Yahoo
PPTX
Hack U Barcelona 2011
PPT
Making the Web searchable
PPTX
Get on the Linked Data Web!
PDF
An introduction to Semantic Web and Linked Data
PPT
Yahoo Making The Web Searchable
 
PPTX
NISO/DCMI Webinar: Schema.org and Linked Data: Complementary Approaches to Pu...
PPT
Library Linked Data and the Future of Bibliographic Control
PPTX
Introduction to Linked Data
PPTX
NISO/DCMI Webinar: Cooperative Authority Control: The Virtual International A...
PPTX
Usage of Linked Data: Introduction and Application Scenarios
PDF
Linked (Open) Data
PPT
Linked Open Data for Libraries
PPT
Introduction To RDF and RDFS
PDF
From the Semantic Web to the Web of Data: ten years of linking up
PPTX
Inference on the Semantic Web
PPTX
Linked data HHS 2015
PPTX
Linked data for librarians
PPTX
It19 20140721 linked data personal perspective
PPTX
Search Engines After The Semanatic Web
PDF
when the link makes sense
PPTX
Consuming Linked Data SemTech2010
PPTX
Developing Linked Data and Semantic Web-based Applications (Expotec 2015)
PDF
Linked Data Tutorial
PPT
Metadata Training for Staff and Librarians for the New Data Environment
PPTX
Hacking with Semantic Web
ODP
Linked Data
PPTX
SNSW CO3.pptx

More Related Content

PPT
Linked Data Tutorial
PDF
An introduction to Semantic Web and Linked Data
PPT
Semantic Web Austin Yahoo
PPTX
Hack U Barcelona 2011
PPT
Making the Web searchable
PPTX
Get on the Linked Data Web!
PDF
An introduction to Semantic Web and Linked Data
PPT
Yahoo Making The Web Searchable
 
Linked Data Tutorial
An introduction to Semantic Web and Linked Data
Semantic Web Austin Yahoo
Hack U Barcelona 2011
Making the Web searchable
Get on the Linked Data Web!
An introduction to Semantic Web and Linked Data
Yahoo Making The Web Searchable
 

What's hot

PPTX
NISO/DCMI Webinar: Schema.org and Linked Data: Complementary Approaches to Pu...
PPT
Library Linked Data and the Future of Bibliographic Control
PPTX
Introduction to Linked Data
PPTX
NISO/DCMI Webinar: Cooperative Authority Control: The Virtual International A...
PPTX
Usage of Linked Data: Introduction and Application Scenarios
PDF
Linked (Open) Data
PPT
Linked Open Data for Libraries
PPT
Introduction To RDF and RDFS
PDF
From the Semantic Web to the Web of Data: ten years of linking up
PPTX
Inference on the Semantic Web
PPTX
Linked data HHS 2015
PPTX
Linked data for librarians
PPTX
It19 20140721 linked data personal perspective
PPTX
Search Engines After The Semanatic Web
PDF
when the link makes sense
PPTX
Consuming Linked Data SemTech2010
PPTX
Developing Linked Data and Semantic Web-based Applications (Expotec 2015)
PDF
Linked Data Tutorial
PPT
Metadata Training for Staff and Librarians for the New Data Environment
NISO/DCMI Webinar: Schema.org and Linked Data: Complementary Approaches to Pu...
Library Linked Data and the Future of Bibliographic Control
Introduction to Linked Data
NISO/DCMI Webinar: Cooperative Authority Control: The Virtual International A...
Usage of Linked Data: Introduction and Application Scenarios
Linked (Open) Data
Linked Open Data for Libraries
Introduction To RDF and RDFS
From the Semantic Web to the Web of Data: ten years of linking up
Inference on the Semantic Web
Linked data HHS 2015
Linked data for librarians
It19 20140721 linked data personal perspective
Search Engines After The Semanatic Web
when the link makes sense
Consuming Linked Data SemTech2010
Developing Linked Data and Semantic Web-based Applications (Expotec 2015)
Linked Data Tutorial
Metadata Training for Staff and Librarians for the New Data Environment

Similar to Publishing data on the Semantic Web

PPTX
Hacking with Semantic Web
ODP
Linked Data
PPTX
SNSW CO3.pptx
PPT
The Semantic Web An Introduction
 
ODP
Riding the Semantic Web
PPTX
PR and Web 3.0
PPT
Year of the Monkey: Lessons from the first year of SearchMonkey
PPTX
Madrid Building blocks of Linked Data
ODP
Building a semantic website
PPTX
Linked Data MLA 2015
PPTX
Linked data MLA 2015
PPTX
One day workshop Linked Data and Semantic Web
PPT
Webofdata
ODP
State of the Semantic Web
PDF
Deploying PHP applications using Virtuoso as Application Server
PDF
Publishing and Using Linked Data
PDF
RDFa: introduction, comparison with microdata and microformats and how to use it
PPTX
Sem webmaubeuge
PDF
ISWC GoodRelations Tutorial Part 4
PDF
GoodRelations Tutorial Part 4
Hacking with Semantic Web
Linked Data
SNSW CO3.pptx
The Semantic Web An Introduction
 
Riding the Semantic Web
PR and Web 3.0
Year of the Monkey: Lessons from the first year of SearchMonkey
Madrid Building blocks of Linked Data
Building a semantic website
Linked Data MLA 2015
Linked data MLA 2015
One day workshop Linked Data and Semantic Web
Webofdata
State of the Semantic Web
Deploying PHP applications using Virtuoso as Application Server
Publishing and Using Linked Data
RDFa: introduction, comparison with microdata and microformats and how to use it
Sem webmaubeuge
ISWC GoodRelations Tutorial Part 4
GoodRelations Tutorial Part 4

More from Peter Mika

PPTX
Semantic Search tutorial at SemTech 2012
PPTX
What happened to the Semantic Web?
PPTX
Semantic Search on the Rise
PPTX
Semantic Search at Yahoo
PPTX
Semantic search: from document retrieval to virtual assistants
PPTX
SemTech 2011 Semantic Search tutorial
PPT
Semantic Search Summer School2009
PPTX
Making things findable
PPT
Semantic Search overview at SSSW 2012
PPT
Hackathon s pb
PPT
Related Entity Finding on the Web
PPTX
Understanding Queries through Entities
PPTX
Knowledge Integration in Practice
PPT
Investigating the Semantic Gap through Query Log Analysis
Semantic Search tutorial at SemTech 2012
What happened to the Semantic Web?
Semantic Search on the Rise
Semantic Search at Yahoo
Semantic search: from document retrieval to virtual assistants
SemTech 2011 Semantic Search tutorial
Semantic Search Summer School2009
Making things findable
Semantic Search overview at SSSW 2012
Hackathon s pb
Related Entity Finding on the Web
Understanding Queries through Entities
Knowledge Integration in Practice
Investigating the Semantic Gap through Query Log Analysis

Recently uploaded

PDF
[BDD 2025 - Full-Stack Development] Agentic AI Architecture: Redefining Syste...
PDF
Transforming Content Operations in the Age of AI
PPTX
Guardrails in Action - Ensuring Safe AI with Azure AI Content Safety.pptx
PPTX
UFCD 0797 - SISTEMAS OPERATIVOS_Unidade Completa.pptx
PDF
[BDD 2025 - Full-Stack Development] The Modern Stack: Building Web & AI Appli...
PDF
Beyond Basics: How to Build Scalable, Intelligent Imagery Pipelines
PPTX
The power of Slack and MuleSoft | Bangalore MuleSoft Meetup #60
PDF
Supervised Machine Learning Approaches for Log-Based Anomaly Detection: A Cas...
PDF
Cheryl Hung, Vibe Coding Auth Without Melting Down! isaqb Software Architectu...
PDF
[BDD 2025 - Full-Stack Development] PHP in AI Age: The Laravel Way. (Rizqy Hi...
PDF
Mastering UiPath Maestro – Session 2 – Building a Live Use Case - Session 2
PPTX
Connecting the unconnectable: Exploring LoRaWAN for IoT
PDF
So You Want to Work at Google | DevFest Seattle 2025
PDF
[BDD 2025 - Mobile Development] Crafting Immersive UI with E2E and AGSL Shade...
PPTX
kernel PPT (Explanation of Windows Kernal).pptx
PDF
Lets Build a Serverless Function with Kiro
PDF
DUBAI IT MODERNIZATION WITH AZURE MANAGED SERVICES.pdf
PDF
10 Best Automation QA Testing Software Tools in 2025.pdf
PPTX
How to Choose the Right Vendor for ADA PDF Accessibility and Compliance in 2026
PDF
Cybersecurity Prevention and Detection: Unit 2
[BDD 2025 - Full-Stack Development] Agentic AI Architecture: Redefining Syste...
Transforming Content Operations in the Age of AI
Guardrails in Action - Ensuring Safe AI with Azure AI Content Safety.pptx
UFCD 0797 - SISTEMAS OPERATIVOS_Unidade Completa.pptx
[BDD 2025 - Full-Stack Development] The Modern Stack: Building Web & AI Appli...
Beyond Basics: How to Build Scalable, Intelligent Imagery Pipelines
The power of Slack and MuleSoft | Bangalore MuleSoft Meetup #60
Supervised Machine Learning Approaches for Log-Based Anomaly Detection: A Cas...
Cheryl Hung, Vibe Coding Auth Without Melting Down! isaqb Software Architectu...
[BDD 2025 - Full-Stack Development] PHP in AI Age: The Laravel Way. (Rizqy Hi...
Mastering UiPath Maestro – Session 2 – Building a Live Use Case - Session 2
Connecting the unconnectable: Exploring LoRaWAN for IoT
So You Want to Work at Google | DevFest Seattle 2025
[BDD 2025 - Mobile Development] Crafting Immersive UI with E2E and AGSL Shade...
kernel PPT (Explanation of Windows Kernal).pptx
Lets Build a Serverless Function with Kiro
DUBAI IT MODERNIZATION WITH AZURE MANAGED SERVICES.pdf
10 Best Automation QA Testing Software Tools in 2025.pdf
How to Choose the Right Vendor for ADA PDF Accessibility and Compliance in 2026
Cybersecurity Prevention and Detection: Unit 2

Publishing data on the Semantic Web

  • 1.
    Publishing Data onthe Semantic Web Peter Mika Researcher, Data Architect Yahoo! Research
  • 2.
    Intro to theSemantic Web
  • 3.
    Vague, but exciting…Berners-Lee and the dawn of the Web
  • 4.
    Semantic Web Publishinformation in a way that is easier to process for machines Web of Data instead of Web of Documents Two main architectural challenges A common format for sharing data Sharing the meaning of data Through social means (shared schemas) By using powerful schema languages Semantic Web standards from W3C Languages (RDF, OWL, RIF) Serializations (RDF/XML, RDFa) Protocols (SPARQL, HTTP) Semantic Web research into knowledge representation and reasoning, data integration, data quality and many other topics Community efforts to publish data and develop schemas
  • 5.
    RDF (Resource DescriptionFramework) The basic data model of the Semantic Web A universal model to capture all sorts of data: networks, relational, object-oriented… Basic unit of information is a triple A tuple of (subject, predicate, object) Example: (Joe, loves, Mary) Each triple gives the value of a property for a given resource or relates two objects to one another Object is either a resource or a literal An RDF model is a set of triples Ordering of statements in an RDF document is irrelevant (unlike XML)
  • 6.
    Resources vs. literalsResources are identified by a URI or otherwise the are called a blank node URIs are a generalization of URLs Notation: <http://www.example.org/Person> or ex:Person Literals have an optional language and datatype (string, integer etc.) Literals can not be subjects of statements Datatypes are identified by URIs, e.g. XML Schema datatypes Two literals are the same if their components are the same Notation: “Joe B.” or Joe@en^^http://…#string
  • 7.
    Advanced topic: Resourcesvs Literals Resources are objects, Literals are strings Resources are instances of classes, Literals have datatypes Whether something is a resource or literal sometimes depends on the detail of modeling <meta property=“myvocab:knows”>Paris Hilton</meta> <item rel=“foaf:knows”> <meta property=“foaf:name”>Paris Hilton</meta> </item> You cannot make statements about literals (literals are always the object in a triple) Resources can carry a globally unique identifier, literals have no identity Web resources such as documents and images are resources <item rel=“rdfs:seeAlso” resource=“http://www.some.related.page.com/”/> <item rel=“foaf:img” resource=“http://photosite.example.org/photo.jpg”/> When in doubt: it’s a resource
  • 8.
    Graphical and textualnotation A number of ways to serialize an RDF model into an RDF document RDF/XML, Turtle, N3, N-Triples Example: http://www.cs.vu.nl/~pmika/foaf.rdf my:Joe “ Joe A.” name foaf:Person type
  • 9.
    Informational versus non-informationalresources Informational resource: an HTML document, image, any other file on the Web Retrievable in its entirety from the Web Retrieving it can return a 200 OK Conceptual (non-informational) resource: a person, an event, a place, etc. A description of it may be retrievable from the Web When identified by a URL, retrieving it should return a 303 Redirect Never confuse a webpage with what it describes! You are not your Facebook profile: one is a document, the other is a person. A document has properties such as byte-size, media-type etc, a person has name, age, etc. Make sure you don’t use the URL of an existing webpage as the URI of a resource
  • 10.
    Vocabularies (ontologies) Ontologiesare collections of classes and properties used to describe objects in a particular domain OWL (the Web Ontology Language) is the standard ontology language OWL has an RDF serialization: ontologies are part of the Semantic Web Classes can be described by sub- and superclasses, required properties Class membership in RDF is expressed using the rdf:type property An instance can have multiple classes (types) A class can have multiple superclasses Properties can be described by their domain, range, cardinalities, etc.
  • 11.
    RDF is designedfor distributed systems URIs provide web-wide global identification across documents A resource may be described by multiple documents We know it’s the same resource because the same URI is used or through reasoning (advanced topic…) URIs are intented to be reused Unique, but not single identifiers: two URIs may denote the same thing URIs are dereferencable (can be retrieved) A well-behaved URI returns a description of the resource Provides authority: the definition of foaf:Person lives at that URI Ontologies can be looked up as well Typically at the root of the URIs, also known as the namespace Example: http://xmlns.com/foaf/0.1/Person redirects to the specification
  • 12.
    URIs implicitly linkdata together (#joe, #name, “Joe A.”) (#joe, #email, mailto:joe@joe.com) (#mary, name, “Mary B.”) (#mary, gender, “female”) (#joe, #loves, #mary) Joe’s homepage A dating site Mary’s homepage (#name, #type, #Property) (#name, #domain, #Person) Schema doc
  • 13.
    Put together, triplesform a single ‘global’ graph “ Joe A.” #joe #name “ joe@joe.com” #email #mary #loves “ Mary B.” “ female” #name #gender
  • 14.
    Publishing for theSemantic Web
  • 15.
    Motivation Why publishdata on the (Semantic) Web? In a business context Increase the potential for linking, reuse and aggregation Drive traffic back from other sites on the Web Pre-competitive data integration (e.g. drug discovery) Make your data more easily findable Drive traffic from search engines In a non-profit context Increase industry or government transparency, accountability Support research and education by making data accessible
  • 16.
    Publishing and consumingdata on the Semantic Web Publishing data involves Deciding in which format to publish your data Deciding which schema (ontology, vocabulary) to use OR you can create a new schema and publish it as well Multiple ways of publishing RDF data: Linked Data Metadata in HTML SPARQL endpoints Feeds GRDDL Automated tools Note: you may implement more than one
  • 17.
    Option 1: LinkedData A web of RDF documents in parallel to the current Web Most often implemented as wrappers around databases or APIs The four rules of Linked Data: Use URIs to identify things. Use HTTP URIs so that these things can be referred to and looked up (&quot; dereference &quot;) by people and user agents . Provide useful information about the thing when its URI is dereferenced, using standard formats such as RDF-XML. Include links to other, related URIs in the exposed data to improve discovery of other related information on the Web. . . . #PeterM #Bud born “ Peter Mika” label “ Budapest” label #Hun capital-of “ 2,000,000” population #PeterM #Bud born “ Peter Mika” label “ Budapest” label #Hun capital-of “ 2,000,000” population #PeterM #Bud born “ Peter Mika” label “ Budapest” label #Hun capital-of “ 2,000,000” population
  • 18.
    Option 1: LinkedData Advantages: No change to the publishing of the HTML documents Data can be published by third party (e.g. Dbpedia) Disadvantages: Web servers need to be configured to properly handle URIs that identify concepts instead of documents Not favored by search engines Lack of use cases Crawling needs to be changed Authority is difficult to determine Tools Triple stores (Virtuoso, Oracle etc.) and front-ends ( Pubby ) RDB-to-RDF mappers (e.g. D2RQ , Triplify ) Validators ( Vapour ) Linked Data browsers ( many )
  • 19.
    Linked Data asa movement Rapidly growing community effort to (re)publish open datasets as Linked Data In particular, scientific and government datasets see linkeddata.org
  • 20.
    Option 2: Metadatain HTML Using microformats, RDFa, Microdata (more later) Advantages: Data and document are always in sync Browser plug-in friendly Search engine friendly Copy-paste friendly Tools: XML editors (e.g. Oxygen) Triplr RDFa Distiller RDFa bookmarklet Ubiquity RDFa plugin Optimus microformat parser Examples: many, including SlideShare, YouTube, LinkedIn, Digg, Myspace, Facebook… Peter Mika was born in Budapest. Peter Mika was born in Budapest. #PeterM #Bud born “ Peter Mika” label “ Budapest” label #Hun capital-of “ 2,000,000” population #PeterM #Bud born “ Peter Mika” label “ Budapest” label #Hun capital-of “ 2,000,000” population
  • 21.
    Option 3: SPARQLendpoints An API for accessing RDF databases on the Web A query language and an HTTP protocol Advantages: Flexible access: make any query you want Also possible to expose a traditional RDBMs via a wrapper Disadvantages: For the publisher: cost of supporting arbitrary queries For the search engine: discovery of SPARQL servers is unsolved Tools: Triple stores (Oracle, Virtuoso, Sesame, Jena, OWLIM etc.) RDB-to-RDF mappers such as D2RQ and Triplify #PeterM #Bud born “ Peter Mika” label “ Budapest” label #Hun capital-of “ 2,000,000” population
  • 22.
    Option 4: FeedsDisadvantages: No standard feed format for RDF: data needs to be formatted and often manually submitted for each search engine Advantages Submit your data without making it public Competing and incompatible formats DataRSS (Yahoo!) Google Data Protocol Open Data Protocol (Microsoft) . #PeterM #Bud born “ Peter Mika” label “ Budapest” label #Hun capital-of “ 2,000,000” population #PeterM #Bud born “ Peter Mika” label “ Budapest” label #Hun capital-of “ 2,000,000” population #PeterM #Bud born “ Peter Mika” label “ Budapest” label #Hun capital-of “ 2,000,000” population
  • 23.
    Option 5: Publishinga transformation of the data Publish the rule to transform the HTML to structured data GRDDL is a standard for linking an HTML page to a transformation that produces RDF data Advantages No change to the page Disadvantages Transformation needs to be executed to get to the data Not much support by search engines Tools Intel MashMaker Dapper Glue API from AdaptiveBlue <XSLT> xx yy 1 2
  • 24.
    Option 6: Automaticmarkup Web services that annotate HTML automatically Advantages No manual effort Disadvantages Limited to finding relevant entities in text Tools OpenCalais Zemanta API Peter Mika was born in Budapest. <person>Peter Mika</person> was born in <location>Budapest</location>.
  • 25.
    Example: ZemantaA personal writing assistant for bloggers Plugin for popular blogging platforms and web mail clients Analyzes text as you type and suggests hyperlinks, tags, categories, images and related articles API available with the same functionality
  • 26.
    Choosing a vocabularyNo vocabularies in many domains Books, movies, stuff people care about… Too many competing proposals in other domains Often versions of the same proposal Example: vocabularies for microformats Not maintained I cannot maintain your vocabulary for you Limited tool support Too many expert tools until now Many vocabularies are not designed for annotation Missing meeting point and social process An ontology is a shared , formal representation of a domain
  • 27.
    Choosing a vocabularySearch the Web or ask for advice on mailing lists [email_address] [email_address] Wikis semanticweb.org vocamp.org Beware of people who claim to have the vocabulary of everything Preferably you want something small and targeted Never a 100% fit  you will need to introduce vocabulary terms (classes and properties) Do not introduce new classes/properties in existing namespaces Example: the namespace http://xmlns.com/foaf/0.1/ is used by the FOAF project. Try not to introduce a new term without contacting the owner, i.e. the membership of the FOAF mailing list.
  • 28.
    Advanced topic: creatinga vocabulary Get advice on methodology vocamp.org and semanticweb.org Choose a namespace and a prefix Give sensible names, e.g. name it after your site, but don’t call it searchmonkey Namespace ends either with a slash or a hash Create an RDF or OWL document describing your classes and properties Use an ontology editor such as Protégé 4.0 Follow naming conventions Publish your vocabulary Make sure the URIs of your properties and classes are resolvable E.g. myvocab:digicam should resolve to a document containing the definition of myvocab:digicam Convince others to adopt your vocabulary If you are in fishing, convince other fishing businesses
  • 29.
    How do webuild communities? www.vocamp.org
  • 30.
  • 31.
    Brief history ofthe Annotated Web 1995: HTML meta tags 1996: Simple HTML Ontology Extensions (SHOE) 1998: RDF/XML RDF/XML in HTML RDF linked from HTML 2003: Web 2.0 Tagging Microformats Metadata in Wikipedia Machine tags in Flickr 2005: eRDF 2008: RDFa 1.0 2011: RDFa 1.1 2012: Microdata?
  • 32.
    HTML meta tags<HTML> <HEAD profile=&quot;http://dublincore.org/documents/dcq-html/&quot;> <META name=&quot;DC.author &quot; content=&quot; Peter Mika &quot;> <LINK rel=&quot;DC.rights copyright&quot; href=&quot; http://www.example.org/rights.html &quot; /> <LINK rel=&quot;meta&quot; type=&quot;application/rdf+xml&quot; title=&quot;FOAF&quot; href= &quot; http://www.cs.vu.nl/~pmika/foaf.rdf &quot;> </HEAD> … </HTML>
  • 33.
    SHOE example(Hefflin & Hendler, 1996) <ONTOLOGY &quot;our-ontology&quot; VERSION=&quot;1.0&quot;> <ONTOLOGY-EXTENDS &quot;organization-ontology&quot; VERSION=&quot;2.1&quot; PREFIX=&quot;org&quot; URL=&quot;http://www.ont.org/orgont.html&quot;> <ONTDEF CATEGORY=&quot;Person&quot; ISA=&quot;org.Thing&quot;> <ONTDEF RELATION=&quot;lastName&quot; ARGS=&quot;Person STRING&quot;> <ONTDEF RELATION=&quot;firstName&quot; ARGS=&quot;Person STRING&quot;> <ONTDEF RELATION=&quot;marriedTo&quot; ARGS=&quot;Person Person&quot;> <ONTDEF RELATION=&quot;employee&quot; ARGS=&quot;org.Organization Person&quot;> </ONTOLOGY > <HEAD> <META HTTP-EQUIV=&quot;Instance-Key&quot; CONTENT=&quot;http://www.cs.umd.edu/~george&quot;> <USE-ONTOLOGY &quot;our-ontology&quot; VERSION=&quot;1.0&quot; PREFIX=&quot;our&quot; URL=&quot;http://ont.org/our-ont.html&quot;> </HEAD> <BODY> <CATEGORY &quot;our.Person&quot;> <RELATION &quot;our.marriedTo&quot; TO=&quot;http://www.cs.umd.edu/~helena&quot;> <RELATION &quot;our.employee&quot; FROM=&quot;http://www.cs.umd.edu&quot;> My name is <ATTRIBUTE &quot;our.firstName&quot;> George </ATTRIBUTE> <ATTRIBUTE &quot;our.lastName&quot;> Cook </ATTRIBUTE> and I live at...
  • 34.
  • 35.
  • 36.
  • 37.
    Example: Creative CommonsEmbedding CC license in HTML (now deprecated): <HTML> <HEAD>… </HEAD> <BODY> … <!–- <rdf:RDF xmlns=&quot;http://creativecommons.org/ns#&quot; xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot; xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot;> <Work rdf:about=&quot;http://www.yergler.net/averages/&quot;> <dc:title>The Law of Averages</dc:title> <dc:description>...because eventually i&apos;ll be right...</dc:description> <license rdf:resource=&quot;http://creativecommons.org/licenses/by-nc/1.0/&quot; /> </Work> <License rdf:about=&quot;http://creativecommons.org/licenses/by-nc/1.0/&quot;> <requires rdf:resource=&quot;http://web.resource.org/cc/Notice&quot; /> <permits rdf:resource=&quot;http://web.resource.org/cc/Reproduction&quot; /> <permits rdf:resource=&quot;http://web.resource.org/cc/Distribution&quot; /> <prohibits rdf:resource=&quot;http://web.resource.org/cc/CommercialUse&quot; /> </License> </rdf:RDF> -->
  • 38.
    Example: Creative CommonsCurrent: rel attribute (HTML4) This work is licensed under a <a rel=&quot;license&quot; href=&quot;http://creativecommons.org/licenses/by/3.0/us/&quot;>Creative Commons Attribution 3.0 United States License</a>. Use of the “rel” attribute for semantic annotation is the birth of the microformat…
  • 39.
    Microformats (μf) Agreementson the way to encode certain kinds metadata in HTML Reuse of semantic-bearing HTML elements Based on existing standards Minimality Microformats exist for a limited set of objects hCard (persons and organizations) hCalendar (events) hResume hProduct hRecipe Varying degrees of support and stability hCard and rel-tag are widely supported Community centered around microformats.org Specifications and discussions are hosted there
  • 40.
    Microformats: limitations Noshared syntax Each microformat has a separate syntax tailored to the vocabulary No formal schemas Limited reuse, extensibility of schemas Unclear which combinations are allowed No datatypes No namespaces, unique identifiers (URIs) no interlinking mapping between instances is required Always appears in the HTML <body>
  • 41.
    Example: the hCardmicroformat <cite class=&quot;vcard&quot; > <a class=&quot;fn url&quot; rel=&quot;friend colleague met” href=&quot;http://meyerweb.com/&quot;> Eric Meyer</a> </cite> wrote a post (<cite> <a href=&quot;http://meyerweb.com/eric/thoughts/2005/12/16/tax-relief/&quot;> Tax Relief</a></cite>) about an unintentionally humorous letter he received from the <span class=&quot;vcard” > <a class=&quot;fn org url&quot; href=&quot;http://irs.gov/&quot;> Internal Revenue Service</a> </span>. <div class=&quot;vcard&quot; > <a class=&quot;email fn&quot; href=&quot;mailto:jfriday@host.com&quot;>Joe Friday</a> <div class=&quot;tel&quot; >+1-919-555-7878</div> <div class=&quot;title&quot; >Area Administrator, Assistant</div> </div>
  • 42.
    RDFa W3C standardfor embedding RDF data in HTML documents A set of new HTML attributes to be used in head or body A specification of how to extract the data from these attributes RDFa is just a syntax, you have to choose a vocabulary separately RDFa 1.0 is a W3C Recommendation since October, 2008 RDFa Primer RDFa 1.1 is a small update on RDFa to make it easier to use Currently Working Draft (March 31, 2011) Updated version of the RDFa Primer (April 19, 2011) RDFa API for accessing RDFa data in a webpage in the browser from JavaScript Currently Working Draft (April 19, 2011)
  • 43.
    RDFa 1.1 ChangesNew vocab attribute to define the default namespace for the document or subtree Profile documents to define multiple namespace prefixes The prefix attribute as a recommended replacement of xmlns You can use URIs even where only CURIEs where allowed before RDFa 1.1 is backward compatible with RDFa 1.0 RDFa 1.1 is recommended if you want to use HTML5
  • 44.
    When to useRDFa Choose microformats when you find a microformat that fits your needs and supported by your consumers Microformats are first option because they are simple Yahoo supports all major microformats, see the documentation It’s a common misconception that RDFa requires XHTML or that it’s compatible with HTML5 It’s compatible with HTML4, HTML5, XHTML If you find none that perfectly fits your needs then you need RDFa Microformats have a fixed schema: you can not add your own attributes Example: a social networking site with user profiles VCard is a good candidate, but for example it doesn’t have a way to express the user’s social connections You either live without this, or go with RDFa
  • 45.
    RDFa intro: metadatain the header More info in the <html prefix=&quot;og: http://ogp.me/ns#&quot; > <head> <title>The Trouble with Bob</title> <meta property=&quot;og:title&quot; content=&quot;The Trouble with Bob&quot; /> <meta property=&quot;og:type&quot; content=&quot;text&quot; /> <meta property=&quot;og:image&quot; content=&quot;http://example.com/alice/bob-ugly.jpg &quot; /> ... </head>
  • 46.
    RDFa intro: linkswith a flavor More info in the All content on this site is licensed under <a rel=&quot;license&quot; href=&quot;http://creativecommons.org/licenses/by/3.0/&quot;> a Creative Commons License </a>.
  • 47.
    RDFa links: talkingabout subjects other than the page More info in the The trouble with Bob is that he takes much better photos than me: <div about=&quot;http://example.com/bob/photos/sunset.jpg&quot; > <img src=&quot;http://example.com/bob/photos/sunset.jpg&quot; /> <span property=&quot;og:title&quot;>Beautiful Sunset</span> by <span property=&quot;dc:creator&quot;>Bob</span>. </div>
  • 48.
    RDFa links: talkingabout subjects other than the page More info in the <div typeof=”foaf:Person&quot; > <p property=”foaf:name&quot;> Alice Birpemswick </p> <p> Email: <a rel=”foaf:mbox” href=&quot;mailto:alice@example.com&quot;> alice@example.com </a> </p> <p> Phone: <a rel=”foaf:phone&quot; href=&quot;tel:+1-617-555-7332&quot;>+1 617.555.7332</a> </p> </div>
  • 49.
    The process ofannotating with RDFa Find a vocabulary that fits your needs and supported by your consumers A vocabulary describes a set of types and attributes within a given domain If you don’t find a good candidate, extend an existing one or create a new one Annotate your page. Before you start, you might want to validate your page for (X)HTML conformance using the W3C’s (X)HTML Validator to reduce the chance of errors. Choose Document Type XHTML + RDFa. No specific tool support. If you have an HTML or XML editor that supports DTDs, you will have syntax checking and highlighting. Use the RDFa Distiller to validate which data can be extracted from your page. If you fancy, use the RDF Validator to graphically visualize the RDF graph that is outputted. Put the annotated page online The data will be extracted by Google/Bing/Yahoo the next time your page is crawled and indexed The data will be available to browser extensions, bookmarklets etc. See http://rdfa.info/rdfa-implementations for new tools and APIs
  • 50.
    RDFa can behard to get right… Validation problems can stop us from extracting data Use the W3C validator Use the right DOCTYPE declaration if using XHTML Set the encoding of your page properly (using HTTP headers or XML declaration) Prefixes need to be defined using the xmlns attribute Unless you are making statements about the document, set the subject using the about attribute Do not include HTML elements in literal values Incorrect: <div property=“foaf:name”><b>Peter Mika</b></div> Use absolute URIs as the value of the resource attribute Or make sure you specify HTML base
  • 51.
    RDFa can behard to get right… II. Be careful when using rel and typeof in combination because of the precedence rules BAD example: <div about=“#id”> <span property=“foaf:name“>Peter Mika</span> <span rel=“foaf:img“ typeof=“foaf:Image”> <span property=“dc:format”>jpg</span> … </span </div> To correct, you need to put the typeof inside the <span> node with rel=“foaf:img”
  • 52.
    RDFa can behard to get right… III. Typeof does two things at once: it creates a new subject resource and assigns the type to it BAD example: <div about=“#id”> <span property=“foaf:name“>Peter Mika</span> <span rel=“foaf:img“ resource=“http://www.example.org/photo.jpg”> <span typeof=“foaf:Image”> <span property=“dc:format”>jpg</span> </span </span </div> To correct, you have to repeat the resource attiribute on the span node with the typeof
  • 53.
    RDFa can behard to get right… IV. Marking up <h1>: <h1 property=“dc:title”>My homepage</h1> NOT: <h1><div property=“dc:title”>My homepage</h1>   Marking up an image: <span rel=”foaf:img&quot;>         <img alt=&quot;Alex&quot; src=&quot;http://example.org/alex.jpg&quot;/>  </span> NOT: <img rel=“foaf:img” src=“photo.jpg/> Header <meta property=“…” content=“…”> NOT <meta name=“…” content=“…”>
  • 54.
    RDFa can behard to get right… V. You can not break up a description like this: <span rel=“foaf:knows&quot;>    <span property=“foaf:name&quot;>Peter Mika</span> </span> …. <span rel=“foaf:knows&quot;>    <a rel=“foaf:email“ href=“mailto:pmika@yahoo-inc.com /> </span> This is not the same as: <span rel=“foaf:knows&quot;>    <span property=“foaf:name&quot;>Peter Mika</span>    <a rel=“foaf:email“ href=“mailto:pmika@yahoo-inc.com /> </span> In the first case there are two related resources, with one attribute each, in the second case there is a single related resource with two attributes.
  • 55.
    Tips Hiding informationfrom being displayed Links without content will not be rendered Use <span property=“foaf:name” content=“Peter Mika”/> Use datatypes to provide the expected type of a literal. This helps validation because any tool can check whether the literal is indeed of that type.
  • 56.
    Example: Facebook’s Likeand the Open Graph Protocol The ‘Like’ button provides publishers with a way to promote their content on Facebook and build communities Shows up in profiles and news feed Site owners can later reach users who have liked an object Facebook Graph API allows 3 rd party developers to access the data Open Graph Protocol is an RDFa-based format that allows to describe the object that the user ‘Likes’
  • 57.
    Example: Facebook’s OpenGraph Protocol RDF vocabulary to be used in conjunction with RDFa Simplify the work of developers by restricting the freedom in RDFa Activities, Businesses, Groups, Organizations, People, Places, Products and Entertainment Only HTML <head> accepted http://opengraphprotocol.org/ <html xmlns:og=&quot;http://opengraphprotocol.org/schema/&quot; > <head> <title>The Rock (1996)</title> <meta property=&quot;og:title&quot; content=&quot;The Rock&quot; /> <meta property=&quot;og:type&quot; content=&quot;movie&quot; /> <meta property=&quot;og:url&quot; content=&quot;http://www.imdb.com/title/tt0117500/&quot; /> <meta property=&quot;og:image&quot; content=&quot;http://ia.media-imdb.com/images/rock.jpg&quot; /> … </head> ...
  • 58.
    Example: Yahoo! EnhancedResults (was: SearchMonkey) Guide for publishers to mark-up their pages for common types of objects Product, Local, News, Video, Events, Documents, Discussion, Games Using popular microformats and RDF vocabularies Copy-paste code Validator Yahoo as a consumer See later
  • 59.
    Example: Google’s RichSnippets Google accepts popular microformats and its own RDFa vocabulary Similar approach to RDFa as Facebook Validator to check if the markup is correct Google displays enhanced results based on this metadata Rich Snippets
  • 60.
    Microdata example <div itemscope itemid=“http://www.yahoo.com/resource/person ”> <p>My name is <span itemprop=&quot;name&quot; >Neil</span>.</p> <p>My band is called <span itemprop =&quot;band&quot;>Four Parts Water</span>. I was born on <time itemprop=&quot;birthday&quot; datetime=&quot;2009-05-10&quot;>May 10th 2009</time>. <img itemprop=&quot;image&quot; src=”me.png&quot; alt=”me”> </p> </div
  • 61.
    Microdata Currently understandardization at the W3C Originally part of the HTML5 spec, but now a separate document Similar to microformats, but with the extensibility of RDFa Introduce new terms using reverse domain names or full URIs HTML5 also has a number of “semantic” elements such as <time>, <video>, <article>…
  • 62.
    RDFa on therise Percentage of URLs with embedded metadata in various formats 510% increase between March, 2009 and October, 2010
  • 63.
    The state ofmetadata in HTML 5-10% of webpages contain some explicit metadata Depending on how you count… Too many competing approaches Too many formats: microformats vs RDFa vs Microdata When using RDFa, publishers may need to use multiple different vocabularies to satisfy everyone

Editor's Notes

  • #40 Designed for humans first and machines second, microformats are a set of simple, open data formats built upon existing and widely adopted standards. Instead of throwing away what works today, microformats intend to solve simpler problems first by adapting to current behaviors and usage patterns

[8]ページ先頭

©2009-2025 Movatter.jp