SlideShare une entreprise Scribd logo
1  sur  25
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

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
 

Tendances (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?
 

En vedette

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
 

En vedette (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
 

Similaire à 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
 

Similaire à 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
 

Dernier

"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 

Dernier (20)

"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 

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