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

Contenu connexe

Tendances

Triplestore and SPARQL
Triplestore and SPARQLTriplestore and SPARQL
Triplestore and SPARQL
Lino Valdivia
 
Introduction to RDF & SPARQL
Introduction to RDF & SPARQLIntroduction to RDF & SPARQL
Introduction to RDF & SPARQL
Open Data Support
 
Jdbc (database in java)
Jdbc (database in java)Jdbc (database in java)
Jdbc (database in java)
Maher Abdo
 

Tendances (20)

Triplestore and SPARQL
Triplestore and SPARQLTriplestore and SPARQL
Triplestore and SPARQL
 
Node Architecture and Getting Started with Express
Node Architecture and Getting Started with ExpressNode Architecture and Getting Started with Express
Node Architecture and Getting Started with Express
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
 
Introduction to RDF & SPARQL
Introduction to RDF & SPARQLIntroduction to RDF & SPARQL
Introduction to RDF & SPARQL
 
RDF data model
RDF data modelRDF data model
RDF data model
 
Semantic Web - Ontologies
Semantic Web - OntologiesSemantic Web - Ontologies
Semantic Web - Ontologies
 
Spring Framework Tutorial | Spring Tutorial For Beginners With Examples | Jav...
Spring Framework Tutorial | Spring Tutorial For Beginners With Examples | Jav...Spring Framework Tutorial | Spring Tutorial For Beginners With Examples | Jav...
Spring Framework Tutorial | Spring Tutorial For Beginners With Examples | Jav...
 
Django Girls Tutorial
Django Girls TutorialDjango Girls Tutorial
Django Girls Tutorial
 
RDF Data Model
RDF Data ModelRDF Data Model
RDF Data Model
 
An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST An Overview of Web Services: SOAP and REST
An Overview of Web Services: SOAP and REST
 
SPARQL introduction and training (130+ slides with exercices)
SPARQL introduction and training (130+ slides with exercices)SPARQL introduction and training (130+ slides with exercices)
SPARQL introduction and training (130+ slides with exercices)
 
Linked Data and Knowledge Graphs -- Constructing and Understanding Knowledge ...
Linked Data and Knowledge Graphs -- Constructing and Understanding Knowledge ...Linked Data and Knowledge Graphs -- Constructing and Understanding Knowledge ...
Linked Data and Knowledge Graphs -- Constructing and Understanding Knowledge ...
 
Jdbc (database in java)
Jdbc (database in java)Jdbc (database in java)
Jdbc (database in java)
 
RDF, linked data and semantic web
RDF, linked data and semantic webRDF, linked data and semantic web
RDF, linked data and semantic web
 
Spring Framework - AOP
Spring Framework - AOPSpring Framework - AOP
Spring Framework - AOP
 
Advance Java Tutorial | J2EE, Java Servlets, JSP, JDBC | Java Certification T...
Advance Java Tutorial | J2EE, Java Servlets, JSP, JDBC | Java Certification T...Advance Java Tutorial | J2EE, Java Servlets, JSP, JDBC | Java Certification T...
Advance Java Tutorial | J2EE, Java Servlets, JSP, JDBC | Java Certification T...
 
Spring - Part 1 - IoC, Di and Beans
Spring - Part 1 - IoC, Di and Beans Spring - Part 1 - IoC, Di and Beans
Spring - Part 1 - IoC, Di and Beans
 
SPARQL 사용법
SPARQL 사용법SPARQL 사용법
SPARQL 사용법
 
ESWC 2017 Tutorial Knowledge Graphs
ESWC 2017 Tutorial Knowledge GraphsESWC 2017 Tutorial Knowledge Graphs
ESWC 2017 Tutorial Knowledge Graphs
 
Spring boot
Spring bootSpring boot
Spring boot
 

En vedette (9)

Java Basics
Java BasicsJava Basics
Java Basics
 
Intuit commissions manager
Intuit commissions managerIntuit commissions manager
Intuit commissions manager
 
Chapter 1 introduction to java technology
Chapter 1 introduction to java technologyChapter 1 introduction to java technology
Chapter 1 introduction to java technology
 
Introduction to java technology
Introduction to java technologyIntroduction to java technology
Introduction to java technology
 
Java session01
Java session01Java session01
Java session01
 
02 basic java programming and operators
02 basic java programming and operators02 basic java programming and operators
02 basic java programming and operators
 
Chapter 1. java programming language overview
Chapter 1. java programming language overviewChapter 1. java programming language overview
Chapter 1. java programming language overview
 
Object Oriented Programming with Java
Object Oriented Programming with JavaObject Oriented Programming with Java
Object Oriented Programming with Java
 
Object-Oriented Analysis And Design With Applications Grady Booch
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
 

Similaire à Jena – A Semantic Web Framework for Java

A hands on overview of the semantic web
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.
 
2015.03 - The RDF Validator - A Tool to Validate RDF Data (KIM)
2015.03 - The RDF Validator - A Tool to Validate RDF Data (KIM)2015.03 - The RDF Validator - A Tool to Validate RDF Data (KIM)
2015.03 - The RDF Validator - A Tool to Validate RDF Data (KIM)
Dr.-Ing. Thomas Hartmann
 
Introduction to Semantic Web
Introduction to Semantic WebIntroduction to Semantic Web
Introduction to Semantic Web
vernekar
 
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
Computer Science
 
Web standards, why care?
Web standards, why care?Web standards, why care?
Web standards, why care?
Thomas Roessler
 

Similaire à Jena – A Semantic Web Framework for Java (20)

A hands on overview of the semantic web
A hands on overview of the semantic webA hands on overview of the semantic web
A hands on overview of the semantic web
 
WebGUI And The Semantic Web
WebGUI And The Semantic WebWebGUI And The Semantic Web
WebGUI And The Semantic Web
 
Semantic web
Semantic web Semantic web
Semantic web
 
A Hands On Overview Of The Semantic Web
A Hands On Overview Of The Semantic WebA Hands On Overview Of The Semantic Web
A Hands On Overview Of The Semantic Web
 
Metadata is back!
Metadata is back!Metadata is back!
Metadata is back!
 
Facet: Building Web Pages with SPARQL
Facet: Building Web Pages with SPARQLFacet: Building Web Pages with SPARQL
Facet: Building Web Pages with SPARQL
 
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...
8th TUC Meeting - Zhe Wu (Oracle USA). Bridging RDF Graph and Property Graph...
 
2015.03 - The RDF Validator - A Tool to Validate RDF Data (KIM)
2015.03 - The RDF Validator - A Tool to Validate RDF Data (KIM)2015.03 - The RDF Validator - A Tool to Validate RDF Data (KIM)
2015.03 - The RDF Validator - A Tool to Validate RDF Data (KIM)
 
Introduction to Semantic Web
Introduction to Semantic WebIntroduction to Semantic Web
Introduction to Semantic Web
 
Markup As An Api
Markup As An ApiMarkup As An Api
Markup As An Api
 
SHACL: Shaping the Big Ball of Data Mud
SHACL: Shaping the Big Ball of Data MudSHACL: Shaping the Big Ball of Data Mud
SHACL: Shaping the Big Ball of Data Mud
 
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
 
Web standards, why care?
Web standards, why care?Web standards, why care?
Web standards, why care?
 
OpenCms Days 2012 - Keynote: Semantic Technologies for CMS
OpenCms Days 2012 - Keynote: Semantic Technologies for CMSOpenCms Days 2012 - Keynote: Semantic Technologies for CMS
OpenCms Days 2012 - Keynote: Semantic Technologies for CMS
 
An Introduction to RDF and the Web of Data
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
 
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)
RDF and SPARQL for PHP Developers (at New York Semantic Web Meetup)
 
Querying Linked Data with SPARQL
Querying Linked Data with SPARQLQuerying Linked Data with SPARQL
Querying Linked Data with SPARQL
 
Linked services
Linked servicesLinked services
Linked services
 
Text mining and Visualizations
Text mining  and VisualizationsText mining  and Visualizations
Text mining and Visualizations
 
Meandre Architecture
Meandre ArchitectureMeandre Architecture
Meandre Architecture
 

Plus de Aleksander Pohl

Przeszukiwanie przestrzeni rozwiązań
Przeszukiwanie przestrzeni rozwiązańPrzeszukiwanie przestrzeni rozwiązań
Przeszukiwanie przestrzeni rozwiązań
Aleksander Pohl
 
Sztuczna Inteligencja - Prolog 3
Sztuczna Inteligencja - Prolog 3Sztuczna Inteligencja - Prolog 3
Sztuczna Inteligencja - Prolog 3
Aleksander Pohl
 
Rachunek predykatów pierwszego rzędu
Rachunek predykatów pierwszego rzęduRachunek predykatów pierwszego rzędu
Rachunek predykatów pierwszego rzędu
Aleksander Pohl
 
Sztuczna Inteligencja - Prolog 1
Sztuczna Inteligencja - Prolog 1Sztuczna Inteligencja - Prolog 1
Sztuczna Inteligencja - Prolog 1
Aleksander Pohl
 
Sztuczna Intelignecja - Prolog 2
Sztuczna Intelignecja - Prolog 2Sztuczna Intelignecja - Prolog 2
Sztuczna Intelignecja - Prolog 2
Aleksander Pohl
 
Sztuczna Inteligencja i Systemy Ekspertowe - wprowadzenie
Sztuczna Inteligencja i Systemy Ekspertowe - wprowadzenieSztuczna Inteligencja i Systemy Ekspertowe - wprowadzenie
Sztuczna Inteligencja i Systemy Ekspertowe - wprowadzenie
Aleksander Pohl
 

Plus de Aleksander Pohl (11)

Sieci neuronowe
Sieci neuronoweSieci neuronowe
Sieci neuronowe
 
Systemy ekspertowe 2
Systemy ekspertowe 2Systemy ekspertowe 2
Systemy ekspertowe 2
 
Przeszukiwanie przestrzeni rozwiązań
Przeszukiwanie przestrzeni rozwiązańPrzeszukiwanie przestrzeni rozwiązań
Przeszukiwanie przestrzeni rozwiązań
 
Metody probabilistyczne
Metody probabilistyczneMetody probabilistyczne
Metody probabilistyczne
 
Systemy ekspertowe 1
Systemy ekspertowe 1Systemy ekspertowe 1
Systemy ekspertowe 1
 
Reprezentacja wiedzy
Reprezentacja wiedzyReprezentacja wiedzy
Reprezentacja wiedzy
 
Sztuczna Inteligencja - Prolog 3
Sztuczna Inteligencja - Prolog 3Sztuczna Inteligencja - Prolog 3
Sztuczna Inteligencja - Prolog 3
 
Rachunek predykatów pierwszego rzędu
Rachunek predykatów pierwszego rzęduRachunek predykatów pierwszego rzędu
Rachunek predykatów pierwszego rzędu
 
Sztuczna Inteligencja - Prolog 1
Sztuczna Inteligencja - Prolog 1Sztuczna Inteligencja - Prolog 1
Sztuczna Inteligencja - Prolog 1
 
Sztuczna Intelignecja - Prolog 2
Sztuczna Intelignecja - Prolog 2Sztuczna Intelignecja - Prolog 2
Sztuczna Intelignecja - Prolog 2
 
Sztuczna Inteligencja i Systemy Ekspertowe - wprowadzenie
Sztuczna Inteligencja i Systemy Ekspertowe - wprowadzenieSztuczna Inteligencja i Systemy Ekspertowe - wprowadzenie
Sztuczna Inteligencja i Systemy Ekspertowe - wprowadzenie
 

Dernier

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
ssuserdda66b
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Dernier (20)

Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 

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