Class MatcherHTTPCall
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
This class wraps a matcher service.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic boolean
private static org.apache.http.impl.client.CloseableHttpClient
private static final org.slf4j.Logger
private int
The number of retry operations to perform when an exception occurs.private org.apache.http.client.config.RequestConfig
The RequestConfig which contains timeouts to be used in http call.private boolean
If true, then the content of the file URI is read and transferred.private int
The amount of seconds to sleep when an exception occurred before retrying.private URI
URI where the matching service is located. -
Constructor Summary
ConstructorsConstructorDescriptionMatcherHTTPCall
(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 TypeMethodDescriptionprivate String
getFileName
(String fullPath) int
int
boolean
Match two ontologies / knowledge graphs together and returns an alignment.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) toString()
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, 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 maxTrialsThe number of retry operations to perform when an exception occurs. -
sleepTimeInSeconds
private int sleepTimeInSecondsThe amount of seconds to sleep when an exception occurred before retrying. -
uri
URI where the matching service is located. -
sendContent
private boolean sendContentIf 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 requestConfigThe 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 withURI.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
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 withURI.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
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 withURI.create(java.lang.String)
.
-
MatcherHTTPCall
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
Description copied from class:MatcherURL
Match two ontologies / knowledge graphs together and returns an alignment.- Specified by:
match
in classMatcherURL
- Parameters:
source
- The source ontology / knowledge graphtarget
- The target ontology / knowledge graphinputAlignment
- 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
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 interfaceIMatcher<URL,
URL, URL> - Parameters:
source
- this object represents the source ontology/knowledge graphtarget
- this object represents the target ontology/knowledge graphinputAlignment
- this object represents the input alignment.parameters
- object representing additional parameters. Only add to this object and do not create a new Object likeparameters= new ...()
because otherwise the parameters are lost (java ist call by value). Sensible classes areProperties
(preferred),Map<String, Object>
or any similar data structure. Some already specified keys (strings) can be found atParameterConfigKeys
.- 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) -
getFileName
-
toString
-