Class DatasetIDExtractorUrlPrefixMap

java.lang.Object
de.uni_mannheim.informatik.dws.melt.matching_base.multisource.DatasetIDExtractorUrlPrefixMap
All Implemented Interfaces:
DatasetIDExtractor

public class DatasetIDExtractorUrlPrefixMap extends Object implements DatasetIDExtractor
Extracts the dataset id given a map of URL prefixes and corresponding dataset ID. The prefix is case dependent and have to be a the start of the url (be sure to include e.g. http://).
  • Field Details

  • Constructor Details

    • DatasetIDExtractorUrlPrefixMap

      public DatasetIDExtractorUrlPrefixMap(Map<String,String> prefixMap)
      Needs the map of prefix to datasetid
      Parameters:
      prefixMap - map of prefix to dataset id.
    • DatasetIDExtractorUrlPrefixMap

      public DatasetIDExtractorUrlPrefixMap(String... prefixesAndIds)
      Needs the prefix and dataset id in the given order. Meaning: prefix1, id1, prefix2, id2 etc. Throws IllegalArgumentException in case the number of arguments is odd.
      Parameters:
      prefixesAndIds - prefix and dataset ids in an order
  • Method Details

    • getDatasetID

      public String getDatasetID(String uri)
      Description copied from interface: DatasetIDExtractor
      Extracts from an URI the corresponding source / dataset identifier (which needs to be included in the URI like a specific domain etc).
      Specified by:
      getDatasetID in interface DatasetIDExtractor
      Parameters:
      uri - the uri which should contain any dataset specific component which is extracted.
      Returns:
      the dataset identifier as string