Enabling the Semantic Web and RDF in Plone

Presenter:Calvin Hendryx-Parker, Six Feet Up, Inc.
Date: Friday, October 27, 2006

Semantic Web Concepts

What is RDF

rdf_w3c_icon.128.gif

RDF Schemas and Web Ontology Language (OWL)

Example Ontology

Example Applications RDF

Describing Beer

guinness.jpg

Where you can get Beer

IdealBar.jpg

Someone I know

ChrisM.jpg

Who you drink with

DrinkingBuddies.jpg

Describes Resources and Structures

N-Triples in Action

<http://rosettaproject.org/archive/ZZZ>
lingual:isOfLanguiodType
lingual:Language .

<http://rosettaproject.org/archive/ZZZ>
dc:title
"Dimli" .
  • Triples
    • Subject
    • Predicate
    • Object
  • Resource Identification
    • URIs

Real World Usage

Rosetta Project

  • Project to build an archive of all documented human languages.
  • Sub project of the Long Now Foundation
  • 10,000 Languages
  • Over 4,000 Archive Documents and growing

The Rosetta Projects Problem

Many Structures One Set of Data

Flat Node Structure

Many Structures One Set of Data

Node Structure 1

Many Structures One Set of Data

Node Structure 2

Archiving and Interoperability

Why not use Relational Databases

Reification

Querying RDF

RDFLib

    def languages_by_type(self, datatype, context=documents):
        sparqlGr = SPARQLGraph(self.graph)
        select = ("?lang",)
        where = GraphPattern([("?doc", self.rosettaType, datatype), ("?doc", self.refersToLanguoid, "?lang")])
        result = sparqlGr.query(select, where)
        return set(result)
SELECT ?lang
WHERE
{
  ?doc <http://rosettaproject.org/lingbib#rosettaType> datatype .
  ?doc <http://rosettaproject.org/lingbib#refersToLanguoid> ?lang
}

GraphPath

Example GraphPath Query

    def documents_of_type_within(self, language, datatype, context=lingbib):
        result= []
        languages = []
        for l in self.pop_graph>>Node(URIRef(language))//Property(self.isMotherOf):
            languages.append(URIRef(l))
        result = self.documents_of_type_in(languages, datatype, context)
        return result

    def documents_in(self, languages, context=lingbib):
        result = []
        for p in self.pop_graph>>Any()[Property(self.refersToLanguoid)/Nodes(languages)]:
            result.append(p)
        return result

    def documents_within(self, language, context=lingbib):  # provide a region arg?
        result= []
        languages = []
        for l in self.pop_graph>>Node(URIRef(language))//Property(self.isMotherOf):
            languages.append(URIRef(l))
        result = self.documents_in(languages, context)
        return result

Conclusion

Project just released last Friday!

http://www.rosettaproject.org/

Questions?