Jing deng CSCI 7818 Web Technologies Computer Science Department University of Colorado at Boulder Wednesday, October 31, 2001
Outline
Introduction RDF and Jena Install and Run Jena Jena package and Interface Jena API examples References
RDF
Resource Description Framework
represents information on Web with machineunderstandable syntax and semantics
RDF (Cont.)
Tutorial DC:creator
DC:dat e
DC:title Introduction
Jena
A Java API for RDF Developed by Brian McBride of HP Derived from SiRPAC API Can parse, create, and search RDF models Easy to use
Get package from http://www.hpl.hp.co.uk/people/bwm/rdf/jena/downlo Unzip it Setup environments (CLASSPATH) Test tutorial programs
http://www.bmcb.btinternet.co.uk/2001/rdf/jenatutorial/
Online documentation
http://www.hpl.hp.co.uk/people/bwm/rdf/jena/javadoc/index
Jena package
jena.model
Key package for application developer. It contains interfaces for model, resource,
jena.mem
Contains an implementation of Jena API which stores all model state in main memory
Jena.common
Contains implementation classes
Jena interfaces
Model: a set of statements Statement: a triple of {R, P, O} Resource: subject, URI Property: item of resource Object: may be a resource or a literal Literal: non-nested object Container: special resource, collection of things
resource Model
DC:title
property
Introduction Literal
Brain
@hotmail
Containers
Represents collections of things
BAG : unordered collection ALT: unordered collection except first element SEQ: ordered collection
Ex. 6 Containers
Bag bag = model.createBag(); bag.add("Romeo and Juliet") .add("Hamlet") .add("Othello"); NodeIterator iter = bag.iterator(); while (iter.hasNext()) { System.out.println(" " + iter.next().toString()); } model.write(new PrintWriter(System.out));
References
Jena Web Site
http://www.hpl.hp.co.uk/people/bwm/index.html
Jena tutorial
http://bmcb.btinternet.co.uk/2001/rdf/jenatutorial/ http://www.xml.com/pub/a/2001/05/23/jena.html
Thanks!