All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.carml.engine.sourceresolver.SourceResolver Maven / Gradle / Ivy

package io.carml.engine.sourceresolver;

import io.carml.model.FileSource;
import java.util.Optional;
import java.util.function.Function;

public interface SourceResolver extends Function> {

  default Optional unpackFileSource(Object source) {
    if (source instanceof String) { // Standard rml:source
      return Optional.of((String) source);
    } else if (source instanceof FileSource) { // Extended Carml source
      return Optional.of(((FileSource) source).getUrl());
    } else {
      return Optional.empty();
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy