org.w3c.rdf.implementation.model
Class ModelImpl

java.lang.Object
  |
  +--org.w3c.rdf.implementation.model.ModelImpl

public class ModelImpl
extends java.lang.Object
implements Model, Digestable, Digest


Constructor Summary
  ModelImpl()
           
  ModelImpl(NodeFactory f)
           
protected ModelImpl(java.lang.String uri, java.util.Hashtable triples, LongTable lookup, boolean shared)
           
 
Method Summary
 void add(Resource subject, Resource predicate, RDFNode object)
          Adds a new triple to the model.
 void add(Resource subject, Resource predicate, java.lang.String object)
          Adds a new triple to the model.
 void add(Statement t)
          Adds a new triple to the model.
 java.lang.Object clone()
           
 boolean contains(Statement t)
          Tests if the model contains the given triple.
 Model create()
          Creates empty model of the same Class
 Model duplicate()
          Clone the model.
 java.util.Enumeration elements()
          Enumerate triples
 Model find(Resource subject, Resource predicate, RDFNode object)
          General method to search for triples.
 Digest getDigest()
           
 java.lang.String getDigestAlgorithm()
           
 byte[] getDigestBytes()
           
 java.lang.String getLabel()
           
 NodeFactory getNodeFactory()
           
 java.lang.String getSourceURI()
          Returns current base URI setting.
 java.lang.String getURI()
           
 void remove(Statement t)
          Removes the triple from the model.
 void setSourceURI(java.lang.String uri)
          Set a base URI for the message.
 int size()
          Number of triples in the model
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModelImpl

public ModelImpl()

ModelImpl

public ModelImpl(NodeFactory f)

ModelImpl

protected ModelImpl(java.lang.String uri,
                    java.util.Hashtable triples,
                    LongTable lookup,
                    boolean shared)
Method Detail

setSourceURI

public void setSourceURI(java.lang.String uri)
Set a base URI for the message. Affects creating of new resources and serialization syntax. null is just alright, meaning that the serializer will use always rdf:about and never rdf:ID
Specified by:
setSourceURI in interface Model

getSourceURI

public java.lang.String getSourceURI()
Returns current base URI setting.
Specified by:
getSourceURI in interface Model

size

public int size()
Number of triples in the model
Specified by:
size in interface Model
Returns:
number of triples

elements

public java.util.Enumeration elements()
Enumerate triples
Specified by:
elements in interface Model

contains

public boolean contains(Statement t)
Tests if the model contains the given triple.
Specified by:
contains in interface Model
Returns:
true if the triple belongs to the model; false otherwise.
See Also:
org.w3c.rdf.Statement

add

public void add(Resource subject,
                Resource predicate,
                java.lang.String object)
Adds a new triple to the model. A literal is created out of the string parameter object. This method is just a shortcut.
See Also:
org.w3c.rdf.Resource

add

public void add(Resource subject,
                Resource predicate,
                RDFNode object)
Adds a new triple to the model. The object of the triple is an RDFNode.
See Also:
org.w3c.rdf.Resource, org.w3c.rdf.RDFNode

add

public void add(Statement t)
Adds a new triple to the model.
Specified by:
add in interface Model
See Also:
org.w3c.rdf.Statement

remove

public void remove(Statement t)
Removes the triple from the model.
Specified by:
remove in interface Model
See Also:
org.w3c.rdf.Statement

find

public Model find(Resource subject,
                  Resource predicate,
                  RDFNode object)
General method to search for triples. null input for any parameter will match anything.

Example: Model result = m.find( null, RDF.type, new Resource("http://...#MyClass") )

finds all instances of the class MyClass

Specified by:
find in interface Model
See Also:
org.w3c.rdf.Resource, org.w3c.rdf.RDFNode

duplicate

public Model duplicate()
Clone the model.
Specified by:
duplicate in interface Model

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

create

public Model create()
Creates empty model of the same Class
Specified by:
create in interface Model

getNodeFactory

public NodeFactory getNodeFactory()
Specified by:
getNodeFactory in interface Model

getLabel

public java.lang.String getLabel()

getDigest

public Digest getDigest()
Specified by:
getDigest in interface Digestable

getURI

public java.lang.String getURI()

getDigestAlgorithm

public java.lang.String getDigestAlgorithm()
Specified by:
getDigestAlgorithm in interface Digest

getDigestBytes

public byte[] getDigestBytes()
Specified by:
getDigestBytes in interface Digest