School of Computer Science - PowerPoint PPT Presentation

1 / 16
About This Presentation
Title:

School of Computer Science

Description:

SWOOP. Ontology editor similar to Prot g in terms of being used to edit ontologies. Extract SWOOP-2.3beta3.zip. Execute runme.bat. Browse to and open fruit.owl ... – PowerPoint PPT presentation

Number of Views:130
Avg rating:3.0/5.0
Slides: 17
Provided by: deshenm
Category:

less

Transcript and Presenter's Notes

Title: School of Computer Science


1
MOWS08 TUTORIAL Jena A Semantic Web Framework
for Java 2 July 2008
  • Deshen Moodley
  • School of Computer Science
  • University of KwaZulu-Natal

2
Software setup
  • SWOOP 2.3 beta
  • JDK 1.5 Eclipse 3.2.1
  • Open workspace
  • Jena_tutorial_workspace_MOWS_2JUL08.zip
  • Compile and execute
  • src-example/mows.examples/CreateKBTest.java

3
SWOOP
  • Ontology editor similar to Protégé in terms of
    being used to edit ontologies
  • Extract SWOOP-2.3beta3.zip
  • Execute runme.bat
  • Browse to and open fruit.owl
  • TASK Create your own simple test ontology at
    least 3 classes, subclasses, 2 properties, 2
    instances, e.g. cars, animals etc

4
Overview of Jena
  • Jena is a Java framework for building Semantic
    Web applications. It provides a programmatic
    environment for RDF, RDFS and OWL, SPARQL and
    includes a rule-based inference engine.
  • Jena is open source and was intiated by Hewlitt
    Packard (HP) Labs Semantic Web Programme.
  • The Jena Framework includes
  • A RDF API
  • Reading and writing RDF in RDF/XML, N3 and
    N-Triples
  • An OWL API
  • In-memory and persistent storage
  • SPARQL query engine
  • Support is provided by the jena-dev mailing list.

5
JENA
  • Semantic Web development environments
  • Jena framework
  • Protégé OWL- API
  • WonderWeb OWL API
  • Recent survey of SW users (Cardosa 2007)
  • 68.2 use Protégé as their ontology editor
  • 75.9 use OWL as the ontology language
  • 53.6 use Jena as their reasoning engine

Jorge Cardoso, The Semantic Web Vision Where
are We? IEEE Intelligent Systems,
September/October 2007, pp.22-26, 2007
6
Creating and reading an ontology model
  • Create an OntModel
  • Sample code CreateKBTest
  • Model specification using the OntModelSpec class
  • Load an OWL ontology into the model directly from
    a local file or from a URI or a locally cached
    ontology ReadKBTest, ReadKBTestWithCache
  • TASK Modify the code to read in your own
    ontology

7
Manipulating classes
  • Listing the existing classes in the model
  • Creating a new class
  • Retrieving a specific class and listing its
    subclasses
  • Adding a class and a subclass
  • TASK List all classes in your ontology, add
    another class to your ontology and make it a
    sub/superclass of an existing class

8
Writing a model
  • An OntModel can be written to a local file
  • WriteKBTest
  • TASK Write the changed model to a another local
    file

9
Manipulating properties
  • Datatype properties
  • RDF Literals, XML Schema data types
  • Object Properties
  • relations between classes, link individuals to
    individuals
  • Listing, retrieving and creating properties
    PropertiesKBTest

10
Manipulating instances
  • List all instances in the model
  • Listing instances of a class
  • Listing properties and property values of an
    instance
  • Adding a new instance and populating it with
    appropriate property values
  • TASK List instances of a particular class in
    your ontology, add a new instance to this class
    with appropriate property values, and check that
    the instance has been created.

11
Querying
  • Querying using RDF triples
  • Jena represents a triple as a statement of the
    form
  • subject, predicate, object
  • A model consists of a collection of statements
  • QueryKBTest
  • TASK. Perform a triple query on your ontology

12
SPARQL query
  • http//www.ibm.com/developerworks/xml/library/j-sp
    arql/
  • http//jena.sourceforge.net/ARQ/Tutorial/
  • SparqlQueryTest
  • TASK Perform the same query using SPARQL

13
Inferencing
  • Inference engines are also called reasoners
  • Jena reasoner rule based reasoner, rule sets
    for RDFS OWL
  • Other reasoners are Pellet, FaCT
  • file///C/Research/docs/tutorial/workspace/Jena-2
    .5.1/doc/inference/index.html

14
Inferencing
  • InferenceKBTest
  • Checking ontology data for consistency
  • ValidityKBTest
  • TASK Create an inference model on your ontology

15
Advanced features
  • Persistence
  • Storing ontology data in databases
  • Connections to other reasoners such as Pellet
  • Generic Rule based reasoner
  • Custom inference rules
  • Built-ins

16
References
  • Cardosa J., Programming the Semantic Web, in
    Cardosa J. Sheth A. P. (eds), Semantic Web
    Services, Processes and Applications, Springer,
    pp.351-380, 2006.
  • Cardoso J. , The Semantic Web Vision Where are
    We? IEEE Intelligent Systems, September/October
    2007, pp.22-26, 2007
Write a Comment
User Comments (0)
About PowerShow.com