|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Mapper
This is the interface the clients use to Map objects to a graph, (as well as remove them).
Nested Class Summary | |
---|---|
static interface |
Mapper.Init
Different RDF stores usually require very different initialisations. |
Method Summary | ||
---|---|---|
|
addObject(T object)
Insert the object and all its dependent objects into the graph |
|
boolean |
addObjects(java.lang.Object... objects)
Insert all objects |
|
void |
addStatements(java.util.Collection<Statement> statements)
Add the following statements to the writeable graph. |
|
boolean |
clear()
Delete this graph, and all objects associated to it. |
|
void |
cogitate(java.util.List<Inferencer> inferenceList)
run the inferencers on this graph one after the other |
|
|
createObjectWithId(java.lang.String uri,
java.lang.Class<T> clazz)
Create an object of type with a given uri |
|
void |
enableInferencing(boolean on)
|
|
boolean |
equals(java.lang.Object mapped1,
java.lang.Object mapped2)
Equality of mapped objects. |
|
|
getAllObjectsOfType(java.lang.Class<T> clazz)
|
|
java.util.List<java.lang.Class> |
getClassesOf(java.lang.String uri)
find the classes of the object with id uri |
|
|
getObjectById(java.lang.String uri,
java.lang.Class<T> clazz)
Fetch an object of type with a given uri. |
|
java.lang.String |
graphId()
|
|
void |
importFrom(java.io.Reader r,
java.lang.String baseUri,
java.lang.String mimeType)
Deprecated. one should have to specify the context one is importing stuff from. Right? |
|
void |
importInto(java.io.Reader r,
java.lang.String baseUri,
java.lang.String mimeType,
java.lang.String context)
import graph serialisation into the given context. |
|
boolean |
isInferencingEnabled()
|
|
boolean |
isMapped(java.lang.Object obj)
note: We should be able to ask the object directly now that it implements SommerMapable except of course that we are adding this directly |
|
void |
output(java.io.OutputStream out)
Output the contents of this graph todo: add type of output (N3,rdf/xml) |
|
void |
output(java.io.Writer out)
Output the contents of this graph todo: add type of output (N3,rdf/xml) |
|
void |
preload(java.lang.Class... classes)
Sometimes one needs to preload a bunch of annotated classes in order to take account of hierarchies. |
|
|
queryByExample(java.lang.Object eg,
java.lang.Class<T> clazz)
Query the map by giving an example object, and return all objects that fit the example. |
|
boolean |
remove(java.lang.Object obj)
remove all statements concerning the resource this object is mapped to. |
|
void |
removeStatements(java.util.Collection<Statement> statements)
remove the following statements from the graphs. |
|
long |
size()
The Size in triples of the graph, mapped to. |
|
boolean |
unmap(java.lang.Object obj)
This will remove the object from the map, but the relations will remain in the database. |
Method Detail |
---|
void enableInferencing(boolean on)
boolean isInferencingEnabled()
void importFrom(java.io.Reader r, java.lang.String baseUri, java.lang.String mimeType) throws java.io.IOException, GraphUpdateException, ParseException
r
- a Reader on the rdfbaseUri
- the base to resolve relative uri frommimeType
- of the rdf serialisation: rdfxml, n3, turtle, ntriples, ...
java.io.IOException
GraphUpdateException
ParseException
void importInto(java.io.Reader r, java.lang.String baseUri, java.lang.String mimeType, java.lang.String context) throws java.io.IOException, GraphUpdateException, ParseException
r
- the reader containing the serialisation of the graphbaseUri
- the base uri to xxx relative urismimeType
- format of the serialisation ( currently the mime type)context
- the context to drop the information into
java.io.IOException
GraphUpdateException
ParseException
boolean clear()
boolean isMapped(java.lang.Object obj)
obj
-
java.util.List<java.lang.Class> getClassesOf(java.lang.String uri)
uri
- the id of the object looked for
<T> T getObjectById(java.lang.String uri, java.lang.Class<T> clazz)
uri
- the id of the objectclazz
- the type of the object looked for
<T> T createObjectWithId(java.lang.String uri, java.lang.Class<T> clazz)
uri
- the id of the objectclazz
- the type of the object looked for
<T> java.util.Collection<T> getAllObjectsOfType(java.lang.Class<T> clazz)
<T> T addObject(T object)
object
- the object whose relations should be added to the graph
boolean addObjects(java.lang.Object... objects)
objects
-
void addStatements(java.util.Collection<Statement> statements)
statements
- void removeStatements(java.util.Collection<Statement> statements)
statements
- boolean remove(java.lang.Object obj)
obj
-
boolean unmap(java.lang.Object obj)
void output(java.io.OutputStream out)
void output(java.io.Writer out)
long size()
java.lang.String graphId()
boolean equals(java.lang.Object mapped1, java.lang.Object mapped2)
mapped1
- a mapped objectmapped2
- another mapped objects
<T> java.util.Collection<T> queryByExample(java.lang.Object eg, java.lang.Class<T> clazz)
eg
- example object. Should not be a mapped object
or an object with a id specified by @rdf URI id since otherwise the only object returneable would be
the one given. The object can have fields that are set either to mapped or unmapped objects.clazz
- of objects to return (should this not just be the same as the class of o?
void preload(java.lang.Class... classes)
void cogitate(java.util.List<Inferencer> inferenceList)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |