net.java.rdf.sommer
Class Mapping
java.lang.Object
net.java.rdf.sommer.Mapping
- All Implemented Interfaces:
- Mapper, RDFFactory, RewriteMapper
- Direct Known Subclasses:
- SesameMapper
public abstract class Mapping
- extends java.lang.Object
- implements Mapper, RewriteMapper, RDFFactory
Classes that implement a Mapper need to implement this interface
- Author:
- Henry Story
Nested classes/interfaces inherited from interface net.java.rdf.sommer.Mapper |
Mapper.Init |
Field Summary |
(package private) static java.util.HashMap<java.lang.String,java.util.List<java.lang.Class>> |
classmap
|
Method Summary |
void |
cogitate(java.util.List<Inferencer> inferenceList)
run the inferencers on this graph one after the other |
(package private) java.lang.Class |
mostSpecificSubClass(java.lang.Class clazz,
java.util.ArrayList<java.lang.String> typeUris)
return the most specific subclass of clazz that is mapped to one of the given rdf types
we assume that we don't have two subclasses of clazz that are associated with the same
rdf type. |
void |
preload(java.lang.Class... classes)
Sometimes one needs to preload a bunch of annotated classes in order to take account of hierarchies. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.java.rdf.sommer.Mapper |
addObject, addObjects, addStatements, clear, createObjectWithId, enableInferencing, equals, getAllObjectsOfType, getClassesOf, getObjectById, graphId, importFrom, importInto, isInferencingEnabled, isMapped, output, output, queryByExample, remove, removeStatements, size, unmap |
classmap
static final java.util.HashMap<java.lang.String,java.util.List<java.lang.Class>> classmap
Mapping
public Mapping()
preload
public void preload(java.lang.Class... classes)
- Description copied from interface:
Mapper
- Sometimes one needs to preload a bunch of annotated classes in order to take account of hierarchies.
We want to be able to have the most specific java class possible instantiate an rdf object. But we cannot walk
down a java class hierarchy.
see Mapping.mostSpecific(clazz,uri);
- Specified by:
preload
in interface Mapper
mostSpecificSubClass
java.lang.Class mostSpecificSubClass(java.lang.Class clazz,
java.util.ArrayList<java.lang.String> typeUris)
- return the most specific subclass of clazz that is mapped to one of the given rdf types
we assume that we don't have two subclasses of
clazz
that are associated with the same
rdf type. If this is not the case then the returned class will be randomly selected from one of the available
ones. We also have to assume that the types given in rdf map to exclusive java classes. So the collection of typeUris
should not be associated with classes in distinct classes in the java class hierarchy. Because there is no clear way to
decide which one should be returned.
see the thread on sommer.dev.java.net written over the weekend of 10 Dec 2006
mhh: problem: if an object
- Parameters:
clazz
- typeUris
-
- Returns:
- a subclass of clazz or clazz itself
cogitate
public void cogitate(java.util.List<Inferencer> inferenceList)
- Description copied from interface:
Mapper
- run the inferencers on this graph one after the other
- Specified by:
cogitate
in interface Mapper