de.hedenus.rdf
Class RDFGraph

java.lang.Object
  extended by de.hedenus.rdf.RDFGraph
All Implemented Interfaces:
Graph, java.io.Serializable

public class RDFGraph
extends java.lang.Object
implements Graph, java.io.Serializable

A RDF graph.

Author:
Michael Hedenus
See Also:
Serialized Form

Field Summary
static int STATEMENT_ASSERTED
           
static int STATEMENT_AXIOM
           
static int STATEMENT_INFERED
           
 
Constructor Summary
RDFGraph()
           
 
Method Summary
 void addGraphListener(GraphListener l)
           
 java.util.Collection arcs()
          Returns all arcs of the graph.
 BlankNode createBlankNode()
          Creates a new blank node.
 Literal createLiteral(java.lang.String string, java.lang.String datatype, java.lang.String language)
          Creates a new literal node.
 Statement createStatement(RDFNode subject, java.lang.String predicate, RDFNode object, int statementType)
          Creates a (basic) statement.
 URIRefNode createURIRefNode(java.lang.String uri)
          Returns or lazily creates a resource object for a URI.
 void dump()
           
 void dump(java.io.OutputStream outputStream, boolean sort)
           
 NamespaceContext getNamespaceContext()
           
 RDFNode getNode(java.lang.String key)
          Returns a node by its key.
 int getStatementType(Statement statement)
           
 java.util.Collection nodes()
          Returns all nodes of the graph.
 int queryStatement(java.lang.String subject, java.lang.String predicate, java.lang.String object, java.util.Collection result)
          Queries statement and puts the matching statements into result.
 void removeGraphListener(GraphListener l)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATEMENT_AXIOM

public static final int STATEMENT_AXIOM
See Also:
Constant Field Values

STATEMENT_ASSERTED

public static final int STATEMENT_ASSERTED
See Also:
Constant Field Values

STATEMENT_INFERED

public static final int STATEMENT_INFERED
See Also:
Constant Field Values
Constructor Detail

RDFGraph

public RDFGraph()
Method Detail

addGraphListener

public void addGraphListener(GraphListener l)

removeGraphListener

public void removeGraphListener(GraphListener l)

getNode

public RDFNode getNode(java.lang.String key)
Returns a node by its key.
  1. Blank Node: id()
  2. Literal: id()
  3. Resource: URI external form

Parameters:
key - the node's key.

nodes

public java.util.Collection nodes()
Description copied from interface: Graph
Returns all nodes of the graph.

Specified by:
nodes in interface Graph

arcs

public java.util.Collection arcs()
Description copied from interface: Graph
Returns all arcs of the graph.

Specified by:
arcs in interface Graph

getNamespaceContext

public NamespaceContext getNamespaceContext()

dump

public void dump()

dump

public void dump(java.io.OutputStream outputStream,
                 boolean sort)

queryStatement

public int queryStatement(java.lang.String subject,
                          java.lang.String predicate,
                          java.lang.String object,
                          java.util.Collection result)
Queries statement and puts the matching statements into result.

Parameters:
subject -
predicate -
object -
result -
Returns:
the number of matches found

getStatementType

public int getStatementType(Statement statement)

createStatement

public Statement createStatement(RDFNode subject,
                                 java.lang.String predicate,
                                 RDFNode object,
                                 int statementType)
Creates a (basic) statement.


createURIRefNode

public URIRefNode createURIRefNode(java.lang.String uri)
                            throws RDFException
Returns or lazily creates a resource object for a URI.

Returns:
the Resource instance.
Throws:
RDFException

createBlankNode

public BlankNode createBlankNode()
Creates a new blank node.


createLiteral

public Literal createLiteral(java.lang.String string,
                             java.lang.String datatype,
                             java.lang.String language)
Creates a new literal node.