I moved to Drupal because of its purported sem web capabilities. Thanks Alexandre Passant!
Hi Alexandre, I've just been converted to WordPress... however, I have run into the limitations ... with its ability to support sem web. I now see that there appears to be a lot of sem web momentum in the Drupal world. This post of yours has given me some inspiration to take a closer look at Drupal. RDF CCK, in particular, looks to be the kind of thing I was thinking about.
cheers Murray
For the last 10-15 years or so the semantic web has mainly been an academic and enthusiasts enclave.
Lots of good work has been done in that time (data model, serializations, triple stores, identity, linked data).
Big players, Drupal included, starting to get on board with structured data.
To a computer, then, the web is a flat, boring world devoid of meaning. This is a pity, as in fact documents on the web describe real objects and imaginary concepts, and give particular relationships between them. Adding semantics to the web involves two things: allowing documents which have information in machine-readable forms, and allowing links to be created with relationship values. Only when we have this extra level of semantics will we be able to use computer power to help us exploit the information to a greater extent than our own reading.
Plenary at WWW Geneva 94: The Need for Semantics in the Web
I have a dream for the Web [in which computers] become capable of analyzing all the data on the Web – the content, links, and transactions between people and computers. A 'Semantic Web', which should make this possible, has yet to emerge, but when it does, the day-to-day mechanisms of trade, bureaucracy and our daily lives will be handled by machines talking to machines. The 'intelligent agents' people have touted for ages will finally materialize.
Site owners share structured data with Yahoo!, using semantic markup (microformats, RDF), standardized XML feeds, APIs (OpenSearch or other web services), and page extraction.
The Monkey is Out and the Challenge is On
It is waiting to happen; we just have to connect the dots. That is, we have to make Drupal emit structured information.
Drupal, the semantic web and search
Rich Snippets give users convenient summary information about their search results at a glance. We are currently supporting data about reviews and people... It's a simple change to the display of search results, yet our experiments have shown that users find the new data valuable - if they see useful and relevant information from the page, they are more likely to click through... As a webmaster, you can help by annotating your pages with structured data in a standard format.
Two days ago, Google announced "Rich Snippets", a move that is sure to shake up the SEO industry, and cause hundreds of thousands of people to reconsider their skepticism of the semantic web. Yes, that probably includes many of you.
Structured data is the new search engine optimization
The Open Graph protocol enables you to integrate your Web pages into the social graph. It is currently designed for Web pages representing profiles of real-world things — things like movies, sports teams, celebrities, and restaurants. Once your pages become objects in the graph, users can establish connections to your pages as they do with Facebook Pages. Based on the structured data you provide via the Open Graph protocol, your pages show up richly across Facebook: in user profiles, within search results and in News Feed.
Drupal 7 has RDFa built in!
Ordinary users don't have to sweat the details.
Drupal 7 has a lot of promise.
| URLs | URLs |
| Humans | Machines |
| Documents | Things |
| Text | Data |
| Presentation | Semantics |
| Prose | Properties |
| Links | Relationships |
...which can be solved by sem web...
Humans easily parse and understand content which is not possible for computers.
Structure exists in CMSs but trapped inside
Hundreds of thousands of Drupal sites contain vast amounts of structured data, covering an enormous range of topics, including product information. Unfortunately, that structure is hidden deep in Drupal's database and doesn't surface to the HTML code generated by Drupal.
Source: Dries, http://buytaert.net/drupal-the-semantic-web-and-search
Strings aren't unique, URIs are
Example: "set" (maths, art, sport, science)
The triple is at the heart of RDF: Subject -> Predicate -> Object.
Subjects and Predicates are URIs. Objects are URIs or literals.
Very simple!
What's the big deal?
Credit: Richard Cyganiak and Anja Jentzsch, About the Linking Open Data dataset cloud
RDF lets you make statements about things but how do we know what they mean?
An ontology is a formal representation of the knowledge by a set of concepts within a domain and the relationships between those concepts. It is used to reason about the properties of that domain, and may be used to describe the domain.
en.wikipedia.org/wiki/Ontology_(information_science)
Ontology forms a number of important functions.
[RDF Schema] provides the facilities needed to describe such classes and properties, and to indicate which classes and properties are expected to be used together. In other words, RDF Schema provides a type system for RDF.
Source: RDF Primer
ex:MotorVehicle rdf:type rdfs:Class .
exthings:companyCar rdf:type ex:MotorVehicle .
ex:Van rdf:type rdfs:Class .
ex:Van rdfs:subClassOf ex:MotorVehicle .
Source: RDF Primer
ex:Person rdf:type rdfs:Class .
ex:Book rdf:type rdfs:Class .
ex:author rdf:type rdf:Property .
ex:author rdfs:range ex:Person .
ex:author rdfs:domain ex:Book .
Source: RDF Primer
RDF in attributes
RDF can be embedded in XHTML and still validate with proper XHTML DTD.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN"
"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
Doesn't break rendering in HTML 4 documents.
Lifted from the RDFa primer.
<div>
|
<div xmlns:dc="http://purl.org/dc/elements/1.1/">
|
Specified as the datatype attribute in RDFa.
XML Schema namespace included with page.
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
XML Schema datatypes good matchup with Field types.
Review of sem web material.
Credit: Stéphane Corlosquet (scor), RDFa in Drupal 7: last call for feedback before alpha release
Basic set of metadata elements which describe most resources.
Describes people, their activities and relationships.
Interconnects discussion methods such as blogs, forums and mailing lists to each other.
Representation of thesauri, classification schemes, taxonomies, subject-heading systems, or any other type of structured controlled vocabulary.
Provides basic elements for the description of ontologies.
A module for the actual content of websites, in multiple formats.
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" version="XHTML+RDFa 1.0" dir="ltr" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/terms/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:rss="http://purl.org/rss/1.0/" xmlns:sioc="http://rdfs.org/sioc/ns#" xmlns:sioct="http://rdfs.org/sioc/types#" xmlns:skos="http://www.w3.org/2004/02/skos/core#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#">
Credit: Stéphane Corlosquet (scor), RDFa in Drupal 7: last call for feedback before alpha release
The RDF mappings defined for node.
array(
'type' => 'node',
'bundle' => RDF_DEFAULT_BUNDLE,
'mapping' => array(
'rdftype' => array('sioc:Item', 'foaf:Document'),
'title' => array(predicates' => array('dc:title'),),
'created' => array('predicates' => array('dc:date', 'dc:created'),'datatype' => 'xsd:dateTime','callback' =>'date_iso8601',),
'body' => array('predicates' => array('content:encoded'),),
'uid' => array('predicates' => array('sioc:has_creator'),),
'name' => array('predicates' => array('foaf:name'),),
),
);
Fields (CCK) allows admins to define structure.
hook_rdf_namespaces() adds new namespaces to the page, if required.
function demo_rdf_namespaces() {
return array(
'demo' => 'http://demo.example.com/schema#',
);
}
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" version="XHTML+RDFa 1.0" dir="ltr" xmlns:demo="http://demo.example.com/schema#" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/terms/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:rss="http://purl.org/rss/1.0/" xmlns:sioc="http://rdfs.org/sioc/ns#" xmlns:sioct="http://rdfs.org/sioc/types#" xmlns:skos="http://www.w3.org/2004/02/skos/core#" xmlns:xsd="http://www.w3.org/2001/XMLSchema#">
Don't reinvent the wheel! Look around for pre-existing ontologies.
Geo, calendars, contacts, bio, creative commons, music, provenance, business, trust, programmes, reviews, resumes, recipes, projects, etc, etc, etc.
Reuse leads to interoperability!
Recommend looking to:
Recommends following vocabularies:
Source: http://developer.yahoo.com/searchmonkey/smguide/profile_vocab.html
Supports RDFa for:
http://rdf.data-vocabulary.org/#
hook_rdf_mapping() allows mapping:
function demo_rdf_mapping() {
return array(
array(
'type' => 'node',
'bundle' => 'person',
'mapping' => array(
'rdftype' => array('demo:Person'),
),
),
);
}
Contributed module will allow for these mappings to be made in the UI as well as module.
Review of mapping fields.
Not just stable linked data resources - dynamic resources discussing and conversing about those resources.
Consumption needs Production needs Consumption needs...
RDF is being produced now. More apps will start consuming.
Drupal 7 is the start of something big.
PREFIX dc: <http://purl.org/dc/elements/1.1/>
SELECT ?book ?who
WHERE { ?book dc:creator ?who }
Slideshow (will be) available at:
http://cruncht.com/slides/drupal-semantic-web.