Practical RDF and over one million other books are available for Amazon Kindle . Learn more


or
Sign in to turn on 1-Click ordering.
or
Amazon Prime free trial required. Sign up when you check out. Learn more
More Buying Choices
Have one to sell? Sell yours here
or
Get a £0.25 Amazon.co.uk Gift Card
Practical RDF
 
 
Start reading Practical RDF on your Kindle in under a minute.

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

Practical RDF [Paperback]

Shelley Powers
2.5 out of 5 stars  See all reviews (2 customer reviews)
RRP: £30.99
Price: £20.51 & this item Delivered FREE in the UK with Super Saver Delivery. See details and conditions
You Save: £10.48 (34%)
o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o
In stock.
Dispatched from and sold by Amazon.co.uk. Gift-wrap available.
Only 2 left in stock--order soon (more on the way).
Want guaranteed delivery by Wednesday, May 30? Choose Express delivery at checkout. See Details
‹  Return to Product Overview

Product Description

Product Description

The Resource Description Framework (RDF) is a structure for describing and interchanging metadata on the Web--anything from library catalogs and worldwide directories to bioinformatics, Mozilla internal data structures, and knowledge bases for artificial intelligence projects. RDF provides a consistent framework and syntax for describing and querying data, making it possible to share website descriptions more easily. RDF's capabilities, however, have long been shrouded by its reputation for complexity and a difficult family of specifications. Practical RDF breaks through this reputation with immediate and solvable problems to help you understand, master, and implement RDF solutions.

Practical RDF explains RDF from the ground up, providing real-world examples and descriptions of how the technology is being used in applications like Mozilla, FOAF, and Chandler, as well as infrastructure you can use to build your own applications. This book cuts to the heart of the W3C's often obscure specifications, giving you tools to apply RDF successfully in your own projects.

The first part of the book focuses on the RDF specifications. After an introduction to RDF, the book covers the RDF specification documents themselves, including RDF Semantics and Concepts and Abstract Model specifications, RDF constructs, and the RDF Schema. The second section focuses on programming language support, and the tools and utilities that allow developers to review, edit, parse, store, and manipulate RDF/XML. Subsequent sections focus on RDF's data roots, programming and framework support, and practical implementation and use of RDF and RDF/XML.

If you want to know how to apply RDF to information processing, Practical RDF is for you. Whether your interests lie in large-scale information aggregation and analysis or in smaller-scale projects like weblog syndication, this book will provide you with a solid foundation for working with RDF.

From the Publisher

The Resource Description Framework (RDF) is a structure for describing and interchanging metadata on the Web. Practical RDF explains RDF from the ground up, providing real-world examples and descriptions of how the technology is being used in applications like Mozilla, FOAF, and Chandler, as well as infrastructure you can use to build your own applications. This book cuts to the heart of the W3C's often obscure specifications, giving you tools to apply RDF successfully in your own projects.

About the Author

Shelley Powers is an independent contractor, currently living in St. Louis, who specializes in technology architecture and software development. She's authored several computer books, including Developing ASP Components, Unix Power Tools 3rd edition, Essential Blogging, and Practical RDF. In addition, Shelley has also written several articles related primarily to web technology, many for O'Reilly. Shelley's web site network is at http://burningbird.net, and her weblog is Burningbird, at http://weblog.burningbird.net.

Excerpted from Practical RDF by Shelley Powers. Copyright © 2003. Reprinted by permission. All rights reserved.

CHAPTER 8 - Jena: RDF in Java

Hewlett-Packard’s Semantic Web team has been quietly working on Jena—a full-featured Java API for RDF—about as long as work has been progressing on RDF itself. In fact, the cochair of the RDF Working Group is Brian McBride, one of the creatorsof Jena.

Included with the Jena toolkit are the dependencies and installation instructions, which I won’t repeat here. I have worked with Jena on Linux (Red Hat), FreeBSD, and Windows; the examples included with Jena and the examples in this chapter work equally well in all environments. The only requirement is that you use JRE 1.2 or above.

A description of the many Java classes included with Jena is included with the installation (as Javadocs). I won’t cover all of them here, only those most critical to understanding the underlying architecture in Jena.

I used Jena 1.6.1 in this chapter, but by the time this book is out, Jena 2.0 should be available. The Jena developers are refactoring many of the classes, changing class structure as well as making modifications to the API itself. These changes will break these examples, unfortunately.

However, the concepts behind the examples should stay the same, and the book support site will have updated example source.

The Underlying Parser
Included within the Jena toolset is an RDF parser, ARP (an acronym for Another RDF Parser), accessible as a standalone product. You had a chance to look at andwork with ARP in Chapter 7, so I won’t go into additional detail here, since it works in the background with no further intervention necessary on our part. Our work begins once the RDF data is loaded into a model.

Though not covered in this book, Jena also includes an N3 (Notation3) parser.

The Model
Jena’s API architecture focuses on the RDF model, the set of statements that comprises an RDF document, graph, or instantiation of a vocabulary. A basic RDF/XML document is created by instantiating one of the model classes and adding at least one statement (triple) to it. To view the RDF/XML, read it into a model and then access the individual elements, either through the API or through the query engine.

The ModelMem class creates an RDF model in memory. It extends ModelCom—the class incorporating common model methods used by all models—and implements the key interface, Model. In addition, the DAML class, DAMLModelImpl, subclasses ModelMem.

The ModelRDB class is an implementation of the model used to manipulate RDF stored within a relational database such as MySQL or Oracle. Unlike the memory model, ModelRDB persists the RDF data for later access, and the basic functionality between it and ModelMem is opening and maintaining a connection to a relational database in addition to managing the data. An interesting additional aspect of this implementation, as we’ll see later in the section "In-Memory Versus Persistent Model Storage," is that you can also specify how the RDF model is stored within a relational database—as a flat table of statements, as a hash, or through stored procedures.

Once data is stored in a model, the next step is querying it.

One major change with Jena 2.0 is the addition of the ModelFactory to create new instances of models.

The Query
You can access data in a stored RDF model directly using specific API function calls, or via RDQL—an RDF query language. As will be demonstrated in Chapter 10, querying data using an SQL-like syntax is a very effective way of pulling data from an RDF model, whether that model is stored in memory or in a relational database. Jena’s RDQL is implemented as an object called Query. Once instantiated, it can then be passed to a query engine (QueryEngine) and the results stored in a query result (QueryResult and various implementations: QueryResultsFormatter, QueryResultsMem, and QueryResultsStream). To access specific returned values, program variables are bound to the result sets using the ResultBinding class.

Once data is retrieved from the RDF/XML, you can iterate through it using any number of iterators. Once you query data using the Query object, or if you access all RDF/XML elements of a specific class, you can assign the results to an iterator objectand iterate through the set, displaying the results or looking for a specific value. Eachof several different iterator classes within Jena is focused on specific RDF/XML classes, such as NodeIterator for general RDF nodes (literal or resource values), ResIterator, and StmtIterator.

DAML+OIL
Starting with later versions of Jena, support for DAML+OIL was added to the tool suite. DAML+OIL is a language for describing ontologies, a way of describing constraints and refinements for a given vocabulary that are beyond the sophistication of RDFS. Much of the effort on behalf of the Semantic Web is based on the Web Ontology Language at the W3C, which owes much of its effort to DAML+OIL. The principle DAML+OIL class within Jena, outside of the DAMLModel, is the DAMLOntology class.

I won’t be covering the DAML+OIL classes in this chapter, but the creators of Jena provide a tutorial that demonstrates them and is included in the documents you get when you download Jena.

‹  Return to Product Overview

Amazon.co.uk Privacy Statement Amazon.co.uk Delivery Information Amazon.co.uk Returns & Exchanges