jena logo
on this site
 
 
 
 
 
 
 

Index

General

RDF model API

  • no entries yet

Reasoner and inference models

  • no entries yet

Ontology API

Database and persistence

  • no entries yet

XML serialisation (reading and writing)

  • no entries yet

RDQL and query processing

  • no entries yet

Miscellaneous

  • no entries yet

Answers

General

Q: Why do I get a ClassNotFoundException when I run Jena?
A: This means that one or more of the libraries that Jena depends on is not on your classpath. Typically, all of the librarys (.jar files) in $JENA/lib, where $JENA refers to the directory in which you installed Jena, should be on your classpath. Consult the documentation for your JDK for details on setting the classpath for your system.

RDF model API

no entries yet

Reasoner and inference models

no entries yet

Ontology API

Q: Why doesn't listClasses() (or listProperties()/listIndividuals(), etc) work?
A: It does work. Extensive unit tests are used to check the correctness of Jena, and are included in the downloaded source code for your reference. If listClasses(), or a similar method, is not producing the answers you expect, or no answers at all, you should first check that your model is correctly defined. Print a copy of your model as a debug step, to see if the URI's match up (e.g, if you are expecting resource x to be an individual of class Y, check that the rdf:type of x is the same as the URI of the class declaration for Y). A common problem is that relative URI's change depending where you read the model from. Try adding an xml:base declaration to the document to ensure that URI's are correctly specified.

Q: Why doesn't the ontlogy API handle sub-class (or sub-property, domain, range, etc) relationships in a DAML model?
A: These relationships are handled correctly, but the results you see are dependent on the model configuration. The DAML specification includes a number of aliases for RDFS constructs to copy them into the DAML+OIL namespace. This means that, for a DAML processor, daml:subClassOf and rdfs:subClassOf are equivalent. This is declared by means of a daml:samePropertyAs in the daml+oil.daml specification document. Without a reasoner attached to the model, the ontology API will not recognise the equivalence with rdfs: properties. Thus, if you are not seeing the expected results when processing a DAML ontology, it is likely that your ontology file contains, for example,
<daml:Class rdf:ID="A"> <rdfs:subClassOf rdf:resource="B" /> ...
To fix this, either ensure that the ontology consistently uses daml: relationships, or declare the ontology model with the DAML micro rule-reasoner:
OntModel m = ModelFactory.createOntologyModel( OntModelSpec.DAML_MEM_RULE_INF, null );

Database and persistence

no entries yet

XML serialisation (reading and writing)

no entries yet

RDQL and query processing

no entries yet

Miscellaneous

no entries yet

 

Resource Description Framework
Hosted by: sourceforge.net