Semantic Web Applications

  • 2,118 views
Uploaded on

Lightning talks at dev8D, 11th Feb 2009. London UK.

Lightning talks at dev8D, 11th Feb 2009. London UK.

More in: Education
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
2,118
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
51
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Semantic Web Applications dev8D 2009
  • 2. About Me
    • Julian Higman
    • Talis Information Ltd
    • Building semantic web applications for libraries and educational institutions
    • [email_address]
    • http://julianhigman.com/blog
  • 3. About this talk
    • The Semantic Web and why it’s needed
    • Linked Open Data
    • Ontologies, RDF and Sparql
    • What we’ve built and how we built it
    • Hints and Tips
    • More info
  • 4. The Semantic Web
    • Web of Data
      • Machine readable
      • Structured, distributed, linked
    • Co-exists with web of documents
  • 5. Why it’s needed
    • Linking silos of data
    • Social networks demonstrate problem
    • Querying over combined sets of data
    • Data mashups
  • 6. Linked Open Data
    • “ Best practice for exposing, sharing and connecting pieces of data, information and knowledge on the Semantic Web using URIs and RDF” (Wikipedia)
      • Identify resources with unique URIs
      • Make URIs dereferenceable
      • Link to other data sets
  • 7. Linked Open Data
  • 8. Ontologies
    • RDF
    • FOAF
    • SIOC
    • Bibliontology
    • Dublin Core
    • SKOS
    • AIISO
  • 9. RDF
    • Subject – Predicate – Object
    • <http://talis.com/jhigman> <http://xmlns.com/foaf/0.1/name> “julian”
    • Several representations
      • RDX/XML
      • Turtle
      • N3
  • 10. RDFXML
    • <rdf:RDF xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot;
    • xmlns:foaf=&quot;http://xmlns.com/foaf/0.1/&quot;>
    • <rdf:Description rdf:about=&quot;http://life.ac.uk/people/benstongeorgej&quot;>
    • <rdf:type rdf:resource=&quot;http://xmlns.com/foaf/0.1/Person&quot;/>
    • <foaf:name>Benston, George J.</foaf:name>
    • </rdf:Description>
    • </rdf:RDF>
  • 11. SPARQL
    • DESCRIBE <http://life.ac.uk/people/benstongeorgej>
    • PREFIX aiiso: <http://purl.org/vocab/aiiso/schema#>
    • DESCRIBE <$institution> ?s
    • WHERE { <$institution> aiiso:organisationalUnit ?s }
  • 12. RDF Libraries
    • ARC2 (PHP)
    • Jena (Java)
    • Python, Ruby, etc
  • 13. What we’ve built
    • Talis Aspire
    • Resource list management
    • Collect, organise, share course reading materials
    • http:// blogs.talis.com /aspire/
  • 14. http://life.ac.uk/lists/abf203.html
  • 15. http://life.ac.uk/items/abf203-1.html
  • 16. http://life.ac.uk/items/abf203-1.rdf
  • 17. http://life.ac.uk/items/abf203-1.json
    • {
    • &quot;http://life.ac.uk/resources/id3781&quot; : {
    • &quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&quot; : [
    • { &quot;value&quot; : &quot;http://purl.org/ontology/bibo/WebPage&quot;, &quot;type&quot; : &quot;uri&quot; }
    • ],
    • &quot;http://purl.org/vocab/resourcelist/schema#list&quot; : [
    • { &quot;value&quot; : &quot;http://life.ac.uk/lists/abf203&quot;, &quot;type&quot; : &quot;uri&quot; }
    • ],
    • &quot;http://purl.org/ontology/bibo/uri&quot; : [
    • { &quot;value&quot; : &quot;http://www.google.co.uk/products?q=Elliott+and+Elliott+Financial+reporting+and+accounting+12th+edition&hl=en&cr=countryUK%7CcountryGB&um=1&sa=X&oi=froogle&ct=title&quot;, &quot;type&quot; : &quot;uri&quot; }
    • ],
    • &quot;http://purl.org/dc/terms/title&quot; : [
    • { &quot;value&quot; : &quot;Elliott and Elliott Financial reporting and accounting 12th edition - Google Product Search&quot;, &quot;type&quot; : &quot;literal&quot; }
    • ]
    • },
  • 18. A closer look at the RDF
    • xmlns:ns1=&quot;http://rdfs.org/sioc/spec/&quot;
    • xmlns:ns2=&quot;http://purl.org/vocab/resourcelist/schema#&quot;
    • xmlns:ns3=&quot;http://purl.org/vocab/lifecycle/schema#&quot;
    • xmlns:ns4=&quot;http://purl.org/dc/terms/&quot;
    • xmlns:ns5=&quot;http://purl.org/ontology/bibo/&quot;
    • <rdf:Description rdf:about=&quot;http://life.ac.uk/items/abf203-46&quot;>
    • <ns2:resource rdf:resource=&quot;http://life.ac.uk/resources/id3787&quot;/>
    • <ns1:note>This the most recent edition</ns1:note>
    • <ns3:state rdf:resource=&quot;http://purl.org/vocab/resourcelist/schema#status-published&quot;/>
    • <ns1:has_container rdf:resource=&quot;http://life.ac.uk/sections/abf203-9&quot;/>
    • <ns2:list rdf:resource=&quot;http://life.ac.uk/lists/abf203&quot;/>
    • <rdf:type rdf:resource=&quot;http://purl.org/vocab/resourcelist/schema#Item&quot;/>
    • </rdf:Description>
    • <rdf:Description rdf:about=&quot;http://life.ac.uk/resources/id3787&quot;>
    • <ns2:list rdf:resource=&quot;http://life.ac.uk/lists/abf203&quot;/>
    • <ns4:title>Elliott and Elliott Financial reporting and accounting 12th edition</ns4:title>
    • <ns5:uri rdf:resource=&quot;http://www.google.co.uk/products?q=Elliott+and+Elliott&quot;/>
    • <rdf:type rdf:resource=&quot;http://purl.org/ontology/bibo/WebPage&quot;/>
    • </rdf:Description>
  • 19. Query the store
    • <?php
    • require_once ( '../src/data/sparql-functions.php' );
    • $institution = $conceptUri;
    • $query = &quot;PREFIX aiiso: <http://purl.org/vocab/aiiso/schema#>
    • DESCRIBE <$institution> ?s WHERE { <$institution> aiiso:organisationalUnit ?s }&quot;;
    • $rdfxml = query_store_xml($tenant->listStore, $query);
    • $triples = parse_to_triples_array($rdfxml);
    • ?>
  • 20. Render HTML page
    • <?php
    • if (resourceHasProperty($triples, $conceptUri, ONT_aiiso. 'description' ))
    • {
    • echo '<p id=&quot;Description&quot;>' . getFirstValue($triples, $conceptUri, ONT_aiiso. 'description' ) . '</p>' ;
    • }
    • if (resourceHasProperty($triples, $conceptUri, ONT_resource. 'usesList' ))
    • {
    • echo '<h2 id=&quot;Lists-header&quot;>Lists</h2>' ;
    • echo '<ul id=&quot;lists&quot;>' ;
    • foreach ($triples[&quot;$conceptUri&quot;][ONT_resource. 'usesList' ] as $list)
    • {
    • $name = $triples[$list[ 'value' ]][ONT_sioc. 'name' ][0][ 'value' ];
    • echo “<li class=&quot;List&quot;><a href=&quot;{$list['value']}“ title=&quot;&quot;.trim($name).&quot;&quot;>{$name}</a></li>&quot;;
    • }
    • echo '</ul>' ;
    • }
    • ?>
  • 21. Render RDF page
    • <?php
    • header( 'Content-Type: application/rdf+xml; charset=UTF-8' );
    • echo $rdfxml;
    • ?>
  • 22. Hint and Tips
    • Reuse existing ontologies
      • essential
    • Create and publish an ontology
      • but only if you need to
    • Include links to other ontologies
      • owl:sameAs
  • 23. Hints and Tips
    • The data is not yours
      • expect incomplete data
      • expect extra data
      • expect multiple values
    • Avoid strong typing
      • #ResourceList can also be #Seq
  • 24. Hints and Tips
    • URIs are Nouns not Verbs
      • permalinks for resources
    • HTTP methods
      • GET, POST, PUT, DEL
    • Use HTTP codes
      • 404 if resource not found
      • 303 (See Also) to redirect
      • 405 Method Not Allowed
      • etc
  • 25. Hints and Tips
    • Writing data is more difficult than reading it
      • If data is gathered from many sources, who owns the triples?
      • How do you indicate which triples are to be replaced and which are to be added?
    • SPARQL Update, Changesets
  • 26. Hints and Tips
    • Editing with RDFa
      • rdfQuery library (by Jeni Tennison)
      • Markup html with RDFa
      • Edit elements in the browser
      • Extract new RDF model
      • Post new model to server
  • 27. Hints and Tips
    • <ol class=&quot;list&quot; id=&quot;theList&quot;
    • xmlns:tenant=&quot;http://purl.org/ontology/tenant/1.0/&quot;
    • xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot;
    • xmlns:sioc=&quot;http://rdfs.org/sioc/spec/&quot;
    • xmlns:resource=&quot;http://purl.org/vocab/resourcelist/schema#&quot;
    • xml:lang=&quot;en&quot;
    • about=&quot;[tenant:lists/abf203]&quot;
    • typeof=&quot;resource:List rdf:Seq&quot;>
    • <li class=&quot;section&quot; id=&quot;section-abf203-1&quot; typeof=&quot;resource:Section rdf:Seq&quot; about=&quot;[tenant:sections/abf203-1]&quot;>
    • <div class=&quot;sectionDetails&quot;>
    • <span class=&quot;sequenceNumber&quot; rev=&quot;rdf:_1&quot; resource=&quot;[tenant:lists/abf203]&quot;></span>
    • <span rev=&quot;resource:contains&quot; resource=&quot;[tenant:lists/abf203]&quot;></span>
    • <span class=&quot;hasParent&quot; rel=&quot;sioc:has_parent&quot; resource=&quot;[tenant:lists/abf203]&quot;></span>
    • <span class=&quot;name&quot; property=&quot;sioc:name&quot;>Recommended Text</span>
    • <ol id=&quot;section-abf203-1-items&quot; class=&quot;sectionItems&quot;>
    • <li class=&quot;item&quot; id=&quot;item-abf203-1&quot;>
    • <div typeof=&quot;resource:Item&quot; about=&quot;[tenant:items/abf203-1]&quot;>
    • <span rev=&quot;resource:contains&quot; resource=&quot;[tenant:lists/abf203]&quot;></span>
  • 28. Getting Started
    • Talis Platform triple store
      • http://n2.talis.com/
    • Moriarty PHP platform access library
      • http://code.google.com/p/moriarty/
  • 29. More
    • dbpedia
    • Open Calais
    • Search Monkey
    • Twine
    • Powerset