code: public OntopRepository buildRepository() throws RepositoryConfigException {
          /*
           * Cache (computed only once)
           */
          if (repository != null)
              return repository;
  
          /*
           * Common validation.
           * May throw a RepositoryConfigException
           */
          validateFields();
  
          try {
              /*
               * Creates the repository according to the Quest type.
               */
              OntopSQLOWLAPIConfiguration.Builder configurationBuilder = OntopSQLOWLAPIConfiguration.defaultBuilder();
  
  
              if (!obdaFile.getName().endsWith(".obda")){
                  //probably an r2rml file
                  configurationBuilder.r2rmlMappingFile(obdaFile);
              }
              else {
                  configurationBuilder.nativeOntopMappingFile(obdaFile);
              }
  
              owlFile.ifPresent(configurationBuilder::ontologyFile);
  
              configurationBuilder
                      .propertyFile(propertiesFile);
  
              constraintFile.ifPresent(configurationBuilder::basicImplicitConstraintFile);
  
              repository = OntopRepository.defaultRepository(configurationBuilder.build());
  
          }
          /*
           * Problem during the repository instantiation.
           *   --> Exception is re-thrown as a RepositoryConfigException.
           */
          catch(Exception e)
          {   e.printStackTrace();
              throw new RepositoryConfigException("Could not create RDF4J Repository! Reason: " + e.getMessage());
          }
          return repository;
      }
docs: This method has two roles:
  - Validating in depth the configuration : basic field validation + consistency of
  the OWL and mapping files (the latter is done when initializing the repository).
  - Building the repository (as an ordinary factory).
  
  This method is usually called two times:
  - At validation time (see validate() ).
  - At the repository construction time (see OntopRepositoryFactory.getRepository() ).
  
  However, the repository is only build once and then kept in cache.