37
Semantic Drupal RDF in Drupal 7 and what it means for the web at large Gaurav Kumar

RDF and Drupal - The Semantic web

Embed Size (px)

Citation preview

Page 1: RDF and Drupal - The Semantic web

Semantic DrupalRDF in Drupal 7 and what it means for the web at

large

Gaurav Kumar

Page 2: RDF and Drupal - The Semantic web

Gaurav Kumar• Team Lead at Blisstering Solutions• With Drupal for 3 years• Lead Architect of m2Serve, a multi-modal

Drupal based platform• Maintainer of the mailalias module on

drupal.org• Works with multiple technologies – Mobile,

Voice, Web

Page 3: RDF and Drupal - The Semantic web

Explosionof

Social networks

and collaborative applications

Page 4: RDF and Drupal - The Semantic web

Need a way to connect these

People can move from one to another and

bring their data.

People can make sense out of data.

Page 5: RDF and Drupal - The Semantic web
Page 6: RDF and Drupal - The Semantic web

“On the Internet, nobody knows you’re a dog”

Page 7: RDF and Drupal - The Semantic web

Semantic Web

Page 8: RDF and Drupal - The Semantic web

Semantic Web Benefits• Programs and sites can

exchange information• Search engines can display

more relevant information in results

• Data mashers can combine data from different datasets to find new and astounding things

Page 9: RDF and Drupal - The Semantic web

Key Terms

Machine understandableRDF

Linked DataSPARQL

Global Giant Graph

Federated Dataset

Page 10: RDF and Drupal - The Semantic web

Machine Understandable

Page 11: RDF and Drupal - The Semantic web

RDF

Resource

Description

Framework

Page 12: RDF and Drupal - The Semantic web

RDFEverything is a resource

A resource is a named thing

this

www.example.com#thisexample:this CURIE

Page 13: RDF and Drupal - The Semantic web

RDFA resource can be a Document

A resource can be an organizationA resource can be a person

foaf:Document foaf:Organization foaf:person

foaf:name - Gauravfoaf:mail - [email protected]:birthday – 25/10/1987

Page 14: RDF and Drupal - The Semantic web

RDFand describe how that person is related to other resources

dplp:this blisstering:this

gaurav:me

swrc:employeefoaf:made

Page 15: RDF and Drupal - The Semantic web

RDF<?xml version="1.0"?>

<rdf:RDF xmlns:rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#

xmlns:dc="http://purl.org/dc/elements/1.1/">

<rdf:Description rdf:about="http://www.google.com">

<dc:creator>Larry Page</dc:creator> </rdf:Description>

</rdf:RDF>

Page 16: RDF and Drupal - The Semantic web

RDF Triples (N3)

vendor1:productX dc:title "Cool-O-Matic" . vendor1:productX retail:price "$50.75" .

vendor1:productX vendor1:partno "TTK583" . vendor1:productY dc:title "Fluffertron" . vendor1:productY retail:price "$26.50" .

vendor1:productY vendor1:partno "AAL132" .

RDF Graphs

Page 17: RDF and Drupal - The Semantic web

RDF Vocabularies

RDF Schema Web Ontology Language

Dublin Core Friend of a Friend

Simple Knowledge Organization System vCard RDF Encoding

Page 18: RDF and Drupal - The Semantic web

RDF and RDFa

RDFa = RDF in attributesProvides a way to use RDF with HTML

Page 19: RDF and Drupal - The Semantic web

RDF and RDFa

<div xmlns:dcmi="http://purl.org/dc/elements/1.1">

<h1 property="dcmi:title">OSI Days</h1> <h3 property="dcmi:creator">Gaurav

Kumar</h3>

Page 20: RDF and Drupal - The Semantic web

Giant Global Graph

ONE GIANT DATABASE

Page 21: RDF and Drupal - The Semantic web

SPARQLQuery the Giant Global Graph

using SQL?

SPARQL

Page 22: RDF and Drupal - The Semantic web

Key Terms

Machine understandableRDF

Linked DataSPARQL

Global Giant Graph

Federated Dataset

Page 23: RDF and Drupal - The Semantic web

Drupal and RDF – A good match?

• Both maintain structured data• Drupal’s structure is in the Database• Drupal’s field names are unique to the website• Both maintain structured data in similar ways

Page 24: RDF and Drupal - The Semantic web

RDF in Drupal

• rdf.php (Dries, 2000)• FOAF, vCard (walkah, 2004)• Relationship (dman, 2005)• Semantic Search (hendler, 2006)• RDF (Arto, 2007)• OpenCalais (febbraro, 2008)• RDF CCK (scor, 2008)

Page 25: RDF and Drupal - The Semantic web

Why RDF ?

• W3C Standards• BBC, New York Times, Reuters, Facebook,

Linkedin• Google, Yahoo• Don’t Repeat Yourself

Page 26: RDF and Drupal - The Semantic web

RDF in Drupal 7

• In Core!!!• FOAF, SIOC, SKOC, DC “out of the box”• All users have a web ID user/3#me• All entities have a unique ID

Page 27: RDF and Drupal - The Semantic web

RDF in Drupal 7 : The Spices• Entity Types

node comment user

File Term Vocabulary

Page 28: RDF and Drupal - The Semantic web

RDF in Drupal 7 : The Spices• Attributes

title date All fields

Comment count Reply of creator

Page 29: RDF and Drupal - The Semantic web

Drupal 7 : Default Mappings

Page 30: RDF and Drupal - The Semantic web

Use Cases

Rich Search Result

Page 32: RDF and Drupal - The Semantic web

Web at Large and Drupal

• Drupal = Pioneer CMS• Platform of choice for many use cases• Influence the Trends• More RDF data on the web

The time to adopt RDF is NOW!

Page 33: RDF and Drupal - The Semantic web

What’s coming up

• RDF Mapping User Interface• SPARQL Endpoint• RDF Proxy

Page 34: RDF and Drupal - The Semantic web

Modify / Create RDF Mappings/*** Implements hook_rdf_namespace();*/

function myrdfmodule_rdf_namespace(){

return array(‘gr’ => ‘http://purl.org/goodrelations/w1#’‘product’ => ‘http://search.yahoo.com/searchmonkey/product/”

http://drupal.org/node/622170

Page 35: RDF and Drupal - The Semantic web

Modify / Create RDF Mappingsfunction node_rdf_mapping() { return array( array( 'type' => 'node', 'bundle' => RDF_DEFAULT_BUNDLE, 'mapping' => array( 'rdftype' => array('sioc:Item', 'foaf:Document'), 'title' => array( 'predicates' => array('dc:title'), ),...

Page 36: RDF and Drupal - The Semantic web

Some Resources

•http://groups.drupal.org/semantic-web•http://semantic-drupal.com/•http://www.w3.org/RDF/

Page 37: RDF and Drupal - The Semantic web

Thank you.

Contact me:• [email protected]•Linkedin.com/in/gauravkumar87We’re hiring!!!• Write to [email protected]• or come find me at the conference