Ontology Components

Ontologies consist of several different components. An ontology includes classes, relationships, properties, objects, and other components. Ontologies can be specified in OWL or several other formats.


Ontology classes are roughly analogous to Java classes. They are a common definition of a group of similar objects. They may subclass other classes, or they might be formed from the intersection of two classes. A class can contain values or value limitations for properties and relationships.

In Prajna, the class OwlClass represents a class in an Owl ontology.


Ontology things are analogous to Java objects. They are specific instances of a class, and will usually define specific property values and relationships. Things are essentially collections of triples about a common subject.

In Prajna, the OwlThing class represents a Thing defined in an Owl file.


A property links two concepts together in a triple. The subject is usually a Thing within the ontology. The object is frequently also a thing, but may also be a literal string or value. Properties of an object typically represnt information about that object.

In Prajna, the Property class represents a general property. The OwlObjectProperty class represents a property which links the subject to another Thing, while the OwlDatatypeProperty class references a literal value.

Triples and Queries

Ontologies are built on collections of assertions or facts. These facts are frequently represented in RDF, though other representations are available. A triple is a statement in the form Subject - Predicate (or Property) - Object. For instance, Fido (subject) is a (predicate) dog (object), or Fido (subject) chases (predicate) cars (object).

A query is a special type of triple where one of the three components is unknown. A query can be used to filter a set of triples to identify those which match the query.

In Prajna, the RdfTriple class represents a triple. The triple can be of several types, which indicate how the triple was derived. Most frequently, the triple type is EXPLICIT, indicating that the data was created explicitly. The triple may also be implied by an object's class, by a more specialized relationship, or by other triples. For instance, if we know Fido is a Dog, and Dogs are Mammals, then we can infer that Fido is a Mammal.

Queries can also be represented by the RdfTriple class. One of the three fields is expected to be null, and the TripleType should be set to QUERY. To match the query against other triple, use the matches method.