Class FunctionGenerator
java.lang.Object
org.aksw.jenax.arq.functionbinder.FunctionGenerator
Class for generation of wrappers for Java methods that make them usable as
Functions in Jena's SPARQL engine.- Author:
- raven
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.aksw.commons.util.convert.ConverterRegistryDeclarations for mapping java types to jena internal types For example, jts.Geometry map by remapped to jena.GeometryWrapper The cardinality is 1:1 - one input type can only map to one jena typeprotected org.apache.jena.datatypes.TypeMapper -
Constructor Summary
ConstructorsConstructorDescriptionFunctionGenerator(org.apache.jena.datatypes.TypeMapper typeMapper, org.aksw.commons.util.convert.ConverterRegistry converterRegistry, Map<Class<?>, Class<?>> returnTypeMap) -
Method Summary
Modifier and TypeMethodDescriptionstatic org.aksw.commons.util.convert.ConvertFunctionRawcreateNodeValueMapper(Class<?> clz, org.aksw.commons.util.convert.ConverterRegistry converterRegistry, org.apache.jena.datatypes.TypeMapper typeMapper, Map<Class<?>, String> typeByClassOverrides) org.aksw.commons.util.convert.ConverterRegistryA map for declaring forced conversions from a given input type to a target type.org.aksw.commons.util.convert.ConvertFunctionRawgetPreConvert(Class<?> targetJavaType, Class<?> internalJavaType) org.apache.jena.datatypes.TypeMapperPendant counterpart to Guava's: Iterators.getNext(Iterators.filter(Arrays.asList(arr).iterator(), type), null)
-
Field Details
-
typeMapper
protected org.apache.jena.datatypes.TypeMapper typeMapper -
converterRegistry
protected org.aksw.commons.util.convert.ConverterRegistry converterRegistry -
javaToRdfTypeMap
Declarations for mapping java types to jena internal types For example, jts.Geometry map by remapped to jena.GeometryWrapper The cardinality is 1:1 - one input type can only map to one jena type -
typeByClassOverrides
-
-
Constructor Details
-
FunctionGenerator
public FunctionGenerator() -
FunctionGenerator
-
-
Method Details
-
getTypeByClassOverrides
-
getTypeMapper
public org.apache.jena.datatypes.TypeMapper getTypeMapper() -
getConverterRegistry
public org.aksw.commons.util.convert.ConverterRegistry getConverterRegistry() -
getJavaToRdfTypeMap
A map for declaring forced conversions from a given input type to a target type. These conversions are applied before consulting jena's TypeMapper. If the target type is a sub-class ofNodethen the type mapper is not consulted because in that case the resulting type is already RDF.- Returns:
- The map of forced conversions.
-
getPreConvert
-
wrap
-
wrap
Pendant counterpart to Guava's: Iterators.getNext(Iterators.filter(Arrays.asList(arr).iterator(), type), null)- Type Parameters:
T-- Parameters:
arr-type-- Returns:
-
createNodeValueMapper
-