SlideShare une entreprise Scribd logo
1  sur  12
Idiomatic Persistence and Querying for
the W3C Web Annotation Data Model
Emanuel Berndl, Kai Schlegel, Andreas Eisenkolb, Harald Kosch
Chair of Distributed Information Systems
University of Passau
Add metadata to online assets,
but how?
• Metadata on multimedia useful in many different ways
• Further describe something
• Support semantic search
• Bridging the semantic gap, …
Web Annotations – Web Annotation
Data Model
• Web Annotations: “product” of the Web Annotation Data
Model1 WADM, a W3C standard
• “Annotations are typically used to convey information about
a resource or associations between resources. Simple
examples include a comment or a tag on a single web page or
image, or a blog post about a news article.”
• WADM Standard defines an RDF framework to design
shareable and expressive annotations
1https://www.w3.org/TR/annotation-model/
WADM – An Example
Anno4j
• Programmatic access to reading and writing Web
Annotations from and to SPARQL-endpoints
• Useable “without” RDF or SPARQL experience
• Hibernate-like mapping between RDF objects and Java
Objects
• Extensible design
• Usable with any SPARQL 1.1 endpoint
• Apache License 2.0  github.com/anno4j/anno4j
• Core library (smaller tweaks implemented):
OpenRDF Alibaba1 (former Elmo codebase)
• Features:
Persistence Querying
Graph context Transactions
Extensions/Plu
gins
1https://bitbucket.org/openrdf/alibaba
WADM – An Example
Persistence – Custom Model
@Iri(http://www.example.com/schema#AnimalBody)
public interface AnimalBody extends Body {
@Iri(RDF.VALUE)
String getAnimal();
@Iri(RDF.VALUE)
void setAnimal(String animal);
@Iri(EX.CONFIDENCE)
Double getConfidence();
@Iri(EX.CONFIDENCE)
void setConfidence(Double confidence);
}
Creating a Java class (with respective example values) leads to the following RDF
triples:
<urn:body> a ex:AnimalBody ;
rdf:value “panda” ;
ex:confidence 0.95 .
Persistence –
Anno4j Workflow
// Setup Anno4j instance
Anno4j anno4j = new Anno4j();
anno4j.setRepository(new
SPARQLRepository(“http://www.mydomain.com/sparql”));
anno4j.setIdGenerator(new MyIDGenerator());
// Create the Annotation
Annotation anno = anno4j.createObject(Annotation.class);
anno.setMotivatedBy( ... );
anno.setSerializedAt( ... );
// Create and attach the Body
AnimalBody body = anno4j
.createObject(AnimalBody.class);
body.setAnimal(“panda”);
body.setConfidence(0.95);
anno.setBody(body);
Querying
• Queries via Anno4j are done using the path-based query
language LDPath1
• Query for information on an RDF graph
• More convenient to non-RDF experts
• Transformed to an equivalent SPARQL 1.1 query
• Fluent interface supported for querying
LDPath examples
• Path Traversal: oa:hasBody/rdf:value
• Reverse Path: ^oa:hasTarget
• Types: ex:predicate[is-a ex:AnimalBody]
• Datatypes: ex:doubleValue[^^xsd:double]
• Languages: ex:langValue[@en]
• Grouping & Unions: (ex:pred1/ex:pred2) | ex:pred3
1http://marmotta.apache.org/ldpath/
Querying – Example
// Setup QueryService
QueryService qs = anno4j.createQueryService();
qs.addPrefix(“ex”, “http://www.example.com/schema#”)
.addCriteria(“oa:hasBody[is-a ex:AnimalBody]”)
.addCriteria(“oa:hasBody/rdf:value”, “panda”)
.addCriteria(“oa:hasBody/ex:confidence”, 0.8, Comparison.GTE);
// Query for Annotations
List<Annotation> result = qs.execute(Annotation.class);
Additional Features
• LDPath criteria(s)
directly mapped to
equivalent
SPARQL 1.1 query
• Extensions/Plugins
• Support custom LDPath function + query logic
• Transactions (beta)
• Transactional behavior can be used with the triplestore
• Set of actions: commit or rollback
• Basic behavior: Auto-commit
• Graph Contexts / Subgraphs
• Lazy evaluation for faster and more efficient querying
Summary
• Anno4j is in use in the MICO project (Media in Context):
WADM adaption
• Future steps include the implementation of the Web
Annotation Protocol WAP1 in Anno4j, adding a web facet to
the library
1https://www.w3.org/TR/annotation-protocol/

Contenu connexe

Tendances

Battle of the Giants - Apache Solr vs. Elasticsearch (ApacheCon)
Battle of the Giants - Apache Solr vs. Elasticsearch (ApacheCon)Battle of the Giants - Apache Solr vs. Elasticsearch (ApacheCon)
Battle of the Giants - Apache Solr vs. Elasticsearch (ApacheCon)
Sematext Group, Inc.
 
Volltextsuche im Vergleich
Volltextsuche im VergleichVolltextsuche im Vergleich
Volltextsuche im Vergleich
Walter Ebert
 
CrossRef Annual Meeting 2012 ORCID Laure Haak
CrossRef Annual Meeting 2012 ORCID Laure HaakCrossRef Annual Meeting 2012 ORCID Laure Haak
CrossRef Annual Meeting 2012 ORCID Laure Haak
Crossref
 

Tendances (20)

Wanna search? Piece of cake!
Wanna search? Piece of cake!Wanna search? Piece of cake!
Wanna search? Piece of cake!
 
Elasticsearch Introduction at BigData meetup
Elasticsearch Introduction at BigData meetupElasticsearch Introduction at BigData meetup
Elasticsearch Introduction at BigData meetup
 
LIASA-HELIG ORCID Webinar
LIASA-HELIG ORCID WebinarLIASA-HELIG ORCID Webinar
LIASA-HELIG ORCID Webinar
 
Answers to usual issues in getting started with consuming Linked Data
Answers to usual issues in getting started with consuming Linked DataAnswers to usual issues in getting started with consuming Linked Data
Answers to usual issues in getting started with consuming Linked Data
 
An Introduction to Elastic Search.
An Introduction to Elastic Search.An Introduction to Elastic Search.
An Introduction to Elastic Search.
 
Elasticsearch - Devoxx France 2012 - English version
Elasticsearch - Devoxx France 2012 - English versionElasticsearch - Devoxx France 2012 - English version
Elasticsearch - Devoxx France 2012 - English version
 
Introduction to Elasticsearch
Introduction to ElasticsearchIntroduction to Elasticsearch
Introduction to Elasticsearch
 
Workshop: Learning Elasticsearch
Workshop: Learning ElasticsearchWorkshop: Learning Elasticsearch
Workshop: Learning Elasticsearch
 
ElasticSearch in action
ElasticSearch in actionElasticSearch in action
ElasticSearch in action
 
Battle of the Giants - Apache Solr vs. Elasticsearch (ApacheCon)
Battle of the Giants - Apache Solr vs. Elasticsearch (ApacheCon)Battle of the Giants - Apache Solr vs. Elasticsearch (ApacheCon)
Battle of the Giants - Apache Solr vs. Elasticsearch (ApacheCon)
 
Volltextsuche im Vergleich
Volltextsuche im VergleichVolltextsuche im Vergleich
Volltextsuche im Vergleich
 
Searching Relational Data with Elasticsearch
Searching Relational Data with ElasticsearchSearching Relational Data with Elasticsearch
Searching Relational Data with Elasticsearch
 
Philly PHP: April '17 Elastic Search Introduction by Aditya Bhamidpati
Philly PHP: April '17 Elastic Search Introduction by Aditya BhamidpatiPhilly PHP: April '17 Elastic Search Introduction by Aditya Bhamidpati
Philly PHP: April '17 Elastic Search Introduction by Aditya Bhamidpati
 
"TextMining with ElasticSearch", Saskia Vola, CEO at textminers.io
"TextMining with ElasticSearch", Saskia Vola, CEO at textminers.io"TextMining with ElasticSearch", Saskia Vola, CEO at textminers.io
"TextMining with ElasticSearch", Saskia Vola, CEO at textminers.io
 
Elasticsearch Introduction to Data model, Search & Aggregations
Elasticsearch Introduction to Data model, Search & AggregationsElasticsearch Introduction to Data model, Search & Aggregations
Elasticsearch Introduction to Data model, Search & Aggregations
 
CrossRef Annual Meeting 2012 ORCID Laure Haak
CrossRef Annual Meeting 2012 ORCID Laure HaakCrossRef Annual Meeting 2012 ORCID Laure Haak
CrossRef Annual Meeting 2012 ORCID Laure Haak
 
Elastic pivorak
Elastic pivorakElastic pivorak
Elastic pivorak
 
Multiple Resolution and handling content available in multiple places
Multiple Resolution and handling content available in multiple placesMultiple Resolution and handling content available in multiple places
Multiple Resolution and handling content available in multiple places
 
Your Data, Your Search, ElasticSearch (EURUKO 2011)
Your Data, Your Search, ElasticSearch (EURUKO 2011)Your Data, Your Search, ElasticSearch (EURUKO 2011)
Your Data, Your Search, ElasticSearch (EURUKO 2011)
 
Introduction to Elasticsearch
Introduction to ElasticsearchIntroduction to Elasticsearch
Introduction to Elasticsearch
 

Similaire à Anno4j - Idiomatic Persistence and Querying for the W3C Annotation Data Model

Consuming Linked Data 4/5 Semtech2011
Consuming Linked Data 4/5 Semtech2011Consuming Linked Data 4/5 Semtech2011
Consuming Linked Data 4/5 Semtech2011
Juan Sequeda
 
Pushing Chemical Biology Through the Pipes
Pushing Chemical Biology Through the PipesPushing Chemical Biology Through the Pipes
Pushing Chemical Biology Through the Pipes
Rajarshi Guha
 
Using elasticsearch with rails
Using elasticsearch with railsUsing elasticsearch with rails
Using elasticsearch with rails
Tom Z Zeng
 

Similaire à Anno4j - Idiomatic Persistence and Querying for the W3C Annotation Data Model (20)

Drupal and Apache Stanbol
Drupal and Apache StanbolDrupal and Apache Stanbol
Drupal and Apache Stanbol
 
The nature.com ontologies portal: nature.com/ontologies
The nature.com ontologies portal: nature.com/ontologiesThe nature.com ontologies portal: nature.com/ontologies
The nature.com ontologies portal: nature.com/ontologies
 
Consuming Linked Data 4/5 Semtech2011
Consuming Linked Data 4/5 Semtech2011Consuming Linked Data 4/5 Semtech2011
Consuming Linked Data 4/5 Semtech2011
 
Producing, publishing and consuming linked data - CSHALS 2013
Producing, publishing and consuming linked data - CSHALS 2013Producing, publishing and consuming linked data - CSHALS 2013
Producing, publishing and consuming linked data - CSHALS 2013
 
Bio2RDF presentation at Combine 2012
Bio2RDF presentation at Combine 2012Bio2RDF presentation at Combine 2012
Bio2RDF presentation at Combine 2012
 
The Nature.com ontologies portal - Linked Science 2015
The Nature.com ontologies portal - Linked Science 2015The Nature.com ontologies portal - Linked Science 2015
The Nature.com ontologies portal - Linked Science 2015
 
balloon Fusion: SPARQL Rewriting Based on Unified Co-Reference Information
balloon Fusion: SPARQL Rewriting Based on  Unified Co-Reference Informationballoon Fusion: SPARQL Rewriting Based on  Unified Co-Reference Information
balloon Fusion: SPARQL Rewriting Based on Unified Co-Reference Information
 
Pushing Chemical Biology Through the Pipes
Pushing Chemical Biology Through the PipesPushing Chemical Biology Through the Pipes
Pushing Chemical Biology Through the Pipes
 
Examiness hints and tips from the trenches
Examiness hints and tips from the trenchesExaminess hints and tips from the trenches
Examiness hints and tips from the trenches
 
SWIB14 Weaving repository contents into the Semantic Web
SWIB14 Weaving repository contents into the Semantic WebSWIB14 Weaving repository contents into the Semantic Web
SWIB14 Weaving repository contents into the Semantic Web
 
Elasticsearch python
Elasticsearch pythonElasticsearch python
Elasticsearch python
 
Integrating a Domain Ontology Development Environment and an Ontology Search ...
Integrating a Domain Ontology Development Environment and an Ontology Search ...Integrating a Domain Ontology Development Environment and an Ontology Search ...
Integrating a Domain Ontology Development Environment and an Ontology Search ...
 
Stanbol
StanbolStanbol
Stanbol
 
Metadata is back!
Metadata is back!Metadata is back!
Metadata is back!
 
Write code that writes code! A beginner's guide to Annotation Processing - Ja...
Write code that writes code! A beginner's guide to Annotation Processing - Ja...Write code that writes code! A beginner's guide to Annotation Processing - Ja...
Write code that writes code! A beginner's guide to Annotation Processing - Ja...
 
Write code that writes code!
Write code that writes code!Write code that writes code!
Write code that writes code!
 
ontology.ppt
ontology.pptontology.ppt
ontology.ppt
 
Using elasticsearch with rails
Using elasticsearch with railsUsing elasticsearch with rails
Using elasticsearch with rails
 
If You Have The Content, Then Apache Has The Technology!
If You Have The Content, Then Apache Has The Technology!If You Have The Content, Then Apache Has The Technology!
If You Have The Content, Then Apache Has The Technology!
 
Vital AI: Big Data Modeling
Vital AI: Big Data ModelingVital AI: Big Data Modeling
Vital AI: Big Data Modeling
 

Dernier

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Dernier (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

Anno4j - Idiomatic Persistence and Querying for the W3C Annotation Data Model

  • 1. Idiomatic Persistence and Querying for the W3C Web Annotation Data Model Emanuel Berndl, Kai Schlegel, Andreas Eisenkolb, Harald Kosch Chair of Distributed Information Systems University of Passau
  • 2. Add metadata to online assets, but how? • Metadata on multimedia useful in many different ways • Further describe something • Support semantic search • Bridging the semantic gap, …
  • 3. Web Annotations – Web Annotation Data Model • Web Annotations: “product” of the Web Annotation Data Model1 WADM, a W3C standard • “Annotations are typically used to convey information about a resource or associations between resources. Simple examples include a comment or a tag on a single web page or image, or a blog post about a news article.” • WADM Standard defines an RDF framework to design shareable and expressive annotations 1https://www.w3.org/TR/annotation-model/
  • 4. WADM – An Example
  • 5. Anno4j • Programmatic access to reading and writing Web Annotations from and to SPARQL-endpoints • Useable “without” RDF or SPARQL experience • Hibernate-like mapping between RDF objects and Java Objects • Extensible design • Usable with any SPARQL 1.1 endpoint • Apache License 2.0  github.com/anno4j/anno4j • Core library (smaller tweaks implemented): OpenRDF Alibaba1 (former Elmo codebase) • Features: Persistence Querying Graph context Transactions Extensions/Plu gins 1https://bitbucket.org/openrdf/alibaba
  • 6. WADM – An Example
  • 7. Persistence – Custom Model @Iri(http://www.example.com/schema#AnimalBody) public interface AnimalBody extends Body { @Iri(RDF.VALUE) String getAnimal(); @Iri(RDF.VALUE) void setAnimal(String animal); @Iri(EX.CONFIDENCE) Double getConfidence(); @Iri(EX.CONFIDENCE) void setConfidence(Double confidence); } Creating a Java class (with respective example values) leads to the following RDF triples: <urn:body> a ex:AnimalBody ; rdf:value “panda” ; ex:confidence 0.95 .
  • 8. Persistence – Anno4j Workflow // Setup Anno4j instance Anno4j anno4j = new Anno4j(); anno4j.setRepository(new SPARQLRepository(“http://www.mydomain.com/sparql”)); anno4j.setIdGenerator(new MyIDGenerator()); // Create the Annotation Annotation anno = anno4j.createObject(Annotation.class); anno.setMotivatedBy( ... ); anno.setSerializedAt( ... ); // Create and attach the Body AnimalBody body = anno4j .createObject(AnimalBody.class); body.setAnimal(“panda”); body.setConfidence(0.95); anno.setBody(body);
  • 9. Querying • Queries via Anno4j are done using the path-based query language LDPath1 • Query for information on an RDF graph • More convenient to non-RDF experts • Transformed to an equivalent SPARQL 1.1 query • Fluent interface supported for querying LDPath examples • Path Traversal: oa:hasBody/rdf:value • Reverse Path: ^oa:hasTarget • Types: ex:predicate[is-a ex:AnimalBody] • Datatypes: ex:doubleValue[^^xsd:double] • Languages: ex:langValue[@en] • Grouping & Unions: (ex:pred1/ex:pred2) | ex:pred3 1http://marmotta.apache.org/ldpath/
  • 10. Querying – Example // Setup QueryService QueryService qs = anno4j.createQueryService(); qs.addPrefix(“ex”, “http://www.example.com/schema#”) .addCriteria(“oa:hasBody[is-a ex:AnimalBody]”) .addCriteria(“oa:hasBody/rdf:value”, “panda”) .addCriteria(“oa:hasBody/ex:confidence”, 0.8, Comparison.GTE); // Query for Annotations List<Annotation> result = qs.execute(Annotation.class);
  • 11. Additional Features • LDPath criteria(s) directly mapped to equivalent SPARQL 1.1 query • Extensions/Plugins • Support custom LDPath function + query logic • Transactions (beta) • Transactional behavior can be used with the triplestore • Set of actions: commit or rollback • Basic behavior: Auto-commit • Graph Contexts / Subgraphs • Lazy evaluation for faster and more efficient querying
  • 12. Summary • Anno4j is in use in the MICO project (Media in Context): WADM adaption • Future steps include the implementation of the Web Annotation Protocol WAP1 in Anno4j, adding a web facet to the library 1https://www.w3.org/TR/annotation-protocol/

Notes de l'éditeur

  1. Vorbild Hibernate Idiomatic – The strength of one language is used in your own familiar (programming) language
  2. MICO as context?
  3. Bessere Motivation, warum Annotationen? Problem+Lösung
  4. Make sure, that this is a WADM example and NOT contribution
  5. ORM Object Relational Mapping -> ORM Object RDF Mapping
  6. Make sure, that this is a WADM example and NOT contribution
  7. Nicht nur Annotationen sind möglich, komplett eigenes Modell kann erstellt werden
  8. PROXY – für mehrere RDF Klassen nötig, Partials – bei .createObject() nur kurz erwähnen Bild weg?
  9. Add criteria constraint by constraint
  10. Zusammenfassung: features und contribution + outlook: WAP