Skip to content

DatatypeInsideOntop

skomlaebri edited this page Nov 6, 2014 · 7 revisions

Datatype handling inside Ontop

Note that this page is only intended for ontop developers

Datatypes inside ontop:

  • SQL data type (DB and mappings) x #DBs,

  • java.sql.jdbc.Types

  • XSD data types (for Datalog) ans1(xsd:int(x))

  • COL_TYPE (used for the signature of the Predicate)

  • CODE (for SQL generation)

  • OWL Datatype (for OWLAPI)

  • Sesame Datatype (for SESAME API)

  • SQL CAST (for SQL Generation, in particular for aggregations)

Datatype conversions:

  • OWL datatype -> COL_TYPE
OWLAPI3Translator
		private static Predicate.COL_TYPE getColumnType(OWLDatatype datatype) throws TranslationException 
  • XSD type -> CODE
	SQLGenerator
	private String getTypeColumnForSELECT(Term ht, List<String> signature, int hpos) 
  • XSD type -> jdbc Type
	SQLGenerator
	private int getVariableDataType (Term term, QueryAliasIndex idx) 
  • CODE -> COL_TYPE
QuestResultset
	private COL_TYPE getQuestType(int sqltype) 
  • COL_TYPE -> string
JDBCUtil 
	public String getSQLLexicalForm(ValueConstant constant)
  • jdbc Types -> XSD type
 TypeMapper
***we return the most general XSD datatype from database SQL type in metadata ***
  • jdbc Types -> XSD type (use TypeMapper)
MappingDatatypeRepair 
     private Predicate getDataTypeFunctor(Map<String, List<Object[]>> termOccurenceIndex, Variable variable) throws OBDAException 
Clone this wiki locally