org.jrdf.graph
Interface GraphElementFactory

All Superinterfaces:
GraphValueFactory
All Known Implementing Classes:
GraphElementFactoryImpl

public interface GraphElementFactory
extends GraphValueFactory

A Graph Element Factory is a class which creates the various components of a graph including: resources, literals and blank nodes. It is generally tied to a specific graph (in the case of blank nodes it must be).

Version:
$Revision: 2894 $
Author:
Andrew Newman

Method Summary
 BlankNode createBlankNode()
          Create a blank node that is associated with a specific graph.
 Resource createResource()
          Create a resource, wrapping a blank node that is associated with a specific graph.
 Resource createResource(BlankNode node)
          Wrap a blank node in a resource.
 Resource createResource(Node node)
           
 Resource createResource(URI uri)
          Create a URI reference wrapped in a Resource.
 Resource createResource(URI uri, boolean validate)
          Create a URI reference wrapped in a Resource without checking if the URI given is a valid RDF URI, currently if the URI is absolute.
 Resource createResource(URIReference node)
          Wrap a URIReference in a resource.
 
Methods inherited from interface org.jrdf.graph.GraphValueFactory
createLiteral, createLiteral, createLiteral, createLiteral, createURIReference, createURIReference
 

Method Detail

createResource

Resource createResource()
                        throws GraphElementFactoryException
Create a resource, wrapping a blank node that is associated with a specific graph.

Returns:
the newly created resource wrapping a blank node value.
Throws:
GraphElementFactoryException - if adding a blank node fails.

createResource

Resource createResource(BlankNode node)
                        throws GraphElementFactoryException
Wrap a blank node in a resource.

Parameters:
node - the node to wrap.
Returns:
a new resource.
Throws:
GraphElementFactoryException - if the blank node does not exist.

createResource

Resource createResource(URIReference node)
                        throws GraphElementFactoryException
Wrap a URIReference in a resource.

Parameters:
node - the node to wrap.
Returns:
a new resource.
Throws:
GraphElementFactoryException - if the URIReference does not exist.

createBlankNode

BlankNode createBlankNode()
                          throws GraphElementFactoryException
Create a blank node that is associated with a specific graph.

Returns:
the newly created blank node value.
Throws:
GraphElementFactoryException - if adding a blank node fails.

createResource

Resource createResource(URI uri)
                        throws GraphElementFactoryException
Create a URI reference wrapped in a Resource.

Parameters:
uri - The URI of the resource.
Returns:
the newly created resource wrapping a URI reference value.
Throws:
GraphElementFactoryException - If the resource failed to be created.

createResource

Resource createResource(URI uri,
                        boolean validate)
                        throws GraphElementFactoryException
Create a URI reference wrapped in a Resource without checking if the URI given is a valid RDF URI, currently if the URI is absolute.

Parameters:
uri - The URI of the resource.
validate - true if we disbale checking to see if the URI is valid.
Returns:
The newly created URI reference value.
Throws:
GraphElementFactoryException - If the resource failed to be created.

createResource

Resource createResource(Node node)
                        throws GraphElementFactoryException
Throws:
GraphElementFactoryException