Jena 2.5.5

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » RSS RDF » Jena 2.5.5 
Jena
License:
URL:http://jena.sourceforge.net/
Description:Jena is a Java framework for building Semantic Web applications.
Package NameComment
arq.examples
arq.examples.bgpmatching
arq.examples.engine
arq.examples.filter
arq.examples.propertyfunction
com.hp.hpl.jena
com.hp.hpl.jena.assembler
com.hp.hpl.jena.assembler.acceptance
com.hp.hpl.jena.assembler.assemblers
com.hp.hpl.jena.assembler.exceptions
com.hp.hpl.jena.assembler.test
com.hp.hpl.jena.datatypes Package documentation for com.hp.hpl.jena.datatypes

Provides the core interfaces through which datatypes are described to Jena. Instances of RDFDatatype describe serialization, parsing and equality-testing functions for a single Datatype. The TypeMapper provides a user-extensible registry through which datatype definitions can be registered against URIs. It is prepopulated with XML datatype definitions.

com.hp.hpl.jena.datatypes.xsd Package documentation for com.hp.hpl.jena.datatypes.xsd

Provides datatype definitions for the XML Schema datatypes support by Jena. This allows XSD typed literal to be used in RDF data. The static fields on the class XSDDatatype provide instances of each of the datatype definitions but these are preregistered with the TypeMapper.

This package includes code adapated from Xerces 2.6.0, which is maked and is Copyright (c) 1999-2002 The Apache Software Foundation. All rights reserved.

com.hp.hpl.jena.datatypes.xsd.impl Package documentation for com.hp.hpl.jena.datatypes.xsd.impl

Provides implementations of the XSD datatype. These implementations are currently just thin wrappers onto a set of internal classes defined by Xerces. This does make Jena reliant on the Xerces version and alternative implementations may be explored in the future.

com.hp.hpl.jena.db Jean Relational Database backend

A general database backend for persistent storage of Jena models. This Jena2 release runs on three database engines, MySQL, Oracle, PostgreSQL on two platforms, Linux and WindowsXP. The Jena2 persistence subsystem is largely compatible with Jena1 but does not support the various Jena1 layouts. Existing Jena1 databases cannot be accessed by Jena2 and must be reloaded.

For details on creating and accessing persistent models, see doc/DB/howto.html. For details on options for configuring and accessing persistent models see the doc/DB/options.html. For particulars on persistent models for the various database engines, see doc/DB/mysql-howto.html, doc/DB/oracle-howto.html,doc/DB/postgresql-howto.html.

Note that the recommended mechanism for creating and opening persistent models has changed from Jena1 and also from the preliminary releases of Jena2. Previous mechanisms are now deprecated and users are encouraged to use the new factory mechanisms. See doc/how-to/model-factory.html for details.

com.hp.hpl.jena.db.impl
com.hp.hpl.jena.db.test
com.hp.hpl.jena.enhanced graph.enhanced This package defines the enhanced node and graph classes; an enhanced node is one embedded in a particular enhanced graph.
com.hp.hpl.jena.enhanced.test enhanced.test Defines the tests for the enhanced node/graph package.
com.hp.hpl.jena.graph graph This package defines the Graph and Node family of classes, which form the underlying datatypes of the Jena system.
com.hp.hpl.jena.graph.compose graph.compose This package defines simple composite graphs - union, intersection, difference, and update-tracking.
com.hp.hpl.jena.graph.compose.test graph.compose.test This package defines tests for the composed-graph package.
com.hp.hpl.jena.graph.impl graph This package provides basic implementations of Graph interfaces such as Reifier, QueryHandler, BulkUpdateHandler, and EventManager. Also there is a base class GraphBase for implementations of Graph which handles the standard boilerplate code.
com.hp.hpl.jena.graph.query graph.query Defines the graph-level Query classes, allowing multi-pattern query over arbitrary graphs.
com.hp.hpl.jena.graph.query.regexptrees
com.hp.hpl.jena.graph.query.regexptrees.test
com.hp.hpl.jena.graph.query.test graph.query.test Defines the test cases for the graph.query package.
com.hp.hpl.jena.graph.test graph.test This package contains the tests for the Graph and Node family of classes.
com.hp.hpl.jena.mem graph Various memory-based implementations of interfaces, specifically GraphMem for memory-based Graphs.
com.hp.hpl.jena.mem.faster
com.hp.hpl.jena.mem.faster.test
com.hp.hpl.jena.mem.test
com.hp.hpl.jena.n3

Jena N3 Parser, RDF Reader and Writer

This package contains

  • an N3 parser
  • a Jena reader, for reading the RDF subset of N3 into a Model
  • a Jena writer for outputting RDF in an N3 syntax.

The N3 writer is aimed at producing readable N3 and analysies the model before writing.  It may unsuitable for some forms of very large model.

This package does not contains a rules engine to interprete or execute N3 formulae.  It is not a replacement for cwm; this system aims to provide daat input fo RDF in N3 format.

The Parser

The N3 parser provided parses the whole of the N3 language.  It is a streaming parser that emits parser events (see the class N3ParserEventHandler) when a new triple is encountered.

It is a permissive parser, it does not aim to validate an N3 and mioght even parse some constructs which are not valid (examples include named formulae and named DAML lists;  the generated parser events do not expressive the named objects).  It does not check the characters comprising URIs and is more permissive on qnames that strict defintion would require.

The parser is built using antlr. The grammar file is "n3.g".  An application will need access to the antlr runtime classes which are provided in antlr.jar in the Jena lib/ directory.

There is a simple application in jena.n3 that accesses the N3 parser directly or via the RDF generator for file conversion or for simple file checking.

The RDF generator

The RDF generator takes a stream of parser events and turns them into additions to a Jena model.  The Jena reader is then a class that wraps up this functionality to conform to the Jena reader interface.  The RDF generator does not allow formulae and will cause an error if one is encountered.

Performance

The parser alone runs at about 18K triples/second on Pentium4 750Mhz PC (it is I/O bound in the lexer).  When generating RDF, the rate is about 9K statements/second.

Notes

N3 files are UTF-8: not raw bytes or ISO-8859-1.  Applications should pass UTF-8 character set readers and writers to the appropriate Jena operations model.read and model.write.  Often, this does not make a difference but can cause silent loss or change of character information.

Other Information on N3

Acknowledgements

The grammar was not written from scratch.  The grammar is based on cwm, Dan Connerly's python grammar and Graham Klyne's N3Parser as well as "Notation3 : A Rough Guide" which lists other parsers.

com.hp.hpl.jena.n3.test
com.hp.hpl.jena.n3.turtle
com.hp.hpl.jena.n3.turtle.parser
com.hp.hpl.jena.n3.turtle.test
com.hp.hpl.jena.ontology Package documentation for com.hp.hpl.jena.ontology

Provides a set of abstractions and convenience classes for accessing and manipluating ontologies represented in RDF. The two prevalent ontology languages based on RDF are OWL and DAML+OIL. Since these two languages are similar, this package attempts to present a common set of abstractions, parameterised by vocabularies fot the different languages.

Note: this package primarily seeks to provide easy programmatic access to the terms in the ontologies. The ontology languages have well-defined semantics that provide entailment rules for triples not directly asserted by the ontology. By and large, an inference engine is needed to access these entailed triples, for which several options and an open architecture are provided elsewhere in Jena.

com.hp.hpl.jena.ontology.event
com.hp.hpl.jena.ontology.event.test
com.hp.hpl.jena.ontology.impl Package documentation for com.hp.hpl.jena.ontology

Provides default implementations for the abstractions defined in the com.hp.hpl.jena.ontology package.

com.hp.hpl.jena.ontology.impl.test Ontology unit tests

Unit test cases for classes at general ontology layer (i.e. language independent features).

com.hp.hpl.jena.rdf.arp

A parser for RDF/XML.

See the ARP documentation and the I/O mini howto for more information.

com.hp.hpl.jena.rdf.arp.impl
com.hp.hpl.jena.rdf.arp.lang

Language support for RDF.

com.hp.hpl.jena.rdf.arp.states
com.hp.hpl.jena.rdf.arp.states.test
com.hp.hpl.jena.rdf.arp.test
com.hp.hpl.jena.rdf.listeners

A package defining some useful implementations of ModelChangedListener, for listening to (a) all triples added or removed, exploding composite objects, (b) all objects added or removed, as themselves, (c) notification of additions/removals, but no details, and (d) accepting but ignoring all changes, as a base-class to be extended.

com.hp.hpl.jena.rdf.model

A package for creating and manipulating RDF graphs.

com.hp.hpl.jena.rdf.model.impl graph This package contains implementations of the interfaces defined in the .model package, eg ModelCom for Model, ResourceImpl for Resource, and so on. ModelCom builds models out of Graphs using the EnhGraph and EnhNode classes defined in .enhanced.
com.hp.hpl.jena.rdf.model.test
com.hp.hpl.jena.reasoner

The Jena2 reasoner subsystem is designed to allow a range of inference engines to be plugged into Jena. Such reasoners are primarily used to derive additional RDF assertions which are entailed from some base RDF together with any optional ontology information and the axioms and rules associated with the reasoner. In addition, they can be used to test global properties of an RDF graph such as consistency.

This machinery, and the rest of this description, are appropriate for developers working with Graphs and Nodes at the SPI level. Application developers using Models should see the convenience methods built into ModelFactory.

Each available reasoner is represented by an factory object which is an instance of a ReasonerFactory. It is also given a URI through which it can be identified. This URI is used both as the base of a set of RDF assertions which describe the reasoner capabilitiesand as an identifier for registering the reasoner with a central registry. If you only need to access a specific built-in reasoner you can use the factory class directly or the convenience methods built into ModelFactory [TODO: ref]. However, if you need to dynamically check what reasoners are registered with the Jena2 installation and examine their capabilities use the machinery in ReasonerRegistry.

Once you have an appropriate factory you can create a reasoner instance. The instance can then be bound to a set of RDF data for processing. The result of such binding is an InfGraph , this is a specialization of the standard Graph interface - all the RDF assertions entailed from the base data via the reasoner appear as "virtual" triples within this InfGraph. Some additional methods on InfGraph offer access to the reasoner, the raw data and some additional capabilities.

For example, using the SPI all of the steps involved in generated an RDFS closure of a graph are:

  ReasonerFactory rf = RDFSReasonerFactory.theInstance();
  Reasoner reasoner  = rf.create(null);
  InfGraph graph     = reasoner.bindSchema(tbox) // optional
                               .bind(data);
  Model model        = new ModelMem(graph);

For application developers working with the API then this code is accessible through the convenience methods in ModelFactory.

If the resulting graph or model are queried using find/listStatements they contain the sum of all the assertions in the tbox graph, the data graph and the triples entailed from them via RDF+RDFS entailment.

The ability to separately bind rule or ontology information (tbox in the example) and raw assertional information (data in the example) is optional. Some reasoners may require a strict separation of terminology and instance data, others may allow both binds but be lax about the allowed contents of each, others may not support the bindSchema stage.

The existing built-in reasoners allow a single tbox together with a single data bind but the tbox is optional and unrestricted. In the case of the RDFSReasoner in the example, some work is done at bindSchema time to cache information on property and class lattices that may be reused across multiple data sets but the extent of that reuse is lessened if the data graph also contains such schema assertions.

com.hp.hpl.jena.reasoner.dig
com.hp.hpl.jena.reasoner.dig.test
com.hp.hpl.jena.reasoner.rdfsReasoner1 This package contains an example RDFS reasoner. It was developed partly to test the reasoning API and support machinery though it is a complete and reasonably useful RDFS implementation. It has since been replaced by RDFSRuleReasoner which offers much better scaling.

All RDFS implementations need to make tradeoffs. This implementation is intended to be complete (it can cope with metadata level declarations such as declaring and using a subPropertyOf rdfs:subPropertyOf). It requires all schema information to be loadable into main memory - the property and class lattices are stored reasonably efficiently but they will often be the limiting factor on size (and certainly on performance). These lattices are processed at the time the reasoner is bound to the schema and instance data. However, the rest of the RDFS inference rules will operate in a backwards chaining mode so that significant processing will be required to answer a given query. Highly ground queries will operate reasonably efficiently, queries with wildcards in predicate slot will operate particularly inefficiently and will make redundant passes across the data.

Implementation notes

The subClassOf and subPropertyOf relationships are cached in memory using the TransitiveReasoner. This stores those relationships as explicit graphs containing the full relationship closure. The direct links are represented by direct versions of the subClassOf and subPropertyOf relations which can be constructed using ReasonerFactory#makeDirect or found as class variables on the TransitiveReasoner.

The schema rules such as domain, range and subPropertyOf inference are also checked at the time the data is bound but the result is the addition of a set of backward chaining rewrite rules which can match a given query against possible inferences.  For example the domain rule is:

   ?p rdfs:domain ?z -> ?s rdf:type ?z <- ?s ?p _

Thus the processing of a (p,domain,z) declaration generates a backward rule of the form "if you are looking for something of type z then check if there is any individual which is the subject of a p property.

All of these backward rules are implemented using the Graph iterators together with some simple triple rewrite machinery.

One special case to be aware of is the processing of container membership property entailments. By default the reasoner does a scan of the entire tbox+data looking for properties of the form rdf:_n and for each one found it asserts the appropriate entailments. This involves a pass over the whole dataset (we take the opportunity to cache all [p,type, Property] and [p, subPropertyOf,p] entailments at the same time). This behaviour can be switched off using the configuration option [TODO: document] which considerably reduces to the initial processing time but [x,type,containerMembershipProperty] and [x,subPropertyOf,member] entailments will then be missed. This may or may not be a useful trade-off depending on the application.



com.hp.hpl.jena.reasoner.rulesys Package documentation for com.hp.hpl.jena.reasoner.rulesys

Provides a selection of simple rule engines for Jena inference models. Currently this includes a simple forward chaining engine (BasicForwardRuleReasoner). This is currently a pure interpreter (no RETE network) with an extensible set of Builtin actions (see Builtin).

We include two example reasoners built using this rule engine. The first is an alternative RDFS implementation (RDFSRuleReasonerFactory) which implements the full RDFS rule set forward style.

The second is an implementation of the OWL-lite subset of OWL-full (OWLRuleReasonerFactory). This omits some of the RDFS entailments (everything is a Resource, every Class is a subclass of Resource) because those conclusions are general not that useful and lead to rather a lot of pointless deductions in forward chaining mode.

com.hp.hpl.jena.reasoner.rulesys.builtins Package documentation for com.hp.hpl.jena.reasoner.rulesys.impl

Implementations of the Builtin class which provides primitive operations to the rule engines. The current set is small - just enought to implement OWL and demonstrate the principle of Builtin's - not comprehensive.

com.hp.hpl.jena.reasoner.rulesys.impl Package documentation for com.hp.hpl.jena.reasoner.rulesys.impl

Internal implementation objects used by the rule system interpreters and compilers. Note that the class in here are not intended for general use. In particular, they are primarily stucts rather than correctly encasulated objects (i.e. they access each other's fields directly in some cases, instead of indirectly through accessor methods).

com.hp.hpl.jena.reasoner.rulesys.impl.oldCode Package documentation for com.hp.hpl.jena.reasoner.rulesys.impl.attic

Contains code which has been obsoleted by new versions of the rule engines but which is being retained temporarily during the transition phase. In particular it contains the components of the original tabled backward chaining engine that have been replaced by the LP (SLG-WAM style) engine.

com.hp.hpl.jena.reasoner.rulesys.test Package documentation for com.hp.hpl.jena.datatypes

Provides testing support for the rule engines.

com.hp.hpl.jena.reasoner.test
com.hp.hpl.jena.reasoner.transitiveReasoner This package contains a reasoner which supports transitive-reflexive closure of subPropertyOf and subClassOf relations. A single tbox can optionally be bound, which is expected to contain schema information but can contain other information as well. A single data graph can be bound - whch is allowed to contain schema information in which case the work of scanning the tbox is lost and has to be redone (because the data might define sub-properties of subPropertOf or subClassOf which were missed in the original tbox scan).

The generated InfGraph will appear to contain the union of the data graph, the tbox graph, the reflexive-transitive closure of any subPropertyOf and subClassOf relations together with direct versions of these.

Defects

The current implementation is flawed in its handling of multiple data bindings - you can't actually reuse the work of tbox binding across different data sets. This will be fixed soon.


com.hp.hpl.jena.regression
com.hp.hpl.jena.shared shared This package defines some classes common to the Jena API and SPI levels, in particular the JenaException class from which all Jena-specific exceptions hang, and the interface PrefixMapping for translation to and from QNames.
com.hp.hpl.jena.shared.impl graph This package provides "standard" implementations for the interfaces defined by .shared, notably an implementation of PrefixMapping.
com.hp.hpl.jena.shared.test
com.hp.hpl.jena.shared.uuid
com.hp.hpl.jena.shared.uuid.test
com.hp.hpl.jena.shared.wg shared.wg This package defines some classes to help with accessing tests produced by the RDF Core and WebOnt WGs. The tests can be accessed either from the web, or from a zip on the web, from a local copy in the testing directory.
com.hp.hpl.jena.test
com.hp.hpl.jena.util Package documentation for com.hp.hpl.jena.util

Miscellaneous collection of utility classes.

com.hp.hpl.jena.util.cache
com.hp.hpl.jena.util.iterator

A package for defining useful iterators and iterator operations, including concatenation, mapping, filtering, empty and singleton iterators, iterator wrappers, and the ExtendedIterator class used in many places in Jena.

com.hp.hpl.jena.util.iterator.test
com.hp.hpl.jena.util.junit
com.hp.hpl.jena.util.test
com.hp.hpl.jena.util.tuple
com.hp.hpl.jena.util.xml
com.hp.hpl.jena.vocabulary

A package containing constant classes with predefined constant objects for classes and properties defined in well known vocabularies.

com.hp.hpl.jena.vocabulary.test
com.hp.hpl.jena.xmloutput

Writing RDF/XML.

com.hp.hpl.jena.xmloutput.impl
com.hp.hpl.jena.xmloutput.test
jena

A package for some Jena command-line programs, including

  • copying RDF data with representation conversion, eg XML to N3
  • comparing two RDF files for isomorphism (extended equality)
  • an interface to the ARP RDF parser
  • access to the RDQL interpreter
  • a schema-to-Java generator

jena.cmdline
jena.examples.ontology.classHierarchy
jena.examples.ontology.describeClass
jena.examples.ontology.persistentOntology
jena.examples.rdf
jena.test
jena.util
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.