code: protected MappingAndDBMetadata convertPPMapping(SQLPPMapping ppMapping, Optional<RDBMetadata> optionalDBMetadata,
                                                    OBDASpecInput specInput,
                                                    Optional<Ontology> optionalOntology,
                                                    ExecutorRegistry executorRegistry)
              throws MetaMappingExpansionException, DBMetadataExtractionException, MappingOntologyMismatchException,
              InvalidMappingSourceQueriesException, UnknownDatatypeException {
  
  
          RDBMetadata dbMetadata = extractDBMetadata(ppMapping, optionalDBMetadata, specInput);
  
          log.debug("DB Metadata: \n{}", dbMetadata);
  
          log.debug(dbMetadata.printKeys());
  
          SQLPPMapping expandedPPMapping = expandPPMapping(ppMapping, settings, dbMetadata);
  
          // NB: may also add views in the DBMetadata (for non-understood SQL queries)
          MappingWithProvenance provMapping = ppMappingConverter.convert(expandedPPMapping, dbMetadata, executorRegistry);
          dbMetadata.freeze();
  
          MappingWithProvenance filledProvMapping = mappingDatatypeFiller.inferMissingDatatypes(provMapping, dbMetadata);
  
          MappingWithProvenance canonizedMapping = canonicalTransformer.transform(filledProvMapping);
  
          validateMapping(optionalOntology, canonizedMapping);
  
          return new MappingAndDBMetadataImpl(canonizedMapping.toRegularMapping(), dbMetadata);
      }
docs: Converts the PPMapping into a Mapping.
  <p>
  During the conversion, data types are inferred and mapping assertions are validated
  TODO: move this method to AbstractMappingExtractor