Upload
robert-sanderson
View
578
Download
0
Tags:
Embed Size (px)
Citation preview
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 2 0 1 5 P O R T L A N D , O R F E B R U A R Y 11
Rob Sanderson / [email protected] / @azaroth42 Naomi Dushay / [email protected]
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 2 0 1 5 P O R T L A N D , O R F E B R U A R Y 11
Rob Sanderson / [email protected] / @azaroth42 Naomi Dushay / [email protected]
Where are the Dragons? :(
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!
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=..."!} !
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=..."!} !
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...
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
Open Annotation
http://www.openannotation.org/spec/core/
http://www.w3.org/TR/annotation-model/ (beta)
Annotation Management: LDP
Reality is More Complex
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)
Triannon
Triannon plus Solr
Triannon: Implementation Goals
• Rapid Development • Modular • Re-Usable • Deployable • Maintainable
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
It’s the Graph, Baby!
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
Client App: Search and Display
Triannon Solr Client 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',
...
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
LDP API
Fedora 4Solr
CRUD
Search / Read CRUDCUD
Client Application
Client Application
Client Application
Triannon