|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 |
---|
URI getDescribedUri()
Model getModel()
ValueFactory getValueFactory()
void dispose()
void put(URI property, String value) throws UpdateException
UpdateException
void put(URI property, Date value) throws UpdateException
UpdateException
void put(URI property, Calendar value) throws UpdateException
UpdateException
void put(URI property, boolean value) throws UpdateException
UpdateException
void put(URI property, int value) throws UpdateException
UpdateException
void put(URI property, long value) throws UpdateException
UpdateException
void put(URI property, Node value) throws UpdateException
UpdateException
void add(URI property, String value) throws UpdateException
UpdateException
void add(URI property, Date value) throws UpdateException
UpdateException
void add(URI property, Calendar value) throws UpdateException
UpdateException
void add(URI property, boolean value) throws UpdateException
UpdateException
void add(URI property, int value) throws UpdateException
UpdateException
void add(URI property, long value) throws UpdateException
UpdateException
void add(URI property, Node value) throws UpdateException
UpdateException
String getString(URI property)
Date getDate(URI property)
Calendar getCalendar(URI property)
Boolean getBoolean(URI property)
Integer getInteger(URI property)
Long getLong(URI property)
URI getURI(URI property)
Node getNode(URI property)
void remove(URI property) throws UpdateException
UpdateException
Collection getAll(URI property)
void add(Statement statement) throws UpdateException
UpdateException
void remove(Statement statement) throws UpdateException
UpdateException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |