Previous Topic

Next Topic

JRDF Graphs

JRDF graphs are made up of triples (RDF statements). JRDF graphs can also represent parts of other JRDF graphs (known as subgraphs). JRDF graphs can create graph elements and be queried using triples.

In This Section

Triples

SubjectNodes

PredicateNodes

ObjectNodes

URIReferences

BlankNodes

Literals

GraphElementFactory

See Also

Java RDF (JRDF)

JRDF APIs

Querying a JRDF Graph

TKS Client Support

JRDF Memory Implementation

Containers and Collections

Built-in Visitor Pattern

Examples

The elements (classes) that make up a JRDF graph are as follows:

  • Triples
  • Nodes
  • SubjectNodes
  • PredicateNodes
  • ObjectNodes
  • URIReferences
  • BlankNodes
  • Literals

The following diagram shows the relationships between the different elements.

Triple

JRDF graph elements are created using a GraphElementFactory.

Triples

Triples are made up of three nodes, a SubjectNode, PredicateNode and ObjectNode, representing an RDF statement.

SubjectNodes

A SubjectNode represents an RDF resource (that is, the subject you are describing) and can be either a URIReference or BlankNode. A Literal cannot be a SubjectNode.

PredicateNodes

A PredicateNode represents a property (that is, a characteristic or attribute) of a resource. A PredicateNode can only be a URIReference. A PredicateNode describes the relationship between a SubjectNode and an ObjectNode and cannot be a BlankNode or a Literal.

ObjectNodes

An ObjectNode represents the value of a property. ObjectNodes can be either URIReferences, BlankNodes or Literals.

URIReferences

A URIReference combines a URI (Uniform Resource Identifier) and an optional fragment identifier to identify or represent a SubjectNode, PredicateNode or ObjectNode in a Triple.

BlankNodes

BlankNodes represent intermediate nodes used for representing structured information. For example, an address can be represented either by using a Literal for the whole address, or with a BlankNode as the SubjectNode and subsequent PredicateNodes and ObjectNodes for the different address elements.

Unlike other RDF representations, JRDF does not support labelled BlankNodes.

Literals

A Literal represents a constant value (for example "some literal text"). Literals can optionally have either a datatype URI (for example, http://www.w3.org/2001/XMLSchema#integer) or a language label (for example, en for english), but not both.

GraphElementFactory

Graph elements are created using a GraphElementFactory. A GraphElementFactory creates URIReferences, BlankNodes and Literals that are used to create triples.

Querying a JRDF Graph

Using a triple as a constraint, JRDF graphs can be queried to find all of the triples that match the constraint. Null values are used as wildcards. Querying a JRDF graph using null SubjectNodes, PredicateNodes and ObjectNodes returns all the triples in the graph.

Open Source logo

© 2001-2004 Tucana Technologies, Inc. Some rights reserved.

© 2006 The Mulgara Project. Some rights reserved.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".