public class DatatypeSystemCustom extends Object implements TypeSystem
| Constructor and Description |
|---|
DatatypeSystemCustom(Map<String,String> typeToClass,
Map<String,String> typeToUri,
Map<String,String> typeHierarchy) |
| Modifier and Type | Method and Description |
|---|---|
com.hp.hpl.jena.sparql.expr.NodeValue |
cast(com.hp.hpl.jena.sparql.expr.NodeValue value,
TypeToken to) |
Factory1<SqlExpr> |
cast(TypeToken from,
TypeToken to)
Return a factory for creating cast-expressions between the given datatypes
Null if no such cast exists.
|
Integer |
compare(TypeToken a,
TypeToken b)
Returns -1, 0, 1 if a is more specific, equal, more general the b.
|
static DatatypeSystemCustom |
create(Map<String,String> typeToClass,
Map<String,String> typeToUri,
Map<String,String> typeHierarchy,
org.slf4j.Logger logger) |
SparqlFunctionImpl |
createSparqlFunction(String name,
SqlExprEvaluator evaluator) |
static Map<XMethod,TypeDistance[]> |
findMethodCandidates(Collection<XMethod> candidates,
org.aksw.sparqlify.core.datatypes.CoercionSystemOld coercions,
XClass... typeSignature) |
static Map<XMethod,Integer[]> |
findMethodCandidates(Collection<XMethod> candidates,
XClass... typeSignature) |
XClass |
getByClass(Class<?> clazz) |
XClass |
getByName(String name) |
XClass |
getByName(TypeToken name) |
List<TypeToken> |
getDirectSuperClasses(TypeToken typeToken) |
SparqlFunctionImpl |
getOrCreateSparqlFunction(String name) |
SparqlFunction |
getSparqlFunction(String name) |
TypeToken |
getTokenForClass(Class<?> clazz) |
boolean |
isSuperClassOf(TypeToken a,
TypeToken b) |
SqlMethodCandidate |
lookupMethod(Collection<XMethod> candidates,
List<TypeToken> argTypes) |
SqlMethodCandidate |
lookupMethod(String sparqlFunctionName,
List<TypeToken> argTypes) |
TypeToken |
mostGenericDatatype(TypeToken from,
TypeToken to)
Returns the top-most node of the tree of compatible datatypes
Hm, how to justify not returning object?
so integer and string -> numeric
string -> text
The rationale is, that all numeric types have similar semantics in regard
to comparison and arithmetic operations.
|
void |
registerCoercion(XMethod method) |
void |
registerSqlFunction(String sparqlFunctionName,
XMethod method) |
XClass |
requireByName(String name) |
Set<TypeToken> |
supremumDatatypes(TypeToken from,
TypeToken to) |
com.hp.hpl.jena.sparql.expr.NodeValue |
tryCast(com.hp.hpl.jena.sparql.expr.NodeValue nodeValue,
XClass targetType) |
public SparqlFunctionImpl createSparqlFunction(String name, SqlExprEvaluator evaluator)
createSparqlFunction in interface TypeSystempublic SparqlFunctionImpl getOrCreateSparqlFunction(String name)
public SparqlFunction getSparqlFunction(String name)
getSparqlFunction in interface TypeSystempublic void registerSqlFunction(String sparqlFunctionName, XMethod method)
registerSqlFunction in interface TypeSystempublic static Map<XMethod,TypeDistance[]> findMethodCandidates(Collection<XMethod> candidates, org.aksw.sparqlify.core.datatypes.CoercionSystemOld coercions, XClass... typeSignature)
public static Map<XMethod,Integer[]> findMethodCandidates(Collection<XMethod> candidates, XClass... typeSignature)
public SqlMethodCandidate lookupMethod(String sparqlFunctionName, List<TypeToken> argTypes)
lookupMethod in interface TypeSystempublic SqlMethodCandidate lookupMethod(Collection<XMethod> candidates, List<TypeToken> argTypes)
public List<TypeToken> getDirectSuperClasses(TypeToken typeToken)
getDirectSuperClasses in interface TypeSystempublic TypeToken getTokenForClass(Class<?> clazz)
getTokenForClass in interface TypeSystempublic XClass getByName(TypeToken name)
getByName in interface TypeSystempublic XClass getByName(String name)
getByName in interface TypeSystempublic XClass getByClass(Class<?> clazz)
getByClass in interface TypeSystempublic XClass requireByName(String name)
requireByName in interface TypeSystempublic com.hp.hpl.jena.sparql.expr.NodeValue cast(com.hp.hpl.jena.sparql.expr.NodeValue value,
TypeToken to)
cast in interface TypeSystempublic com.hp.hpl.jena.sparql.expr.NodeValue tryCast(com.hp.hpl.jena.sparql.expr.NodeValue nodeValue,
XClass targetType)
public Factory1<SqlExpr> cast(TypeToken from, TypeToken to)
TypeSystemcast in interface TypeSystempublic TypeToken mostGenericDatatype(TypeToken from, TypeToken to)
TypeSystemmostGenericDatatype in interface TypeSystempublic Set<TypeToken> supremumDatatypes(TypeToken from, TypeToken to)
supremumDatatypes in interface TypeSystempublic Integer compare(TypeToken a, TypeToken b)
TypeSystemcompare in interface TypeSystempublic static DatatypeSystemCustom create(Map<String,String> typeToClass, Map<String,String> typeToUri, Map<String,String> typeHierarchy, org.slf4j.Logger logger)
public boolean isSuperClassOf(TypeToken a, TypeToken b)
isSuperClassOf in interface TypeSystempublic void registerCoercion(XMethod method)
registerCoercion in interface TypeSystemCopyright © 2013. All Rights Reserved.