org.semanticdesktop.aperture.rdf.impl
Class RDFContainerImpl

java.lang.Object
  extended by org.semanticdesktop.aperture.rdf.impl.RDFContainerImpl
All Implemented Interfaces:
RDFContainer

public class RDFContainerImpl
extends Object
implements RDFContainer

A default RDFContainer implementation, wrapping and editing a RDF2Go Model.

RDFContainerImpl can wrap a dedicated Model or can alternatively wrap a Model shared with other RDFContainerImpls. Depending on this mode, the dispose method will or will not close the underlying Model.


Constructor Summary
RDFContainerImpl(Model model, String describedUri)
          Create a new RDFContainerImpl that will manage statements concerning the specified URI.
RDFContainerImpl(Model model, String describedUri, boolean modelShared)
          Create a new RDFContainerImpl that will manage statements concerning the specified URI.
RDFContainerImpl(Model model, URI describedUri)
          Create a new RDFContainerImpl that will manage statements concerning the specified URI.
RDFContainerImpl(Model model, URI describedUri, boolean modelShared)
          Create a new RDFContainerImpl that will manage statements concerning the specified URI.
 
Method Summary
 void add(Statement statement)
           
 void add(URI property, boolean value)
           
 void add(URI property, Calendar value)
           
 void add(URI property, Date value)
           
 void add(URI property, int value)
           
 void add(URI property, long value)
           
 void add(URI property, Node node)
           
 void add(URI property, String value)
           
 void dispose()
          Disposes this RDFContainerImpl.
 Collection getAll(URI property)
           
 Boolean getBoolean(URI property)
           
 Calendar getCalendar(URI property)
           
 Date getDate(URI property)
           
 URI getDescribedUri()
          Get the identifier of the resource that is described by the contents of this RDFContainer.
 Integer getInteger(URI property)
           
 Long getLong(URI property)
           
 Model getModel()
          Get the underlying RDF2Go model holding the RDF statements.
 Node getNode(URI property)
           
 String getString(URI property)
           
 URI getURI(URI property)
           
 ValueFactory getValueFactory()
          Get a ValueFactory with which RDF2Go datatype instances can be made.
 boolean isDisposed()
          Returns whether this RDFContainerImpl has been disposed.
 boolean isModelShared()
          Returns whether the wrapped Model is shared with other RDFContainerImpls.
 void put(URI property, boolean value)
           
 void put(URI property, Calendar value)
           
 void put(URI property, Date value)
           
 void put(URI property, int value)
           
 void put(URI property, long value)
           
 void put(URI property, Node value)
           
 void put(URI property, String value)
           
 void remove(Statement statement)
           
 void remove(URI property)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RDFContainerImpl

public RDFContainerImpl(Model model,
                        String describedUri)
Create a new RDFContainerImpl that will manage statements concerning the specified URI.

Parameters:
model - A non-shared Model to store statements in and retrieve statements from.
describedUri - The URI that typically will serve as subject in most statements.

RDFContainerImpl

public RDFContainerImpl(Model model,
                        URI describedUri)
Create a new RDFContainerImpl that will manage statements concerning the specified URI.

Parameters:
model - A non-shared Model to store statements in and retrieve statements from.
describedUri - The URI that typically will serve as subject in most statements.

RDFContainerImpl

public RDFContainerImpl(Model model,
                        URI describedUri,
                        boolean modelShared)
Create a new RDFContainerImpl that will manage statements concerning the specified URI.

Parameters:
model - A Model to store statements in and retrieve statements from.
describedUri - The URI that typically will serve as subject in most statements.
modelShared - Indicates if the specified Model is shared with other RDFContainerImpls. When set to 'false', the model will be closed when this container is disposed.

RDFContainerImpl

public RDFContainerImpl(Model model,
                        String describedUri,
                        boolean modelShared)
Create a new RDFContainerImpl that will manage statements concerning the specified URI.

Parameters:
model - A Model to store statements in and retrieve statements from.
describedUri - The URI that typically will serve as subject in most statements.
modelShared - Indicates if the specified Model is shared with other RDFContainerImpls. When set to 'false', the model will be closed when this container is disposed.
Method Detail

getDescribedUri

public URI getDescribedUri()
Description copied from interface: RDFContainer
Get the identifier of the resource that is described by the contents of this RDFContainer.

Specified by:
getDescribedUri in interface RDFContainer
Returns:
The URI of the described resource.

getModel

public Model getModel()
Description copied from interface: RDFContainer
Get the underlying RDF2Go model holding the RDF statements.

Specified by:
getModel in interface RDFContainer

put

public void put(URI property,
                String value)
Specified by:
put in interface RDFContainer

put

public void put(URI property,
                Date value)
Specified by:
put in interface RDFContainer

put

public void put(URI property,
                Calendar value)
Specified by:
put in interface RDFContainer

put

public void put(URI property,
                boolean value)
Specified by:
put in interface RDFContainer

put

public void put(URI property,
                int value)
Specified by:
put in interface RDFContainer

put

public void put(URI property,
                long value)
Specified by:
put in interface RDFContainer

put

public void put(URI property,
                Node value)
Specified by:
put in interface RDFContainer

add

public void add(URI property,
                String value)
Specified by:
add in interface RDFContainer

add

public void add(URI property,
                Date value)
Specified by:
add in interface RDFContainer

add

public void add(URI property,
                Calendar value)
Specified by:
add in interface RDFContainer

add

public void add(URI property,
                boolean value)
Specified by:
add in interface RDFContainer

add

public void add(URI property,
                int value)
Specified by:
add in interface RDFContainer

add

public void add(URI property,
                long value)
Specified by:
add in interface RDFContainer

add

public void add(URI property,
                Node node)
Specified by:
add in interface RDFContainer

getString

public String getString(URI property)
Specified by:
getString in interface RDFContainer

getDate

public Date getDate(URI property)
Specified by:
getDate in interface RDFContainer

getCalendar

public Calendar getCalendar(URI property)
Specified by:
getCalendar in interface RDFContainer

getBoolean

public Boolean getBoolean(URI property)
Specified by:
getBoolean in interface RDFContainer

getInteger

public Integer getInteger(URI property)
Specified by:
getInteger in interface RDFContainer

getLong

public Long getLong(URI property)
Specified by:
getLong in interface RDFContainer

getURI

public URI getURI(URI property)
Specified by:
getURI in interface RDFContainer

getNode

public Node getNode(URI property)
Specified by:
getNode in interface RDFContainer

remove

public void remove(URI property)
Specified by:
remove in interface RDFContainer

getAll

public Collection getAll(URI property)
Specified by:
getAll in interface RDFContainer

add

public void add(Statement statement)
Specified by:
add in interface RDFContainer

remove

public void remove(Statement statement)
Specified by:
remove in interface RDFContainer

getValueFactory

public ValueFactory getValueFactory()
Description copied from interface: RDFContainer
Get a ValueFactory with which RDF2Go datatype instances can be made.

Specified by:
getValueFactory in interface RDFContainer

dispose

public void dispose()
Disposes this RDFContainerImpl. When the Model shared flag is set toResults of invoking any methods after disposal is undefined.

Specified by:
dispose in interface RDFContainer

isDisposed

public boolean isDisposed()
Returns whether this RDFContainerImpl has been disposed.


isModelShared

public boolean isModelShared()
Returns whether the wrapped Model is shared with other RDFContainerImpls.



Copyright © 2010 Aperture Development Team. All Rights Reserved.