Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Annotations as Linked Data with Fedora4 and Triannon

1,529 views

Published on

Presentation slides from Code4Lib 2015 about Triannon, Stanford's middleware over top of Fedora4's Linked Data Platform implementation.

Published in: Technology

Annotations as Linked Data with Fedora4 and Triannon

  1. 1. STANFORD UNIVERSITY LIBRARIES Annotations as Linked Data with Fedora4 and Triannon (A Real Use Case for RDF!) C O D E 4 L I B 2015 PO R T L A N D , OR FE B R U A R Y 11 Rob Sanderson / azaroth@stanford.edu / @azaroth42 Naomi Dushay / ndushay@stanford.edu
  2. 2. STANFORD UNIVERSITY LIBRARIES Annotations as Linked Data with Fedora4 and Triannon (A Real Use Case for RDF!) C O D E 4 L I B 2015 PO R T L A N D , OR FE B R U A R Y 11 Rob Sanderson / azaroth@stanford.edu / @azaroth42 Naomi Dushay / ndushay@stanford.edu
  3. 3. Where are the Dragons? :(
  4. 4. Triannon: Putting the Dragons Back in Portland since sometime last week Requirements: •  Create and manage tags/annotations in any client or environment •  Retrieve tags/annotations to display in any client •  With the identifiers of Works, not of catalog views Need: •  A model for annotations •  A format to serialize them into •  A protocol to transfer the serializations between systems •  Implementations!
  5. 5. JSON Annotation Format {! "@context": "http://www.w3.org/ns/oa-context-20130208.json",! "@id": "http://www.example.org/annotations/1",! "@type": "oa:Annotation”,! "motivatedBy":"oa:commenting",! "hasBody": {! "@type": "cnt:ContentAsText",! "chars": "Portland is somewhere here. Also Dragons",! "format": "text/plain"! },! "hasTarget": "http://purl.stanford.edu/bd136jk4522#xywh=..."! } !
  6. 6. JSON-LD Annotation Format {! "@context": "http://www.w3.org/ns/oa-context-20130208.json",! "@id": "http://www.example.org/annotations/1",! "@type": "oa:Annotation”,! "motivatedBy":"oa:commenting",! "hasBody": {! "@type": "cnt:ContentAsText",! "chars": "Portland is somewhere here. Also Dragons",! "format": "text/plain"! },! "hasTarget": "http://purl.stanford.edu/bd136jk4522#xywh=..."! } !
  7. 7. JSON-LD Annotation Format {! "@context": "http://www.w3.org/ns/oa-context-20130208.json",! "@id": "http://www.example.org/annotations/1",! "@type": "oa:Annotation”,! "motivatedBy":"oa:commenting",! "hasBody": {! "@type": "cnt:ContentAsText",! "chars": "Portland is somewhere here. Also Dragons",! "format": "text/plain"! },! "hasTarget": "http://purl.stanford.edu/bd136jk4522#xywh=..."! } ! Dirty not-so-secret time...
  8. 8. RDF Annotation Format {! "@context": "http://www.w3.org/ns/oa-context-20130208.json",! "@id": "http://www.example.org/annotations/1",! "@type": "oa:Annotation”,! "motivatedBy":"oa:commenting",! "hasBody": {! "@type": "cnt:ContentAsText",! "chars": "Portland is somewhere here. Also Dragons",! "format": "text/plain"! },! "hasTarget": "http://purl.stanford.edu/bd136jk4522#xywh=..."! } ! It's actually RDF, following the Open Annotation model
  9. 9. Open Annotation http://www.openannotation.org/spec/core/ http://www.w3.org/TR/annotation-model/ (beta)
  10. 10. Annotation Management: LDP
  11. 11. Reality is More Complex
  12. 12. In Reality ... •  Multiple resources to manage, each requires a POST •  Binary or external resources with descriptions tricky •  Multiple JSON-LD contexts complex (IIIF, OA, ...) Want: •  Ease of use/implementation for annotation client •  Ability to swap back-end to other LDP system •  Integration with Rails environment •  Search with Solr (easy) not SPARQL (less easy)
  13. 13. Triannon
  14. 14. Triannon plus Solr
  15. 15. Triannon: Implementation Goals •  Rapid Development •  Modular •  Re-Usable •  Deployable •  Maintainable
  16. 16. Triannon: Rails Engine Gem REST over HTTP Create POST jsonld, turtle, rdfxml Read GET " Update PUT/PATCH " Delete DELETE (id) Model ActiveRecord ActiveModel LDP View (for apps and developers) jsonld, turtle, rdfxml Controller http://github.com/sul-dlss/triannon
  17. 17. It’s the Graph, Baby!
  18. 18. Rails App (SearchWorks) ActiveTriples ld4l-open_annotation_rdf triple store (in memory) RDF SearchWorks: Create, Update, Delete Triannon id html form jsonld from RDF::Graph
  19. 19. Client App: Search and Display Triannon SolrClient App http://triannon-solr/by_target?url=purl.stanford.edu/bd136jk4522 'response'=>{'numFound'=>3,'start'=>0,'maxScore'=>1.0,'docs'=>[ { 'id'=>'98206ec8-4def-44b8-b190-648d8224ce1c’, 'anno_jsonld'=>'{"@context":"http://www.w3.org/ns/oa.jsonld","@graph": [{"@id":"_:g70038924372700","@type":["dctypes:Text","cnt:ContentAsText"], "format":"text/plain”, "chars":"Portland is somewhere here. Also Dragons”},{"@id":"https:// triannon-dev.stanford.edu/annotations/98206ec8-4def-44b8- b190-648d8224ce1c","@type":"oa:Annotation","hasBody":"_:g70038924372700","hasTarget":"http:// purl.stanford.edu/bd136jk4522","motivatedBy":"oa:commenting"}]}', ...}, { 'id'=>'f691b921-6f54-415b-9dfb-0d017f0d8ada', ...
  20. 20. Rails App (SearchWorks) ActiveTriples ld4l-open_annotation_rdf triple store (in memory) RDF SearchWorks: Read and Display •  Easy Access to Relevant Info from jsonld •  Rapid Development •  Modular •  Maintainable Triannon Solr jsonld as RDF::Graph Search for annos
  21. 21. LDP API Fedora 4Solr CRUD Search / Read CRUDCUD Client Application Client Application Client Application Triannon
  22. 22. STANFORD UNIVERSITY LIBRARIES Thank You! February 11th, 2015 azaroth@stanford.edu ndushay@stanford.edu

×