org.semanticdesktop.aperture.rdf
Interface RDFContainer

All Known Implementing Classes:
RDFContainerImpl

public interface RDFContainer

RDFContainer defines a simple interface for RDF stores. Its purpose is to make populating an model as simple as possible for developers new to RDF and triple stores.

RDFContainers typically have a central URI called the "described URI". The semantics of this is that the content of the RDFContainer describes properties of this URI. All put methods in this interface implicitly use this URI as subject. Furthermore, they adhere to Map semantics as much as possible, e.g. invoking "put" a second time with the same property key overwrites any previously set value. When the underlying model contains multiple properties that have the same subject and property, a MultipleValuesException is thrown. Care therefore has to be taken when mixing use of the Map-like put and get properties with the triple-oriented add and get methods.

Putting a layer between the code generating the statements and the code that stores the statements provides an additional benefit: decisions on how Java types such as ints and Dates are transformed into RDF triples are now made in a single piece of code (the RDFContainer implementation), without requiring the populators of the RDF model to address this issue.


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 value)
           
 void add(URI property, String value)
           
 void dispose()
          State that this container won't be used anymore and it can perform any cleanup necessary.
 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.
 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)
           
 

Method Detail

getDescribedUri

URI getDescribedUri()
Get the identifier of the resource that is described by the contents of this RDFContainer.

Returns:
The URI of the described resource.

getModel

Model getModel()
Get the underlying RDF2Go model holding the RDF statements.


getValueFactory

ValueFactory getValueFactory()
Get a ValueFactory with which RDF2Go datatype instances can be made.


dispose

void dispose()
State that this container won't be used anymore and it can perform any cleanup necessary. Examples of actions taken by this method might include closing the connection to an underyling RDF store or freeing any system resources this particular implementation might own


put

void put(URI property,
         String value)
         throws UpdateException
Throws:
UpdateException

put

void put(URI property,
         Date value)
         throws UpdateException
Throws:
UpdateException

put

void put(URI property,
         Calendar value)
         throws UpdateException
Throws:
UpdateException

put

void put(URI property,
         boolean value)
         throws UpdateException
Throws:
UpdateException

put

void put(URI property,
         int value)
         throws UpdateException
Throws:
UpdateException

put

void put(URI property,
         long value)
         throws UpdateException
Throws:
UpdateException

put

void put(URI property,
         Node value)
         throws UpdateException
Throws:
UpdateException

add

void add(URI property,
         String value)
         throws UpdateException
Throws:
UpdateException

add

void add(URI property,
         Date value)
         throws UpdateException
Throws:
UpdateException

add

void add(URI property,
         Calendar value)
         throws UpdateException
Throws:
UpdateException

add

void add(URI property,
         boolean value)
         throws UpdateException
Throws:
UpdateException

add

void add(URI property,
         int value)
         throws UpdateException
Throws:
UpdateException

add

void add(URI property,
         long value)
         throws UpdateException
Throws:
UpdateException

add

void add(URI property,
         Node value)
         throws UpdateException
Throws:
UpdateException

getString

String getString(URI property)

getDate

Date getDate(URI property)

getCalendar

Calendar getCalendar(URI property)

getBoolean

Boolean getBoolean(URI property)

getInteger

Integer getInteger(URI property)

getLong

Long getLong(URI property)

getURI

URI getURI(URI property)

getNode

Node getNode(URI property)

remove

void remove(URI property)
            throws UpdateException
Throws:
UpdateException

getAll

Collection getAll(URI property)

add

void add(Statement statement)
         throws UpdateException
Throws:
UpdateException

remove

void remove(Statement statement)
            throws UpdateException
Throws:
UpdateException


Copyright © 2010 Aperture Development Team. All Rights Reserved.