Jena – A Semantic Web Framework for Java

A
Aleksander Pohlacademic teacher at Jagiellonian University
Introduction                                 Semantic Web technologies          Jena




               Jena – A Semantic Web Framework for Java

                                           Aleksander Pohl

                            Katedra Informatyki, Akademia Górniczo-Hutnicza


                                             2. luty 2009




Aleksander Pohl                                                               KI AGH
Jena – A Semantic Web Framework for Java
Introduction                               Semantic Web technologies     Jena




Agenda



       Introduction


       Semantic Web technologies


       Jena




Aleksander Pohl                                                        KI AGH
Jena – A Semantic Web Framework for Java
Introduction                               Semantic Web technologies     Jena




Agenda



       Introduction


       Semantic Web technologies


       Jena




Aleksander Pohl                                                        KI AGH
Jena – A Semantic Web Framework for Java
Introduction                               Semantic Web technologies     Jena




What is the Semantic Web?


       The Semantic Web is an:
               ... extension of current web in which
           ◮

               ... information is given well defined meaning
           ◮

               ... better enabling people and computers to work in
           ◮
               cooperations.
       The Semantic Web, Tim Barners-Lee, James Hendler and Ora
       Lassil




Aleksander Pohl                                                        KI AGH
Jena – A Semantic Web Framework for Java
Introduction                               Semantic Web technologies         Jena




Motivation



               providing information about Web resources and the
           ◮
               systems that use them
               allowing data to be processed outside the particular
           ◮
               environment in which it was created
               combining data from several applications to arrive at new
           ◮
               information




Aleksander Pohl                                                            KI AGH
Jena – A Semantic Web Framework for Java
Introduction                               Semantic Web technologies     Jena




Agenda



       Introduction


       Semantic Web technologies


       Jena




Aleksander Pohl                                                        KI AGH
Jena – A Semantic Web Framework for Java
Introduction                               Semantic Web technologies     Jena




Core Semantic Web technologies



               RDF – Resource Description Framework
           ◮

               RDFS – RDF Schema (vocabulary)
           ◮

               OWL – Web Ontology Language
           ◮

               SPARQL – Query Language for RDF
           ◮




Aleksander Pohl                                                        KI AGH
Jena – A Semantic Web Framework for Java
Introduction                               Semantic Web technologies      Jena




RDF – Resource Description Framework


               based on XML and URIs
           ◮

               directed, labeled graph format for representing
           ◮
               information in the web
               formal semantics allows well founded deductions in RDF
           ◮
               data
               extensible vocabulary
           ◮




Aleksander Pohl                                                         KI AGH
Jena – A Semantic Web Framework for Java
Introduction                               Semantic Web technologies            Jena




RDF – graph data model




               any expression in RDF is a collection of triples
           ◮

               every triple consists of a subject, a predicate and an object
           ◮

               the arc direction is significant – it always points toward the
           ◮
               object
               assertion of an RDF triple says that some relationship,
           ◮
               indicated by the predicate, holds between the things
               denoted by subject and object of the triple
               meaning of an RDF graph is the conjunction (logical AND)
           ◮
               of the statements corresponding to all the triples it contains
Aleksander Pohl                                                             KI AGH
Jena – A Semantic Web Framework for Java
Introduction                               Semantic Web technologies      Jena




RDF – subject, predicate & object


               nodes of an RDF graph are its subjects and objects
           ◮

               a node may be:
           ◮
                      URI with optional fragment identifier, eg.
                  ◮

                      http://www.example.org/staffid/1234#xyz
                      literal, eg. quot;Georgequot;
                  ◮

                      blank
                  ◮


               the subject of a triple might be only URI reference or
           ◮
               a blank node
               the predicate of the triple must be URI reference
           ◮




Aleksander Pohl                                                         KI AGH
Jena – A Semantic Web Framework for Java
Introduction                               Semantic Web technologies     Jena




RDF – example




       <rdf:Description rdf:about=quot;http://www.ivan-herman.netquot;>
        <foaf:name>Ivan</foaf:name>
        <abc:myCalendar rdf:resource=quot;http://.../myCalendarquot;/>
        <foaf:surname>Herman</foaf:surname>
       </rdf:Description>


Aleksander Pohl                                                        KI AGH
Jena – A Semantic Web Framework for Java
Introduction                               Semantic Web technologies                Jena




RDFS – RDF Vocabulary Description Language
               RDF itself provides no means for defining
           ◮
               application-specific classes and properties
               They are described in RDFS – RDF Vocabulary
           ◮
               Description Language (aka RDF Schema)
               RDF Schema provides a type system for RDF, similar to
           ◮
               type systems in programming languages:
                      allows resources to be defined as instances of one or more
                  ◮

                      classes
                      allows classes to be organized in a hierarchical fashion
                  ◮


               URIref prefix
           ◮
               http://www.w3.org/2000/01/rdf-schema#,
               conventionally associated with the QName prefix rdfs:

Aleksander Pohl                                                                   KI AGH
Jena – A Semantic Web Framework for Java
Introduction                               Semantic Web technologies     Jena




RDFS – basic notions (1)
               Classes are described using the RDFS resources:
           ◮
                      rdfs:Class
                  ◮

                      rdfs:Resource
                  ◮

               and the properties:
           ◮
                      rdf:type
                  ◮

                      rdfs:subClassOf
                  ◮

               Example:
           ◮
                      ex:MotorVehicle rdf:type rdfs:Class.
                  ◮

                      Java: class MotorVehicle {· · · }
                      exthings:myCar rdf:type ex:MotorVehicle.
                  ◮

                      Java: myCar = new MotorVehicle();
                      ex:Van rdfs:subClassOf ex:MotorVehicle.
                  ◮

                      Java: class Van extends MotorVehicle {· · · }

Aleksander Pohl                                                        KI AGH
Jena – A Semantic Web Framework for Java
Introduction                               Semantic Web technologies                 Jena




OWL – Web Ontology Language
               Intended to be used when the information needs to be
           ◮
               processed by applications (not merely presented to
               humans)
               Provides additional vocabulary along with a formal
           ◮
               semantics
               Sublanguages:
           ◮
                      Lite – classification hierarchy and simple constraints
                  ◮

                      (extension of restricted RDF)
                      DL (Description Logic) – maximum expressiveness while
                  ◮

                      retaining computational completeness (extension of
                      restricted RDF)
                      Full – maximum expressiveness and the syntactic freedom
                  ◮

                      of RDF with no computational guarantees (real extension of
                      RDF)
Aleksander Pohl                                                                    KI AGH
Jena – A Semantic Web Framework for Java
Introduction                               Semantic Web technologies     Jena




OWL Lite additions

               (In)Equality: equivalentClass,
           ◮
               equivalentProperty, sameAs, differentFrom, ...
               Property characteristics: inverseOf,
           ◮
               TransitiveProperty, SymmetricProperty, ...
               Restricted Cardinality: minCardinality,
           ◮
               maxCardinality, cardinality
               Annotation Properties: rdfs:label, rdfs:comment,
           ◮
               rdfs:seeAlso, rdfs:isDefinedBy,
               AnnotationProperty, OntologyProperty



Aleksander Pohl                                                        KI AGH
Jena – A Semantic Web Framework for Java
Introduction                               Semantic Web technologies     Jena




Semantic Web – ontologies overview




Aleksander Pohl                                                        KI AGH
Jena – A Semantic Web Framework for Java
Introduction                               Semantic Web technologies            Jena




SPARQL – overview


               SPARQL is a query language for RDF
           ◮

               It is similar to SQL in terms of purpose and syntax, but
           ◮
               different in terms of application (relational data vs. graph
               based data)
               Human-friendly syntax
           ◮

               Data integration and aggregation – multiple sources
           ◮
               supported by default
               Allows to make yes/no questions
           ◮




Aleksander Pohl                                                               KI AGH
Jena – A Semantic Web Framework for Java
Introduction                               Semantic Web technologies     Jena




SPARQL Example
               Data:
           ◮
               <http://example.org/book/book1>
               <http://purl.org/dc/elements/1.1/title>
               ”SPARQL Tutorial” .
               Query:
           ◮
               SELECT ?title WHERE {
               <http://example.org/book/book1>
               <http://purl.org/dc/elements/1.1/title>
               ?title . }
               Result:
           ◮

                        title
                  ”SPARQL Tutorial”

Aleksander Pohl                                                        KI AGH
Jena – A Semantic Web Framework for Java
Introduction                               Semantic Web technologies     Jena




Agenda



       Introduction


       Semantic Web technologies


       Jena




Aleksander Pohl                                                        KI AGH
Jena – A Semantic Web Framework for Java
Introduction                               Semantic Web technologies     Jena




Jena2 – overview

               Developed by HP Laboratories
           ◮

               Open-source Java implementation of core Semantic Web
           ◮
               technologies:
                      RDF graph manipulation API
                  ◮

                      RDFS and OWL reasoning API
                  ◮

                      Includes the de facto reference RDF/XML parser
                  ◮

                      RDF/XML, N3 and N-triple Input/Output
                  ◮

                      SPQRQL query engine
                  ◮

                      rule-based inference engine
                  ◮


               In-memory or persistent storage
           ◮




Aleksander Pohl                                                        KI AGH
Jena – A Semantic Web Framework for Java
Introduction                               Semantic Web technologies            Jena




RDF API example
       // some definitions
 1
       static String personURI              = quot;http://somewhere/JohnSmithquot;;
 2
       static String fullName               = quot;John Smithquot;;
 3
 4
       // create an empty Model
 5
       Model model = ModelFactory.createDefaultModel();
 6
 7
       // create the resource
 8
       Resource johnSmith = model.createResource(personURI);
 9
10
       // add the property
11
       johnSmith.addProperty(VCARD.FN, fullName);
12




Aleksander Pohl                                                               KI AGH
Jena – A Semantic Web Framework for Java
Introduction                               Semantic Web technologies     Jena




SPARQL API example
       Model model = ... ;
 1
       String queryString = quot; .... quot; ;
 2
       Query query = QueryFactory.create(queryString) ;
 3
       QueryExecution qexec = QueryExecutionFactory.create(query, model) ;
 4
       try {
 5
         ResultSet results = qexec.execSelect() ;
 6
         for ( ; results.hasNext() ; )
 7
         {
 8
           QuerySolution soln = results.nextSolution() ;
 9
           // Get a result variable by name.
10
           RDFNode x = soln.get(quot;varNamequot;) ;
11
           // Get a result variable - must be a resource
12
           Resource r = soln.getResource(quot;VarRquot;) ;
13
           // Get a result variable - must be a literal
14
           Literal l = soln.getLiteral(quot;VarLquot;) ;
15
         }
16
       } finally { qexec.close() ; }
17




Aleksander Pohl                                                        KI AGH
Jena – A Semantic Web Framework for Java
Introduction                               Semantic Web technologies     Jena




Jena comparison




Aleksander Pohl                                                        KI AGH
Jena – A Semantic Web Framework for Java
Introduction                               Semantic Web technologies            Jena




Bibliography (1)

               Brickley, Dan; Guha, Ramanathan (2004). RDF Vocabulary
           ◮
               Description Language 1.0: RDF Schema,
               http://www.w3.org/TR/rdf-schema/
               Carroll, Jeremy J.; Dickinson, Ian; Dollin, Chris; Reynolds,
           ◮
               Dave; Seaborne, Andy; Wilkinson, Kevin (2003). Jena:
               Implementing the Semantic Web Recommendations, HP
               Laboratories, Bristol, technical report HPL-2003-146.
               Herman, Ivan Questions (and Answers) on the semantic
           ◮
               Web, http://www.w3.org/People/Ivan/-
               CorePresentations/SW_QA



Aleksander Pohl                                                               KI AGH
Jena – A Semantic Web Framework for Java
Introduction                               Semantic Web technologies     Jena




Bibliography (2)


               Klyne, Graham; Carroll, Jeremy J. (2004). Resource
           ◮
               Description Framework (RDF): Concepts and Abstract
               Syntax http://www.w3.org/TR/rdf-concepts/
               McBride, Brian (2002), The Semantic Web, HP
           ◮
               Laboratories, Bristol, Euroweb 2002 invited talk.
               McGuinness, Deborah; van Harmelen, Frank (2004). OWL
           ◮
               Web Ontology Language Overview,
               http://www.w3.org/TR/owl-features/




Aleksander Pohl                                                        KI AGH
Jena – A Semantic Web Framework for Java
1 of 25

Recommended

Jena Programming by
Jena ProgrammingJena Programming
Jena ProgrammingMyungjin Lee
7.9K views34 slides
Programming the Semantic Web by
Programming the Semantic WebProgramming the Semantic Web
Programming the Semantic WebLuigi De Russis
1.5K views22 slides
Jena by
JenaJena
Jenayuhana
2.6K views32 slides
SPARQL-DL - Theory & Practice by
SPARQL-DL - Theory & PracticeSPARQL-DL - Theory & Practice
SPARQL-DL - Theory & PracticeAdriel Café
4K views27 slides
070517 Jena by
070517 Jena070517 Jena
070517 Jenayuhana
2.8K views44 slides
RDF validation tutorial by
RDF validation tutorialRDF validation tutorial
RDF validation tutorialJose Emilio Labra Gayo
2.9K views20 slides

More Related Content

What's hot

RDF Data Model by
RDF Data ModelRDF Data Model
RDF Data ModelJose Emilio Labra Gayo
2.6K views49 slides
SHACL: Shaping the Big Ball of Data Mud by
SHACL: Shaping the Big Ball of Data MudSHACL: Shaping the Big Ball of Data Mud
SHACL: Shaping the Big Ball of Data MudRichard Cyganiak
6.5K views50 slides
Java and SPARQL by
Java and SPARQLJava and SPARQL
Java and SPARQLRaji Ghawi
13.5K views26 slides
SHACL by example by
SHACL by exampleSHACL by example
SHACL by exampleJose Emilio Labra Gayo
13.6K views44 slides
RDF and OWL by
RDF and OWLRDF and OWL
RDF and OWLRachel Lovinger
35.2K views35 slides
Understanding RDF: the Resource Description Framework in Context (1999) by
Understanding RDF: the Resource Description Framework in Context  (1999)Understanding RDF: the Resource Description Framework in Context  (1999)
Understanding RDF: the Resource Description Framework in Context (1999)Dan Brickley
7.3K views19 slides

What's hot(20)

SHACL: Shaping the Big Ball of Data Mud by Richard Cyganiak
SHACL: Shaping the Big Ball of Data MudSHACL: Shaping the Big Ball of Data Mud
SHACL: Shaping the Big Ball of Data Mud
Richard Cyganiak6.5K views
Java and SPARQL by Raji Ghawi
Java and SPARQLJava and SPARQL
Java and SPARQL
Raji Ghawi13.5K views
Understanding RDF: the Resource Description Framework in Context (1999) by Dan Brickley
Understanding RDF: the Resource Description Framework in Context  (1999)Understanding RDF: the Resource Description Framework in Context  (1999)
Understanding RDF: the Resource Description Framework in Context (1999)
Dan Brickley7.3K views
SPARQL introduction and training (130+ slides with exercices) by Thomas Francart
SPARQL introduction and training (130+ slides with exercices)SPARQL introduction and training (130+ slides with exercices)
SPARQL introduction and training (130+ slides with exercices)
Thomas Francart2.1K views
SPARQL Cheat Sheet by LeeFeigenbaum
SPARQL Cheat SheetSPARQL Cheat Sheet
SPARQL Cheat Sheet
LeeFeigenbaum92.4K views
Mapping Hierarchical Sources into RDF using the RML Mapping Language by andimou
Mapping Hierarchical Sources into RDF using the RML Mapping LanguageMapping Hierarchical Sources into RDF using the RML Mapping Language
Mapping Hierarchical Sources into RDF using the RML Mapping Language
andimou2.1K views
온톨로지 추론 개요 by Sang-Kyun Kim
온톨로지 추론 개요온톨로지 추론 개요
온톨로지 추론 개요
Sang-Kyun Kim4.9K views
OWL Full Semantics by Jie Bao
OWL Full SemanticsOWL Full Semantics
OWL Full Semantics
Jie Bao1.7K views
Introduction To RDF and RDFS by Nilesh Wagmare
Introduction To RDF and RDFSIntroduction To RDF and RDFS
Introduction To RDF and RDFS
Nilesh Wagmare1.2K views
SPARQL 사용법 by 홍수 허
SPARQL 사용법SPARQL 사용법
SPARQL 사용법
홍수 허899 views
Java and OWL by Raji Ghawi
Java and OWLJava and OWL
Java and OWL
Raji Ghawi13.1K views
Resource description framework by hozifa1010
Resource description frameworkResource description framework
Resource description framework
hozifa10102.7K views

Viewers also liked

Java Basics by
Java BasicsJava Basics
Java BasicsDhanunjai Bandlamudi
2.2K views37 slides
Intuit commissions manager by
Intuit commissions managerIntuit commissions manager
Intuit commissions managersshhzap
1.5K views6 slides
Chapter 1 introduction to java technology by
Chapter 1 introduction to java technologyChapter 1 introduction to java technology
Chapter 1 introduction to java technologysshhzap
2.2K views41 slides
Introduction to java technology by
Introduction to java technologyIntroduction to java technology
Introduction to java technologyIndika Munaweera Kankanamge
2.2K views11 slides
Java session01 by
Java session01Java session01
Java session01Niit Care
2K views31 slides
02 basic java programming and operators by
02 basic java programming and operators02 basic java programming and operators
02 basic java programming and operatorsDanairat Thanabodithammachari
1.7K views43 slides

Viewers also liked(9)

Intuit commissions manager by sshhzap
Intuit commissions managerIntuit commissions manager
Intuit commissions manager
sshhzap1.5K views
Chapter 1 introduction to java technology by sshhzap
Chapter 1 introduction to java technologyChapter 1 introduction to java technology
Chapter 1 introduction to java technology
sshhzap2.2K views
Java session01 by Niit Care
Java session01Java session01
Java session01
Niit Care2K views
Chapter 1. java programming language overview by Jong Soon Bok
Chapter 1. java programming language overviewChapter 1. java programming language overview
Chapter 1. java programming language overview
Jong Soon Bok9.6K views
Object Oriented Programming with Java by Jussi Pohjolainen
Object Oriented Programming with JavaObject Oriented Programming with Java
Object Oriented Programming with Java
Jussi Pohjolainen12.9K views
Object-Oriented Analysis And Design With Applications Grady Booch by Sorina Chirilă
Object-Oriented Analysis And Design With Applications Grady BoochObject-Oriented Analysis And Design With Applications Grady Booch
Object-Oriented Analysis And Design With Applications Grady Booch
Sorina Chirilă6.4K views

Similar to Jena – A Semantic Web Framework for Java

A hands on overview of the semantic web by
A hands on overview of the semantic webA hands on overview of the semantic web
A hands on overview of the semantic webMarakana Inc.
1.2K views41 slides
WebGUI And The Semantic Web by
WebGUI And The Semantic WebWebGUI And The Semantic Web
WebGUI And The Semantic WebWilliam McKee
698 views30 slides
Semantic web by
Semantic web Semantic web
Semantic web Pallavi Srivastava
3.7K views35 slides
A Hands On Overview Of The Semantic Web by
A Hands On Overview Of The Semantic WebA Hands On Overview Of The Semantic Web
A Hands On Overview Of The Semantic WebShamod Lacoul
6.1K views60 slides
Metadata is back! by
Metadata is back!Metadata is back!
Metadata is back!Bernhard Haslhofer
1.9K views49 slides
Facet: Building Web Pages with SPARQL by
Facet: Building Web Pages with SPARQLFacet: Building Web Pages with SPARQL
Facet: Building Web Pages with SPARQLLeigh Dodds
1.7K views26 slides

Similar to Jena – A Semantic Web Framework for Java(20)

A hands on overview of the semantic web by Marakana Inc.
A hands on overview of the semantic webA hands on overview of the semantic web
A hands on overview of the semantic web
Marakana Inc.1.2K views
WebGUI And The Semantic Web by William McKee
WebGUI And The Semantic WebWebGUI And The Semantic Web
WebGUI And The Semantic Web
William McKee698 views
A Hands On Overview Of The Semantic Web by Shamod Lacoul
A Hands On Overview Of The Semantic WebA Hands On Overview Of The Semantic Web
A Hands On Overview Of The Semantic Web
Shamod Lacoul6.1K views
Facet: Building Web Pages with SPARQL by Leigh Dodds
Facet: Building Web Pages with SPARQLFacet: Building Web Pages with SPARQL
Facet: Building Web Pages with SPARQL
Leigh Dodds1.7K views
8th TUC Meeting - Zhe Wu (Oracle USA). Bridging RDF Graph and Property Graph... by LDBC council
8th TUC Meeting -  Zhe Wu (Oracle USA). Bridging RDF Graph and Property Graph...8th TUC Meeting -  Zhe Wu (Oracle USA). Bridging RDF Graph and Property Graph...
8th TUC Meeting - Zhe Wu (Oracle USA). Bridging RDF Graph and Property Graph...
LDBC council806 views
Introduction to Semantic Web by vernekar
Introduction to Semantic WebIntroduction to Semantic Web
Introduction to Semantic Web
vernekar160 views
Comparative Study That Aims Rdf Processing For The Java Platform by Computer Science
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
Computer Science659 views
An Introduction to RDF and the Web of Data by Olaf Hartig
An Introduction to RDF and the Web of DataAn Introduction to RDF and the Web of Data
An Introduction to RDF and the Web of Data
Olaf Hartig3.2K views
RDF and SPARQL for PHP Developers (at New York Semantic Web Meetup) by Benjamin Nowack
RDF and SPARQL for PHP Developers (at New York Semantic Web Meetup)RDF and SPARQL for PHP Developers (at New York Semantic Web Meetup)
RDF and SPARQL for PHP Developers (at New York Semantic Web Meetup)
Benjamin Nowack5.9K views
Querying Linked Data with SPARQL by Olaf Hartig
Querying Linked Data with SPARQLQuerying Linked Data with SPARQL
Querying Linked Data with SPARQL
Olaf Hartig15.4K views
Meandre Architecture Ws Apr 2009 by Loretta Auvil
Meandre Architecture Ws Apr 2009Meandre Architecture Ws Apr 2009
Meandre Architecture Ws Apr 2009
Loretta Auvil366 views

More from Aleksander Pohl

Sieci neuronowe by
Sieci neuronoweSieci neuronowe
Sieci neuronoweAleksander Pohl
1.7K views40 slides
Systemy ekspertowe 2 by
Systemy ekspertowe 2Systemy ekspertowe 2
Systemy ekspertowe 2Aleksander Pohl
890 views36 slides
Przeszukiwanie przestrzeni rozwiązań by
Przeszukiwanie przestrzeni rozwiązańPrzeszukiwanie przestrzeni rozwiązań
Przeszukiwanie przestrzeni rozwiązańAleksander Pohl
1.1K views49 slides
Metody probabilistyczne by
Metody probabilistyczneMetody probabilistyczne
Metody probabilistyczneAleksander Pohl
733 views33 slides
Systemy ekspertowe 1 by
Systemy ekspertowe 1Systemy ekspertowe 1
Systemy ekspertowe 1Aleksander Pohl
1.1K views42 slides
Reprezentacja wiedzy by
Reprezentacja wiedzyReprezentacja wiedzy
Reprezentacja wiedzyAleksander Pohl
831 views43 slides

More from Aleksander Pohl(11)

Recently uploaded

Recap of our Class by
Recap of our ClassRecap of our Class
Recap of our ClassCorinne Weisgerber
81 views15 slides
CWP_23995_2013_17_11_2023_FINAL_ORDER.pdf by
CWP_23995_2013_17_11_2023_FINAL_ORDER.pdfCWP_23995_2013_17_11_2023_FINAL_ORDER.pdf
CWP_23995_2013_17_11_2023_FINAL_ORDER.pdfSukhwinderSingh895865
536 views6 slides
EIT-Digital_Spohrer_AI_Intro 20231128 v1.pptx by
EIT-Digital_Spohrer_AI_Intro 20231128 v1.pptxEIT-Digital_Spohrer_AI_Intro 20231128 v1.pptx
EIT-Digital_Spohrer_AI_Intro 20231128 v1.pptxISSIP
379 views50 slides
Monthly Information Session for MV Asterix (November) by
Monthly Information Session for MV Asterix (November)Monthly Information Session for MV Asterix (November)
Monthly Information Session for MV Asterix (November)Esquimalt MFRC
58 views26 slides
Drama KS5 Breakdown by
Drama KS5 BreakdownDrama KS5 Breakdown
Drama KS5 BreakdownWestHatch
87 views2 slides
AI Tools for Business and Startups by
AI Tools for Business and StartupsAI Tools for Business and Startups
AI Tools for Business and StartupsSvetlin Nakov
111 views39 slides

Recently uploaded(20)

EIT-Digital_Spohrer_AI_Intro 20231128 v1.pptx by ISSIP
EIT-Digital_Spohrer_AI_Intro 20231128 v1.pptxEIT-Digital_Spohrer_AI_Intro 20231128 v1.pptx
EIT-Digital_Spohrer_AI_Intro 20231128 v1.pptx
ISSIP379 views
Monthly Information Session for MV Asterix (November) by Esquimalt MFRC
Monthly Information Session for MV Asterix (November)Monthly Information Session for MV Asterix (November)
Monthly Information Session for MV Asterix (November)
Esquimalt MFRC58 views
Drama KS5 Breakdown by WestHatch
Drama KS5 BreakdownDrama KS5 Breakdown
Drama KS5 Breakdown
WestHatch87 views
AI Tools for Business and Startups by Svetlin Nakov
AI Tools for Business and StartupsAI Tools for Business and Startups
AI Tools for Business and Startups
Svetlin Nakov111 views
REPRESENTATION - GAUNTLET.pptx by iammrhaywood
REPRESENTATION - GAUNTLET.pptxREPRESENTATION - GAUNTLET.pptx
REPRESENTATION - GAUNTLET.pptx
iammrhaywood107 views
Structure and Functions of Cell.pdf by Nithya Murugan
Structure and Functions of Cell.pdfStructure and Functions of Cell.pdf
Structure and Functions of Cell.pdf
Nithya Murugan701 views
Education and Diversity.pptx by DrHafizKosar
Education and Diversity.pptxEducation and Diversity.pptx
Education and Diversity.pptx
DrHafizKosar177 views
Create a Structure in VBNet.pptx by Breach_P
Create a Structure in VBNet.pptxCreate a Structure in VBNet.pptx
Create a Structure in VBNet.pptx
Breach_P75 views
Psychology KS4 by WestHatch
Psychology KS4Psychology KS4
Psychology KS4
WestHatch90 views
Sociology KS5 by WestHatch
Sociology KS5Sociology KS5
Sociology KS5
WestHatch76 views

Jena – A Semantic Web Framework for Java

  • 1. Introduction Semantic Web technologies Jena Jena – A Semantic Web Framework for Java Aleksander Pohl Katedra Informatyki, Akademia Górniczo-Hutnicza 2. luty 2009 Aleksander Pohl KI AGH Jena – A Semantic Web Framework for Java
  • 2. Introduction Semantic Web technologies Jena Agenda Introduction Semantic Web technologies Jena Aleksander Pohl KI AGH Jena – A Semantic Web Framework for Java
  • 3. Introduction Semantic Web technologies Jena Agenda Introduction Semantic Web technologies Jena Aleksander Pohl KI AGH Jena – A Semantic Web Framework for Java
  • 4. Introduction Semantic Web technologies Jena What is the Semantic Web? The Semantic Web is an: ... extension of current web in which ◮ ... information is given well defined meaning ◮ ... better enabling people and computers to work in ◮ cooperations. The Semantic Web, Tim Barners-Lee, James Hendler and Ora Lassil Aleksander Pohl KI AGH Jena – A Semantic Web Framework for Java
  • 5. Introduction Semantic Web technologies Jena Motivation providing information about Web resources and the ◮ systems that use them allowing data to be processed outside the particular ◮ environment in which it was created combining data from several applications to arrive at new ◮ information Aleksander Pohl KI AGH Jena – A Semantic Web Framework for Java
  • 6. Introduction Semantic Web technologies Jena Agenda Introduction Semantic Web technologies Jena Aleksander Pohl KI AGH Jena – A Semantic Web Framework for Java
  • 7. Introduction Semantic Web technologies Jena Core Semantic Web technologies RDF – Resource Description Framework ◮ RDFS – RDF Schema (vocabulary) ◮ OWL – Web Ontology Language ◮ SPARQL – Query Language for RDF ◮ Aleksander Pohl KI AGH Jena – A Semantic Web Framework for Java
  • 8. Introduction Semantic Web technologies Jena RDF – Resource Description Framework based on XML and URIs ◮ directed, labeled graph format for representing ◮ information in the web formal semantics allows well founded deductions in RDF ◮ data extensible vocabulary ◮ Aleksander Pohl KI AGH Jena – A Semantic Web Framework for Java
  • 9. Introduction Semantic Web technologies Jena RDF – graph data model any expression in RDF is a collection of triples ◮ every triple consists of a subject, a predicate and an object ◮ the arc direction is significant – it always points toward the ◮ object assertion of an RDF triple says that some relationship, ◮ indicated by the predicate, holds between the things denoted by subject and object of the triple meaning of an RDF graph is the conjunction (logical AND) ◮ of the statements corresponding to all the triples it contains Aleksander Pohl KI AGH Jena – A Semantic Web Framework for Java
  • 10. Introduction Semantic Web technologies Jena RDF – subject, predicate & object nodes of an RDF graph are its subjects and objects ◮ a node may be: ◮ URI with optional fragment identifier, eg. ◮ http://www.example.org/staffid/1234#xyz literal, eg. quot;Georgequot; ◮ blank ◮ the subject of a triple might be only URI reference or ◮ a blank node the predicate of the triple must be URI reference ◮ Aleksander Pohl KI AGH Jena – A Semantic Web Framework for Java
  • 11. Introduction Semantic Web technologies Jena RDF – example <rdf:Description rdf:about=quot;http://www.ivan-herman.netquot;> <foaf:name>Ivan</foaf:name> <abc:myCalendar rdf:resource=quot;http://.../myCalendarquot;/> <foaf:surname>Herman</foaf:surname> </rdf:Description> Aleksander Pohl KI AGH Jena – A Semantic Web Framework for Java
  • 12. Introduction Semantic Web technologies Jena RDFS – RDF Vocabulary Description Language RDF itself provides no means for defining ◮ application-specific classes and properties They are described in RDFS – RDF Vocabulary ◮ Description Language (aka RDF Schema) RDF Schema provides a type system for RDF, similar to ◮ type systems in programming languages: allows resources to be defined as instances of one or more ◮ classes allows classes to be organized in a hierarchical fashion ◮ URIref prefix ◮ http://www.w3.org/2000/01/rdf-schema#, conventionally associated with the QName prefix rdfs: Aleksander Pohl KI AGH Jena – A Semantic Web Framework for Java
  • 13. Introduction Semantic Web technologies Jena RDFS – basic notions (1) Classes are described using the RDFS resources: ◮ rdfs:Class ◮ rdfs:Resource ◮ and the properties: ◮ rdf:type ◮ rdfs:subClassOf ◮ Example: ◮ ex:MotorVehicle rdf:type rdfs:Class. ◮ Java: class MotorVehicle {· · · } exthings:myCar rdf:type ex:MotorVehicle. ◮ Java: myCar = new MotorVehicle(); ex:Van rdfs:subClassOf ex:MotorVehicle. ◮ Java: class Van extends MotorVehicle {· · · } Aleksander Pohl KI AGH Jena – A Semantic Web Framework for Java
  • 14. Introduction Semantic Web technologies Jena OWL – Web Ontology Language Intended to be used when the information needs to be ◮ processed by applications (not merely presented to humans) Provides additional vocabulary along with a formal ◮ semantics Sublanguages: ◮ Lite – classification hierarchy and simple constraints ◮ (extension of restricted RDF) DL (Description Logic) – maximum expressiveness while ◮ retaining computational completeness (extension of restricted RDF) Full – maximum expressiveness and the syntactic freedom ◮ of RDF with no computational guarantees (real extension of RDF) Aleksander Pohl KI AGH Jena – A Semantic Web Framework for Java
  • 15. Introduction Semantic Web technologies Jena OWL Lite additions (In)Equality: equivalentClass, ◮ equivalentProperty, sameAs, differentFrom, ... Property characteristics: inverseOf, ◮ TransitiveProperty, SymmetricProperty, ... Restricted Cardinality: minCardinality, ◮ maxCardinality, cardinality Annotation Properties: rdfs:label, rdfs:comment, ◮ rdfs:seeAlso, rdfs:isDefinedBy, AnnotationProperty, OntologyProperty Aleksander Pohl KI AGH Jena – A Semantic Web Framework for Java
  • 16. Introduction Semantic Web technologies Jena Semantic Web – ontologies overview Aleksander Pohl KI AGH Jena – A Semantic Web Framework for Java
  • 17. Introduction Semantic Web technologies Jena SPARQL – overview SPARQL is a query language for RDF ◮ It is similar to SQL in terms of purpose and syntax, but ◮ different in terms of application (relational data vs. graph based data) Human-friendly syntax ◮ Data integration and aggregation – multiple sources ◮ supported by default Allows to make yes/no questions ◮ Aleksander Pohl KI AGH Jena – A Semantic Web Framework for Java
  • 18. Introduction Semantic Web technologies Jena SPARQL Example Data: ◮ <http://example.org/book/book1> <http://purl.org/dc/elements/1.1/title> ”SPARQL Tutorial” . Query: ◮ SELECT ?title WHERE { <http://example.org/book/book1> <http://purl.org/dc/elements/1.1/title> ?title . } Result: ◮ title ”SPARQL Tutorial” Aleksander Pohl KI AGH Jena – A Semantic Web Framework for Java
  • 19. Introduction Semantic Web technologies Jena Agenda Introduction Semantic Web technologies Jena Aleksander Pohl KI AGH Jena – A Semantic Web Framework for Java
  • 20. Introduction Semantic Web technologies Jena Jena2 – overview Developed by HP Laboratories ◮ Open-source Java implementation of core Semantic Web ◮ technologies: RDF graph manipulation API ◮ RDFS and OWL reasoning API ◮ Includes the de facto reference RDF/XML parser ◮ RDF/XML, N3 and N-triple Input/Output ◮ SPQRQL query engine ◮ rule-based inference engine ◮ In-memory or persistent storage ◮ Aleksander Pohl KI AGH Jena – A Semantic Web Framework for Java
  • 21. Introduction Semantic Web technologies Jena RDF API example // some definitions 1 static String personURI = quot;http://somewhere/JohnSmithquot;; 2 static String fullName = quot;John Smithquot;; 3 4 // create an empty Model 5 Model model = ModelFactory.createDefaultModel(); 6 7 // create the resource 8 Resource johnSmith = model.createResource(personURI); 9 10 // add the property 11 johnSmith.addProperty(VCARD.FN, fullName); 12 Aleksander Pohl KI AGH Jena – A Semantic Web Framework for Java
  • 22. Introduction Semantic Web technologies Jena SPARQL API example Model model = ... ; 1 String queryString = quot; .... quot; ; 2 Query query = QueryFactory.create(queryString) ; 3 QueryExecution qexec = QueryExecutionFactory.create(query, model) ; 4 try { 5 ResultSet results = qexec.execSelect() ; 6 for ( ; results.hasNext() ; ) 7 { 8 QuerySolution soln = results.nextSolution() ; 9 // Get a result variable by name. 10 RDFNode x = soln.get(quot;varNamequot;) ; 11 // Get a result variable - must be a resource 12 Resource r = soln.getResource(quot;VarRquot;) ; 13 // Get a result variable - must be a literal 14 Literal l = soln.getLiteral(quot;VarLquot;) ; 15 } 16 } finally { qexec.close() ; } 17 Aleksander Pohl KI AGH Jena – A Semantic Web Framework for Java
  • 23. Introduction Semantic Web technologies Jena Jena comparison Aleksander Pohl KI AGH Jena – A Semantic Web Framework for Java
  • 24. Introduction Semantic Web technologies Jena Bibliography (1) Brickley, Dan; Guha, Ramanathan (2004). RDF Vocabulary ◮ Description Language 1.0: RDF Schema, http://www.w3.org/TR/rdf-schema/ Carroll, Jeremy J.; Dickinson, Ian; Dollin, Chris; Reynolds, ◮ Dave; Seaborne, Andy; Wilkinson, Kevin (2003). Jena: Implementing the Semantic Web Recommendations, HP Laboratories, Bristol, technical report HPL-2003-146. Herman, Ivan Questions (and Answers) on the semantic ◮ Web, http://www.w3.org/People/Ivan/- CorePresentations/SW_QA Aleksander Pohl KI AGH Jena – A Semantic Web Framework for Java
  • 25. Introduction Semantic Web technologies Jena Bibliography (2) Klyne, Graham; Carroll, Jeremy J. (2004). Resource ◮ Description Framework (RDF): Concepts and Abstract Syntax http://www.w3.org/TR/rdf-concepts/ McBride, Brian (2002), The Semantic Web, HP ◮ Laboratories, Bristol, Euroweb 2002 invited talk. McGuinness, Deborah; van Harmelen, Frank (2004). OWL ◮ Web Ontology Language Overview, http://www.w3.org/TR/owl-features/ Aleksander Pohl KI AGH Jena – A Semantic Web Framework for Java