org.w3c.rdf.model.impl
Class RDFModelImpl

java.lang.Object
  |
  +--org.w3c.rdf.model.impl.RDFModelImpl

public class RDFModelImpl
extends java.lang.Object
implements RDFModel, Digestable


Constructor Summary
  RDFModelImpl()
           
protected RDFModelImpl(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(Triple t)
          Adds a new triple to the model.
 java.lang.Object clone()
           
 boolean contains(Triple t)
          Tests if the model contains the given triple.
 RDFModel create()
          Creates empty model of the same Class
 Literal createLiteral(java.lang.String str)
          Creates a literal out of a string
 Resource createResource(java.lang.String str)
          Creates a resource out of a string
 Triple createTriple(Resource subject, Resource predicate, RDFNode object)
          Creates a triple
 RDFModel duplicate()
          Clone the model.
 java.util.Enumeration elements()
          Enumerate triples
 RDFModel find(Resource subject, Resource predicate, RDFNode object)
          General method to search for triples.
 Digest getDigest()
           
 java.lang.String getLabel()
           
 java.lang.String getSourceURI()
          Returns current base URI setting.
 java.lang.String getURI()
           
 void remove(Triple 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

RDFModelImpl

public RDFModelImpl()

RDFModelImpl

protected RDFModelImpl(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 RDFModel

getSourceURI

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

size

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

elements

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

contains

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

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(Triple t)
Adds a new triple to the model.
Specified by:
add in interface RDFModel
See Also:
org.w3c.rdf.Triple

remove

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

find

public RDFModel 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 RDFModel
See Also:
org.w3c.rdf.Resource, org.w3c.rdf.RDFNode

duplicate

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

clone

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

create

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

createResource

public Resource createResource(java.lang.String str)
Creates a resource out of a string
Specified by:
createResource in interface RDFModel

createLiteral

public Literal createLiteral(java.lang.String str)
Creates a literal out of a string
Specified by:
createLiteral in interface RDFModel

createTriple

public Triple createTriple(Resource subject,
                           Resource predicate,
                           RDFNode object)
Creates a triple
Specified by:
createTriple in interface RDFModel

getLabel

public java.lang.String getLabel()

getDigest

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

getURI

public java.lang.String getURI()