java.lang.Object
eu.sealsproject.platform.res.tool.impl.AbstractPlugin
de.uni_mannheim.informatik.dws.melt.matching_base.MatcherURL
de.uni_mannheim.informatik.dws.melt.matching_base.external.http.MatcherHTTPCall
All Implemented Interfaces:
IMatcher<URL,​URL,​URL>, eu.sealsproject.platform.res.domain.omt.IOntologyMatchingToolBridge, eu.sealsproject.platform.res.tool.api.IPlugin, eu.sealsproject.platform.res.tool.api.IToolBridge

public class MatcherHTTPCall
extends MatcherURL
implements IMatcher<URL,​URL,​URL>
This class wraps a matcher service.
  • Field Summary

    Fields
    Modifier and Type Field Description
    static boolean CHECK_URL  
    private static org.apache.http.impl.client.CloseableHttpClient httpClient  
    private static org.slf4j.Logger LOGGER  
    private int maxTrials
    The number of retry operations to perform when an exception occurs.
    private org.apache.http.client.config.RequestConfig requestConfig
    The RequestConfig which contains timeouts to be used in http call.
    private boolean sendContent
    If true, then the content of the file URI is read and transferred.
    private int sleepTimeInSeconds
    The amount of seconds to sleep when an exception occurred before retrying.
    private URI uri
    URI where the matching service is located.
  • Constructor Summary

    Constructors
    Constructor Description
    MatcherHTTPCall​(String uri)
    Creates a matcher which wraps a matching service available at the given URI.Only the URIs of the test case are transferred to the system and no timeout is applied.
    MatcherHTTPCall​(URI uri)
    Creates a matcher which wraps a matching service available at the given URI.
    MatcherHTTPCall​(URI uri, boolean sendContent)
    Creates a matcher which wraps a matching service available at the given URI.
    MatcherHTTPCall​(URI uri, boolean sendContent, int socketTimeout, int connectTimeout, int connectionRequestTimeout)
    Creates a matcher which wraps a matching service available at the given URI with timeout options.
  • Method Summary

    Modifier and Type Method Description
    int getMaxTrials()  
    int getSleepTimeInSeconds()  
    boolean isSendContent()  
    URL match​(URL source, URL target, URL inputAlignment)
    Match two ontologies / knowledge graphs together and returns an alignment.
    URL match​(URL source, URL target, URL inputAlignment, URL parameters)
    Aligns two ontologies/knowledge graphs given as the first and second parameter.
    void setMaxTrials​(int maxTrials)  
    void setSendContent​(boolean sendContent)
    If true, then the content of the file URI is read and transferred.
    void setSleepTimeInSeconds​(int sleepTimeInSeconds)  
    void setTimeout​(int timeout)  
    void setTimeout​(int socketTimeout, int connectTimeout, int connectionRequestTimeout)  

    Methods inherited from class de.uni_mannheim.informatik.dws.melt.matching_base.MatcherURL

    align, align, canExecute, getType

    Methods inherited from class eu.sealsproject.platform.res.tool.impl.AbstractPlugin

    getId, getVersion, setId, setVersion

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface eu.sealsproject.platform.res.tool.api.IPlugin

    getId, getVersion
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • httpClient

      private static org.apache.http.impl.client.CloseableHttpClient httpClient
    • CHECK_URL

      public static boolean CHECK_URL
    • maxTrials

      private int maxTrials
      The number of retry operations to perform when an exception occurs.
    • sleepTimeInSeconds

      private int sleepTimeInSeconds
      The amount of seconds to sleep when an exception occurred before retrying.
    • uri

      private URI uri
      URI where the matching service is located.
    • sendContent

      private boolean sendContent
      If true, then the content of the file URI is read and transferred. If false, then only the URI is transferred but then the matching system needs to have access to the URI.
    • requestConfig

      private org.apache.http.client.config.RequestConfig requestConfig
      The RequestConfig which contains timeouts to be used in http call.
  • Constructor Details

    • MatcherHTTPCall

      public MatcherHTTPCall​(URI uri, boolean sendContent, int socketTimeout, int connectTimeout, int connectionRequestTimeout)
      Creates a matcher which wraps a matching service available at the given URI with timeout options.
      Parameters:
      uri - URI where the matching service is located. URI can be created from string with URI.create(java.lang.String).
      sendContent - If true, then the content of the file URI is read and transferred. If false, then only the URI is tranferred but then the matching system needs to have access to the URI.
      socketTimeout - the time in milliseconds waiting for data – after the connection is established; maximum time between two data packets. Zero means infinite timeout. Negative usually means systems default.
      connectTimeout - the timeout in milliseconds until a connection is established. Zero means infinite timeout. Negative usually means systems default.
      connectionRequestTimeout - timeout in milliseconds when requesting a connection from the connection manager. Zero means infinite timeout. Negative usually means systems default.
    • MatcherHTTPCall

      public MatcherHTTPCall​(URI uri, boolean sendContent)
      Creates a matcher which wraps a matching service available at the given URI. No timeout is applied.
      Parameters:
      uri - URI where the matching service is located. URI can be created from string with URI.create(java.lang.String).
      sendContent - If true, then the content of the file URI is read and transferred. If false, then only the URI is transferred but then the matching system needs to have access to the URI.
    • MatcherHTTPCall

      public MatcherHTTPCall​(URI uri)
      Creates a matcher which wraps a matching service available at the given URI. Only the URIs of the test case are transferred to the system and no timeout is applied.
      Parameters:
      uri - URI where the matching service is located. URI can be created from string with URI.create(java.lang.String).
    • MatcherHTTPCall

      public MatcherHTTPCall​(String uri) throws URISyntaxException
      Creates a matcher which wraps a matching service available at the given URI.Only the URIs of the test case are transferred to the system and no timeout is applied.
      Parameters:
      uri - URI where the matching service is located as string.
      Throws:
      URISyntaxException - in case the given URI is not parsable
  • Method Details

    • match

      public URL match​(URL source, URL target, URL inputAlignment) throws Exception
      Description copied from class: MatcherURL
      Match two ontologies / knowledge graphs together and returns an alignment.
      Specified by:
      match in class MatcherURL
      Parameters:
      source - The source ontology / knowledge graph
      target - The target ontology / knowledge graph
      inputAlignment - The input alignment as URL (alignment API format)
      Returns:
      An alignment as URL (most often as file URL) the format is again the alignment API format.
      Throws:
      Exception - in case something went wrong.
    • match

      public URL match​(URL source, URL target, URL inputAlignment, URL parameters) throws Exception
      Description copied from interface: IMatcher
      Aligns two ontologies/knowledge graphs given as the first and second parameter. An additional input alignment can be given as well as parameters which further define how and what to match. In case inputAlignment or parameters is not used, making them to the Object class, will required no additional transformations of these objects (no overhead).
      Specified by:
      match in interface IMatcher<URL,​URL,​URL>
      Parameters:
      source - this object represents the source ontology/knowledge graph
      target - this object represents the target ontology/knowledge graph
      inputAlignment - this object represents the input alignment.
      parameters - object representing additional parameters. Only add to this object and do not create a new Object like parameters= new ...() because otherwise the parameters are lost (java ist call by value). Sensible classes are Properties (preferred), Map<String, Object> or any similar data structure. Some already specified keys (strings) can be found at ParameterConfigKeys.
      Returns:
      the resulting alignment of the matching process.
      Throws:
      Exception - any exception which occurs during matching
    • setTimeout

      public void setTimeout​(int socketTimeout, int connectTimeout, int connectionRequestTimeout)
    • setTimeout

      public void setTimeout​(int timeout)
    • setSendContent

      public void setSendContent​(boolean sendContent)
      If true, then the content of the file URI is read and transferred. If false, then only the URI is tranferred but then the matching system needs to have access to the URI.
      Parameters:
      sendContent - the choise if the whole content is send or not.
    • isSendContent

      public boolean isSendContent()
    • getMaxTrials

      public int getMaxTrials()
    • setMaxTrials

      public void setMaxTrials​(int maxTrials)
    • getSleepTimeInSeconds

      public int getSleepTimeInSeconds()
    • setSleepTimeInSeconds

      public void setSleepTimeInSeconds​(int sleepTimeInSeconds)