SlideShare ist ein Scribd-Unternehmen logo
1 von 25
Downloaden Sie, um offline zu lesen
Got bored by the relational database?
       Switch to a RDF store!

           Fabrizio Giudici
           Tidalwave s.a.s.
Who I am
●   Java consultant since 1996
●   Senior architect
●   Java instructor for Sun since 1998
●   Member of the NetBeans Dream Team
●   Technical Writer, Blogger at Java.Net, DZone
●   http://weblogs.java.net/blog/fabriziogiudici/
●   http://www.tidalwave.it/people
Where I am using RDF stores




 http://bluemarine.tidalwave.it
Agenda
●   Why the RDBMs?
●   RDBMs issues
●   The Semantic Model
●   OpenSesame and Elmo
●   A few code samples
●   Conclusion
RDBMs are everywhere
What do we expect from a RDBM?
●   Persistence
●   Reliability
●   Transactions
●   Integrability
●   Manageability
Lack of cohesion
●   Do we really need a RDBM for those things?
●   No, we don't
       –   Persistence and transactions are good
       –   The specific relational schema is evil
●   RDBMs sell those stuff in a single package
ER-OO impedance
●   Entity-Relationship is different than OO
        –   Primary keys
        –   No inheritance
        –   No behaviour
        –   Normalization rules
        –   Relationship through external keys
ORMs
●   Tools to minimize the ER-OO impedance
●   Java has got a standard API: JPA
       –   Hibernate, TopLink, EclipseLink, OpenJPA
       –   Tries to abstract the database à la Java
●   Good, but the RDBM has still to be designed
●   And maintained
Can we get rid of the relational database?
The Semantic Model
●   Semantic Technology != Semantic Web
●   RDF: Resource Description Framework
●   “Triples” are the atomic information item
●   Subject / predicate / object
        –   Java / is-a / programming-language
        –   Fabrizio / is-member-of / NetBeans Dream Team
        –   Verona / is-part-of / Veneto
        –   Verona / has-plate / “VR”
The Semantic Model
●   The subject is a resource
●   The predicate is a property
●   The object is a value
●   A value is a resource or a primitive type
●   Resources, properties identified by URL/URN
        –   Just a naming scheme
        –   Not necessarily web-related
Formal representation
●   RDF is not related to XML
●   XML is just one of the way to represent RDF
        –   XML-RDF, unfortunately referred to as RDF
●   Notation 3 (N3), another popular representation
        –   Much more human-readable
●   Other formats exist
●   RDF representation is often referred to as
    “serialization”
(XML-)RDF is near to you
●   RSS/RDF
●   Dublin Core
●   XMP by Adobe
Compared to RDBMs
●   There's no fixed schema
         –   Everything is a triple
    –   “AAA slogan”: Anyone can say Anything
        about Any topic
●   Adding new data types is adding triples
         –   No need to add / alter tables
         –   Maintainance is just updating data
●   Databases can be distributed (federations)
         –   Can be merged by just copying triples together
What about performance?
●   Not as optimized as SQL
●   There's no spread knowledge about tuning as
    for SQL
●   Some missing parts
       –   E.g. Sesame still misses select count(*)
OpenSesame, Elmo
●   Popular Java infrastructure for RDF
       –   FLOSS
       –   http://www.openrdf.org
●   Elmo providers JPA-like operations
       –   Annotations
       –   Specific API or even subset of JPA
A simple code example
       import org.openrdf.elmo.annotations.rdf;

       @rdf(GeoVocabulary.URI_GEO_LOCATION)
       public class GeoLocation
        {
          @rdf("http://www.w3.org/2003/01/geo/wgs84_pos#lat")
          private Double latitude;

            @rdf("http://www.w3.org/2003/01/geo/wgs84_pos#long")
            private Double longitude;

            @rdf("http://www.w3.org/2003/01/geo/wgs84_pos#alt")
            private Double altitude;

            @rdf("http://www.tidalwave.it/rdf/geo/2009/02/22#code")
            private String code;
        }

●   Note the use of standard ontologies
A simple code example
●   Declare persistent classes in
    META-INF/org.openrdf.elmo.concepts
●   Choose a store
         –   Memory
         –   Memory backed by file
         –   Database (transactional)
    Repository repository = new SailRepository(
                             new MemoryStore(new File("/tmp/RDFStore")));
    repository.initialize();
    ElmoModule module = new ElmoModule();
    SesameManagerFactory factory = new SesameManagerFactory(module, repository);
    SesameManager em = factory.createElmoManager();
Use as JPA EntityManager


 em.getTransaction().begin();
 GeoLocation genova = new GeoLocation();
 genova.setLatitude(45.0);
 genova.setLongitude(9.0);
 genova.setCode("GE");

 em.persist(genova);
 em.getTransaction().commit();
Queries
●    There are specific query languages
●    SPARQL is one of the most popular
●    Similar to SQL, but triples in place of tables


    PREFIX wgs84: <http://www.w3.org/2003/01/geo/wgs84_pos#>
    SELECT ?location WHERE
     {
       ?location wgs84:lat ?lat
     }
Running a query
em.getTransaction().begin();
String queryString = "PREFIX wgs84: <http://www.w3.org/2003/01/geo/wgs84_pos#>n" +
             "SELECT ?location WHERE n" +
             " {n" +
             " ?location a ?type.n" +
             " ?location wgs84:lat ?latn" +
             " }";
final ElmoQuery query = em.createQuery(queryString).
                 setType("type", GeoLocation.class).
                 setParameter("lat", 45.0);

final List<GeoLocation> result = query.getResultList();

for (GeoLocation l : result)
 {
     System.err.println(l);
 }

em.getTransaction().commit();
Scratching the surface
●   Elmo is powerful
●   Supports advanced constructs
       –   Objects with “multiple personality”
       –   Mixins
Open issues
●   OpenSesame doesn't support all databases
●   Lack of experience
       –   Programming skills
       –   Maintainance
       –   Tuning
       –   Managerial culture
●   Not widespread
●   Performance?
Conclusion
●   RDBMs are mainstream, but old
●   They lead to rigid schemata, don't fit the OO
●   It's possible to use something different
●   RDF stores can be a viable alternative




                               Fabrizio.Giudici@tidalwave.it

Weitere ähnliche Inhalte

Was ist angesagt?

Java and Java platforms
Java and Java platformsJava and Java platforms
Java and Java platformsIlio Catallo
 
Object Oriented Programming : Part 2
Object Oriented Programming : Part 2Object Oriented Programming : Part 2
Object Oriented Programming : Part 2Madhavan Malolan
 
Scala the good and bad parts
Scala the good and bad partsScala the good and bad parts
Scala the good and bad partsbenewu
 
Session 01 - Introduction to Java
Session 01 - Introduction to JavaSession 01 - Introduction to Java
Session 01 - Introduction to JavaPawanMM
 
Session 02 - Elements of Java Language
Session 02 - Elements of Java LanguageSession 02 - Elements of Java Language
Session 02 - Elements of Java LanguagePawanMM
 
RDF_API_Java_Stefan_Apostoaie
RDF_API_Java_Stefan_ApostoaieRDF_API_Java_Stefan_Apostoaie
RDF_API_Java_Stefan_Apostoaieiosstef
 
Polyglot and functional (Devoxx Nov/2011)
Polyglot and functional (Devoxx Nov/2011)Polyglot and functional (Devoxx Nov/2011)
Polyglot and functional (Devoxx Nov/2011)Martijn Verburg
 
Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)Martijn Verburg
 
Functional OOP, Clojure style
Functional OOP, Clojure styleFunctional OOP, Clojure style
Functional OOP, Clojure styleyoavrubin
 
Core java lessons
Core java lessonsCore java lessons
Core java lessonsvivek shah
 
Java OOP s concepts and buzzwords
Java OOP s concepts and buzzwordsJava OOP s concepts and buzzwords
Java OOP s concepts and buzzwordsRaja Sekhar
 
Paython courses in pune ppt
Paython courses in pune pptPaython courses in pune ppt
Paython courses in pune pptsambhajimeher
 
NUS Hackers Club Mar 21 - Whats New in JavaSE 8?
NUS Hackers Club Mar 21 - Whats New in JavaSE 8?NUS Hackers Club Mar 21 - Whats New in JavaSE 8?
NUS Hackers Club Mar 21 - Whats New in JavaSE 8?Chuk-Munn Lee
 

Was ist angesagt? (20)

Working with jpa
Working with jpaWorking with jpa
Working with jpa
 
Java and Java platforms
Java and Java platformsJava and Java platforms
Java and Java platforms
 
Stay fresh
Stay freshStay fresh
Stay fresh
 
Object Oriented Programming : Part 2
Object Oriented Programming : Part 2Object Oriented Programming : Part 2
Object Oriented Programming : Part 2
 
Scala the good and bad parts
Scala the good and bad partsScala the good and bad parts
Scala the good and bad parts
 
Session 01 - Introduction to Java
Session 01 - Introduction to JavaSession 01 - Introduction to Java
Session 01 - Introduction to Java
 
Session 02 - Elements of Java Language
Session 02 - Elements of Java LanguageSession 02 - Elements of Java Language
Session 02 - Elements of Java Language
 
OOP in Java
OOP in JavaOOP in Java
OOP in Java
 
RDF_API_Java_Stefan_Apostoaie
RDF_API_Java_Stefan_ApostoaieRDF_API_Java_Stefan_Apostoaie
RDF_API_Java_Stefan_Apostoaie
 
Polyglot and functional (Devoxx Nov/2011)
Polyglot and functional (Devoxx Nov/2011)Polyglot and functional (Devoxx Nov/2011)
Polyglot and functional (Devoxx Nov/2011)
 
Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)Polyglot and Functional Programming (OSCON 2012)
Polyglot and Functional Programming (OSCON 2012)
 
Functional OOP, Clojure style
Functional OOP, Clojure styleFunctional OOP, Clojure style
Functional OOP, Clojure style
 
Presentation on java
Presentation  on  javaPresentation  on  java
Presentation on java
 
Java Starting
Java StartingJava Starting
Java Starting
 
Core java lessons
Core java lessonsCore java lessons
Core java lessons
 
Java OOP s concepts and buzzwords
Java OOP s concepts and buzzwordsJava OOP s concepts and buzzwords
Java OOP s concepts and buzzwords
 
Paython courses in pune ppt
Paython courses in pune pptPaython courses in pune ppt
Paython courses in pune ppt
 
01 introduction to oop and java
01 introduction to oop and java01 introduction to oop and java
01 introduction to oop and java
 
Comp102 lec 3
Comp102   lec 3Comp102   lec 3
Comp102 lec 3
 
NUS Hackers Club Mar 21 - Whats New in JavaSE 8?
NUS Hackers Club Mar 21 - Whats New in JavaSE 8?NUS Hackers Club Mar 21 - Whats New in JavaSE 8?
NUS Hackers Club Mar 21 - Whats New in JavaSE 8?
 

Andere mochten auch

Parancoe and Lambico
Parancoe and LambicoParancoe and Lambico
Parancoe and Lambicobenfante
 
Knowledge base – direc tv’s naso development
Knowledge base – direc tv’s naso developmentKnowledge base – direc tv’s naso development
Knowledge base – direc tv’s naso developmentjericbd
 
Java e i database: da JDBC a JPA
Java e i database: da JDBC a JPAJava e i database: da JDBC a JPA
Java e i database: da JDBC a JPAbenfante
 
Annotated controllers with Spring MVC 2.5
Annotated controllers with Spring MVC 2.5Annotated controllers with Spring MVC 2.5
Annotated controllers with Spring MVC 2.5benfante
 
Applicazione JavaFX – CORSA DI AUTO SU TRACCIATI REALI
Applicazione JavaFX – CORSA DI AUTO SU TRACCIATI REALIApplicazione JavaFX – CORSA DI AUTO SU TRACCIATI REALI
Applicazione JavaFX – CORSA DI AUTO SU TRACCIATI REALIbenfante
 
Digital Cartel (D.C) Corporate Profile
Digital Cartel (D.C) Corporate ProfileDigital Cartel (D.C) Corporate Profile
Digital Cartel (D.C) Corporate ProfileHammad Khan
 

Andere mochten auch (9)

Parancoe and Lambico
Parancoe and LambicoParancoe and Lambico
Parancoe and Lambico
 
Knowledge base – direc tv’s naso development
Knowledge base – direc tv’s naso developmentKnowledge base – direc tv’s naso development
Knowledge base – direc tv’s naso development
 
Java e i database: da JDBC a JPA
Java e i database: da JDBC a JPAJava e i database: da JDBC a JPA
Java e i database: da JDBC a JPA
 
Annotated controllers with Spring MVC 2.5
Annotated controllers with Spring MVC 2.5Annotated controllers with Spring MVC 2.5
Annotated controllers with Spring MVC 2.5
 
Java Persistence 2.0
Java Persistence 2.0Java Persistence 2.0
Java Persistence 2.0
 
Applicazione JavaFX – CORSA DI AUTO SU TRACCIATI REALI
Applicazione JavaFX – CORSA DI AUTO SU TRACCIATI REALIApplicazione JavaFX – CORSA DI AUTO SU TRACCIATI REALI
Applicazione JavaFX – CORSA DI AUTO SU TRACCIATI REALI
 
Steve Jobs
Steve JobsSteve Jobs
Steve Jobs
 
Digital Cartel (D.C) Corporate Profile
Digital Cartel (D.C) Corporate ProfileDigital Cartel (D.C) Corporate Profile
Digital Cartel (D.C) Corporate Profile
 
Milieu
MilieuMilieu
Milieu
 

Ähnlich wie Got bored by the relational database? Switch to a RDF store!

Reactive Software Systems
Reactive Software SystemsReactive Software Systems
Reactive Software SystemsBehrad Zari
 
Achieve the norm with Idiorm
Achieve the norm with IdiormAchieve the norm with Idiorm
Achieve the norm with IdiormStipe Predanic
 
Dart the Better JavaScript
Dart the Better JavaScriptDart the Better JavaScript
Dart the Better JavaScriptJorg Janke
 
Enhancing Domain Specific Language Implementations Through Ontology
Enhancing Domain Specific Language Implementations Through OntologyEnhancing Domain Specific Language Implementations Through Ontology
Enhancing Domain Specific Language Implementations Through OntologyChunhua Liao
 
FregeDay: Design and Implementation of the language (Ingo Wechsung)
FregeDay: Design and Implementation of the language (Ingo Wechsung)FregeDay: Design and Implementation of the language (Ingo Wechsung)
FregeDay: Design and Implementation of the language (Ingo Wechsung)Dierk König
 
Object Relational Mapping with Dapper (Micro ORM)
Object Relational Mapping with Dapper (Micro ORM)Object Relational Mapping with Dapper (Micro ORM)
Object Relational Mapping with Dapper (Micro ORM)Muhammad Umar
 
Ontology Access Kit_ Workshop Intro Slides.pptx
Ontology Access Kit_ Workshop Intro Slides.pptxOntology Access Kit_ Workshop Intro Slides.pptx
Ontology Access Kit_ Workshop Intro Slides.pptxChris Mungall
 
Java Closures
Java ClosuresJava Closures
Java ClosuresBen Evans
 
Slides semantic web and Drupal 7 NYCCamp 2012
Slides semantic web and Drupal 7 NYCCamp 2012Slides semantic web and Drupal 7 NYCCamp 2012
Slides semantic web and Drupal 7 NYCCamp 2012scorlosquet
 
Functional Solid, Aleksandr Sugak
Functional Solid, Aleksandr SugakFunctional Solid, Aleksandr Sugak
Functional Solid, Aleksandr SugakSigma Software
 
XSLT+SPARQL: Scripting the Semantic Web with SPARQL embedded into XSLT styles...
XSLT+SPARQL: Scripting the Semantic Web with SPARQL embedded into XSLT styles...XSLT+SPARQL: Scripting the Semantic Web with SPARQL embedded into XSLT styles...
XSLT+SPARQL: Scripting the Semantic Web with SPARQL embedded into XSLT styles...Diego Berrueta
 
Rdf Processing Tools In Java
Rdf Processing Tools In JavaRdf Processing Tools In Java
Rdf Processing Tools In JavaDicusarCorneliu
 
1 Introduction to JAVA.pptx
1 Introduction to JAVA.pptx1 Introduction to JAVA.pptx
1 Introduction to JAVA.pptxKabiles07
 
Apache Jena Elephas and Friends
Apache Jena Elephas and FriendsApache Jena Elephas and Friends
Apache Jena Elephas and FriendsRob Vesse
 
Comparative Study That Aims Rdf Processing For The Java Platform
Comparative Study That Aims Rdf Processing For The Java PlatformComparative Study That Aims Rdf Processing For The Java Platform
Comparative Study That Aims Rdf Processing For The Java PlatformComputer Science
 
Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Espen Brækken
 
Unit 1 Core Java for Compter Science 3rd
Unit 1 Core Java for Compter Science 3rdUnit 1 Core Java for Compter Science 3rd
Unit 1 Core Java for Compter Science 3rdprat0ham
 

Ähnlich wie Got bored by the relational database? Switch to a RDF store! (20)

Reactive Software Systems
Reactive Software SystemsReactive Software Systems
Reactive Software Systems
 
Achieve the norm with Idiorm
Achieve the norm with IdiormAchieve the norm with Idiorm
Achieve the norm with Idiorm
 
Dart the Better JavaScript
Dart the Better JavaScriptDart the Better JavaScript
Dart the Better JavaScript
 
Java SE 8
Java SE 8Java SE 8
Java SE 8
 
Enhancing Domain Specific Language Implementations Through Ontology
Enhancing Domain Specific Language Implementations Through OntologyEnhancing Domain Specific Language Implementations Through Ontology
Enhancing Domain Specific Language Implementations Through Ontology
 
FregeDay: Design and Implementation of the language (Ingo Wechsung)
FregeDay: Design and Implementation of the language (Ingo Wechsung)FregeDay: Design and Implementation of the language (Ingo Wechsung)
FregeDay: Design and Implementation of the language (Ingo Wechsung)
 
Object Relational Mapping with Dapper (Micro ORM)
Object Relational Mapping with Dapper (Micro ORM)Object Relational Mapping with Dapper (Micro ORM)
Object Relational Mapping with Dapper (Micro ORM)
 
Ontology Access Kit_ Workshop Intro Slides.pptx
Ontology Access Kit_ Workshop Intro Slides.pptxOntology Access Kit_ Workshop Intro Slides.pptx
Ontology Access Kit_ Workshop Intro Slides.pptx
 
Java Closures
Java ClosuresJava Closures
Java Closures
 
Slides semantic web and Drupal 7 NYCCamp 2012
Slides semantic web and Drupal 7 NYCCamp 2012Slides semantic web and Drupal 7 NYCCamp 2012
Slides semantic web and Drupal 7 NYCCamp 2012
 
Functional Solid, Aleksandr Sugak
Functional Solid, Aleksandr SugakFunctional Solid, Aleksandr Sugak
Functional Solid, Aleksandr Sugak
 
Functional solid
Functional solidFunctional solid
Functional solid
 
XSLT+SPARQL: Scripting the Semantic Web with SPARQL embedded into XSLT styles...
XSLT+SPARQL: Scripting the Semantic Web with SPARQL embedded into XSLT styles...XSLT+SPARQL: Scripting the Semantic Web with SPARQL embedded into XSLT styles...
XSLT+SPARQL: Scripting the Semantic Web with SPARQL embedded into XSLT styles...
 
Rdf Processing Tools In Java
Rdf Processing Tools In JavaRdf Processing Tools In Java
Rdf Processing Tools In Java
 
1 Introduction to JAVA.pptx
1 Introduction to JAVA.pptx1 Introduction to JAVA.pptx
1 Introduction to JAVA.pptx
 
Apache Jena Elephas and Friends
Apache Jena Elephas and FriendsApache Jena Elephas and Friends
Apache Jena Elephas and Friends
 
Thinking Functionally
Thinking FunctionallyThinking Functionally
Thinking Functionally
 
Comparative Study That Aims Rdf Processing For The Java Platform
Comparative Study That Aims Rdf Processing For The Java PlatformComparative Study That Aims Rdf Processing For The Java Platform
Comparative Study That Aims Rdf Processing For The Java Platform
 
Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex Ruby on Rails (RoR) as a back-end processor for Apex
Ruby on Rails (RoR) as a back-end processor for Apex
 
Unit 1 Core Java for Compter Science 3rd
Unit 1 Core Java for Compter Science 3rdUnit 1 Core Java for Compter Science 3rd
Unit 1 Core Java for Compter Science 3rd
 

Kürzlich hochgeladen

ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard37
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)Samir Dash
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 

Kürzlich hochgeladen (20)

ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 

Got bored by the relational database? Switch to a RDF store!

  • 1. Got bored by the relational database? Switch to a RDF store! Fabrizio Giudici Tidalwave s.a.s.
  • 2. Who I am ● Java consultant since 1996 ● Senior architect ● Java instructor for Sun since 1998 ● Member of the NetBeans Dream Team ● Technical Writer, Blogger at Java.Net, DZone ● http://weblogs.java.net/blog/fabriziogiudici/ ● http://www.tidalwave.it/people
  • 3. Where I am using RDF stores http://bluemarine.tidalwave.it
  • 4. Agenda ● Why the RDBMs? ● RDBMs issues ● The Semantic Model ● OpenSesame and Elmo ● A few code samples ● Conclusion
  • 6. What do we expect from a RDBM? ● Persistence ● Reliability ● Transactions ● Integrability ● Manageability
  • 7. Lack of cohesion ● Do we really need a RDBM for those things? ● No, we don't – Persistence and transactions are good – The specific relational schema is evil ● RDBMs sell those stuff in a single package
  • 8. ER-OO impedance ● Entity-Relationship is different than OO – Primary keys – No inheritance – No behaviour – Normalization rules – Relationship through external keys
  • 9. ORMs ● Tools to minimize the ER-OO impedance ● Java has got a standard API: JPA – Hibernate, TopLink, EclipseLink, OpenJPA – Tries to abstract the database à la Java ● Good, but the RDBM has still to be designed ● And maintained
  • 10. Can we get rid of the relational database?
  • 11. The Semantic Model ● Semantic Technology != Semantic Web ● RDF: Resource Description Framework ● “Triples” are the atomic information item ● Subject / predicate / object – Java / is-a / programming-language – Fabrizio / is-member-of / NetBeans Dream Team – Verona / is-part-of / Veneto – Verona / has-plate / “VR”
  • 12. The Semantic Model ● The subject is a resource ● The predicate is a property ● The object is a value ● A value is a resource or a primitive type ● Resources, properties identified by URL/URN – Just a naming scheme – Not necessarily web-related
  • 13. Formal representation ● RDF is not related to XML ● XML is just one of the way to represent RDF – XML-RDF, unfortunately referred to as RDF ● Notation 3 (N3), another popular representation – Much more human-readable ● Other formats exist ● RDF representation is often referred to as “serialization”
  • 14. (XML-)RDF is near to you ● RSS/RDF ● Dublin Core ● XMP by Adobe
  • 15. Compared to RDBMs ● There's no fixed schema – Everything is a triple – “AAA slogan”: Anyone can say Anything about Any topic ● Adding new data types is adding triples – No need to add / alter tables – Maintainance is just updating data ● Databases can be distributed (federations) – Can be merged by just copying triples together
  • 16. What about performance? ● Not as optimized as SQL ● There's no spread knowledge about tuning as for SQL ● Some missing parts – E.g. Sesame still misses select count(*)
  • 17. OpenSesame, Elmo ● Popular Java infrastructure for RDF – FLOSS – http://www.openrdf.org ● Elmo providers JPA-like operations – Annotations – Specific API or even subset of JPA
  • 18. A simple code example import org.openrdf.elmo.annotations.rdf; @rdf(GeoVocabulary.URI_GEO_LOCATION) public class GeoLocation { @rdf("http://www.w3.org/2003/01/geo/wgs84_pos#lat") private Double latitude; @rdf("http://www.w3.org/2003/01/geo/wgs84_pos#long") private Double longitude; @rdf("http://www.w3.org/2003/01/geo/wgs84_pos#alt") private Double altitude; @rdf("http://www.tidalwave.it/rdf/geo/2009/02/22#code") private String code; } ● Note the use of standard ontologies
  • 19. A simple code example ● Declare persistent classes in META-INF/org.openrdf.elmo.concepts ● Choose a store – Memory – Memory backed by file – Database (transactional) Repository repository = new SailRepository( new MemoryStore(new File("/tmp/RDFStore"))); repository.initialize(); ElmoModule module = new ElmoModule(); SesameManagerFactory factory = new SesameManagerFactory(module, repository); SesameManager em = factory.createElmoManager();
  • 20. Use as JPA EntityManager em.getTransaction().begin(); GeoLocation genova = new GeoLocation(); genova.setLatitude(45.0); genova.setLongitude(9.0); genova.setCode("GE"); em.persist(genova); em.getTransaction().commit();
  • 21. Queries ● There are specific query languages ● SPARQL is one of the most popular ● Similar to SQL, but triples in place of tables PREFIX wgs84: <http://www.w3.org/2003/01/geo/wgs84_pos#> SELECT ?location WHERE { ?location wgs84:lat ?lat }
  • 22. Running a query em.getTransaction().begin(); String queryString = "PREFIX wgs84: <http://www.w3.org/2003/01/geo/wgs84_pos#>n" + "SELECT ?location WHERE n" + " {n" + " ?location a ?type.n" + " ?location wgs84:lat ?latn" + " }"; final ElmoQuery query = em.createQuery(queryString). setType("type", GeoLocation.class). setParameter("lat", 45.0); final List<GeoLocation> result = query.getResultList(); for (GeoLocation l : result) { System.err.println(l); } em.getTransaction().commit();
  • 23. Scratching the surface ● Elmo is powerful ● Supports advanced constructs – Objects with “multiple personality” – Mixins
  • 24. Open issues ● OpenSesame doesn't support all databases ● Lack of experience – Programming skills – Maintainance – Tuning – Managerial culture ● Not widespread ● Performance?
  • 25. Conclusion ● RDBMs are mainstream, but old ● They lead to rigid schemata, don't fit the OO ● It's possible to use something different ● RDF stores can be a viable alternative Fabrizio.Giudici@tidalwave.it