|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.fuberlin.wiwiss.d2rq.map.LiteralMaker
LiteralMakers transform attribute values from a result set into literals.
History:
06-21-2004: Initial version of this class.
08-03-2004: Extended with couldFit, getColumns, getColumnValues
Field Summary | |
private com.hp.hpl.jena.datatypes.RDFDatatype |
datatype
|
private java.lang.String |
id
|
private java.lang.String |
lang
|
private ValueSource |
valueSource
|
Constructor Summary | |
LiteralMaker(java.lang.String id,
ValueSource valueSource,
com.hp.hpl.jena.datatypes.RDFDatatype datatype,
java.lang.String lang)
|
Method Summary | |
private boolean |
areCompatibleDatatypes(com.hp.hpl.jena.datatypes.RDFDatatype dt1,
com.hp.hpl.jena.datatypes.RDFDatatype dt2)
|
private boolean |
areCompatibleLanguages(java.lang.String lang1,
java.lang.String lang2)
|
java.lang.Object |
clone()
Make a shallow copy of this . |
boolean |
couldFit(com.hp.hpl.jena.graph.Node node)
Checks if a node could fit this NodeMaker without querying the database. |
java.util.Set |
getColumns()
Returns a set of all columns containing data necessary for this NodeMaker to build its nodes. |
java.util.Map |
getColumnValues(com.hp.hpl.jena.graph.Node node)
Returns a map of database fields and values corresponding to the argument node. |
com.hp.hpl.jena.graph.Node |
getNode(java.lang.String[] row,
java.util.Map columnNameNumberMap)
Creates a new Node from a database result row. |
void |
matchConstraint(NodeConstraint c)
Adds constraint information to a NodeConstraint . |
boolean |
matchesOtherLiteralMaker(LiteralMaker other)
|
void |
prefixTables(TablePrefixer prefixer)
Changes the fields in a newly created clone that are to be modified when making aliasses. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private ValueSource valueSource
private com.hp.hpl.jena.datatypes.RDFDatatype datatype
private java.lang.String lang
private java.lang.String id
Constructor Detail |
public LiteralMaker(java.lang.String id, ValueSource valueSource, com.hp.hpl.jena.datatypes.RDFDatatype datatype, java.lang.String lang)
Method Detail |
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
Prefixable
this
.
General advice: Do not overwrite clone().
prefixTables() works best with shallow copy which Object implements.
Issues: I have not found a (preferred) static equivalent of clone().
Since Objects clone() method is protected, we cannot just declare
Cloneable
, if we want to call clone() from outside of that
class hierarchy. Instead it must be public and implemented in each
Prefixable class by a call to super.clone().
clone
in interface Prefixable
java.lang.CloneNotSupportedException
public void prefixTables(TablePrefixer prefixer)
Prefixable
prefixTables
in interface Prefixable
prefixer
- does the actual prefixing of simple and complex types.public void matchConstraint(NodeConstraint c)
NodeMaker
NodeConstraint
.
In a RDQL query a shared variable generally corresponds to different
NodeMakers.
matchConstraint
in interface NodeMaker
c
- NodeConstraint
public boolean matchesOtherLiteralMaker(LiteralMaker other)
public boolean couldFit(com.hp.hpl.jena.graph.Node node)
NodeMaker
couldFit
in interface NodeMaker
public java.util.Set getColumns()
NodeMaker
getColumns
in interface NodeMaker
public java.util.Map getColumnValues(com.hp.hpl.jena.graph.Node node)
NodeMaker
For example, a NodeMaker that corresponds directly to a single DB column would return a single-entry map with that column as the key, and the DB value corresponding to the node as the value.
getColumnValues
in interface NodeMaker
node
- a concrete, non-null RDF node
Column
keys, and string values.public com.hp.hpl.jena.graph.Node getNode(java.lang.String[] row, java.util.Map columnNameNumberMap)
NodeMaker
getNode
in interface NodeMaker
row
- a database result rowcolumnNameNumberMap
- a map from Table.Column style column names
to Integers representing indices within the row array
private boolean areCompatibleDatatypes(com.hp.hpl.jena.datatypes.RDFDatatype dt1, com.hp.hpl.jena.datatypes.RDFDatatype dt2)
private boolean areCompatibleLanguages(java.lang.String lang1, java.lang.String lang2)
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |