Jena Ontology API
-In this section I will give a general introduction to the the Jena2 -ontology API. I'll also describe a range of common user tasks. I +
This section is a general introduction to the the Jena2 +ontology API, including some of the common tasks you may need +to perform. We won't go into all of the many details of the API here: you should -expect to refer to the Jena2 Javadoc to -get full details of the capabilities of the API. Feedback, (via the -jena-dev support -list) is welcomed.
+expect to refer to the Javadoc to +get full details of the capabilities of the API.Prerequisites
-I will assume that you have a basic familiarity with RDF and with -Jena. There are many other Jena -help documents you can read for background -on these topics. There is also a -Jena programming tutorial you can follow -through.
+We'll assume that you have a basic familiarity with RDF and with +Jena. If not, there are other +Jena help documents you can read for background +on these topics, and a collection of tutorials.
Jena is a programming toolkit, using the Java programming language. While there are a few command-line tools to help you perform some key tasks using Jena, mostly you use Jena by writing Java programs. The examples in this document will be primarily code samples.
-I also won't be explaining the OWL or RDFS ontology languages in +
We also won't be explaining the OWL or RDFS ontology languages in much detail in this document. You should expect to refer to supporting documentation for details on those languages, for example the W3C OWL document index.
-Note: At the time of writing, work on OWL version 1.1 is still -underway. No decision has yet been made about when Jena will -support the new OWL 1.1 features. I will only use OWL 1.0 features -in this document.
+Note: Although OWL version 1.1 is now a W3C recommendation, +Jena's support for OWL 1.1 features is limited. We will be addressing +this in future versions Jena.
Overview
The section of the manual is broken into a number of sections. You do not need to read them in sequence, though later sections may @@ -174,20 +170,19 @@ The sections are:
Further assistance
-I hope that this document will be sufficient to help most readers +
Hopefully, this document will be sufficient to help most readers to get started using the Jena ontology API. For further support, -please post questions to the Jena support list: -jena-dev@yahoogroups. -You can also report bugs directly into the -Jena bug tracker -on SourceForge.
-Please note that we ask that you use the support list or the bug-tracker to communicate with the Jena team, rather than send email to the team members directly. This helps us manage Jena support more effectively, and facilitates contributions from other Jena community members.
+please post questions to the Jena support list, +or file a bug report. +Please note that we ask that you use the support list or the bug-tracker +to communicate with the Jena team, rather than send email to the team +members directly. This helps us manage Jena support more effectively, +and facilitates contributions from other Jena community members.
General concepts
In a widely-quoted definition, an ontology is
-"Â a specification of a conceptualization" -[Gruber, T. -1993]
+"a specification of a conceptualization" +[Gruber, T. 1993]
Let's unpack that brief characterisation a bit. It means that an ontology allows a programmer to specify, in an open, meaningful, @@ -1190,7 +1185,7 @@ class extension  individuals that ar using the following methods:
Method
Meaning
-listInstances()
+listInstances()
listInstances( boolean direct )
Returns an iterator over those instances that include this class
among their rdf:type
values. The direct
flag can be used to
@@ -1199,7 +1194,7 @@ than indirectly through the class hierar
rdf:type :Paper
, it will appear in the iterator returned by
listInstances
on :Artefact
, but not in the iterator returned by
listInstances(false)
on :Artefact
.
-createIndividual()
+createIndividual()
createIndividual( String uri )
Adds a resource to the model, whose asserted rdf:type
is this
ontology class. If no URI is given, the individual is an anonymous
@@ -2211,19 +2206,19 @@ regard it as an experimental facility fo
welcome feedback. The capabilities in OntTools
are implemented as
static methods. Currently available tools are:
-
-
OntClass getLCA( OntModel m, OntClass u, OntClass v )
+OntClass getLCA( OntModel m, OntClass u, OntClass v )
Determine the lowest common ancestor for classes u and v. This is the class that is lowest in the class hierarchy, and which includes both u and v among its sub-classes.
-Path findShortestPath( Model m, Resource start, RDFNode end, Filter onPath )
+Path findShortestPath( Model m, Resource start, RDFNode end, Filter onPath )
Breadth-first search, including a cycle check, to locate the shortest path fromstart
toend
, in which every triple on the path returnstrue
to theonPath
predicate.
-List namedHierarchyRoots( OntModel m )
+List namedHierarchyRoots( OntModel m )
Compute a list containing the uppermost fringe of the class hierarchy in the given model which consists only of named classes.
Author: Ian Dickinson
+
Author: Ian Dickinson Last modified: $Id: index.html,v 1.32 2009-02-24 15:15:20 ian_dickinson Exp $