Class ClusterUtil
java.lang.Object
de.uni_mannheim.informatik.dws.melt.matching_jena_matchers.multisource.clustering.ClusterUtil
Helper class for adding and filtering correspondences based on cluster assignments.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Alignment
addCorrespondencesMultiCluster
(Alignment alignment, Map<String, Set<T>> uriToClusterId) This function adds correspondences from the alignment where the source and target are in the same cluster.static <T> Alignment
removeCorrespondences
(Alignment alignment, Map<String, T> uriToClusterId) This function removes correspondences from the alignment where the two matched entities are not in the same cluster.static <T> Alignment
removeCorrespondencesMultiCluster
(Alignment alignment, Map<String, Set<T>> uriToClusterId) This function removes correspondences from the alignment where the two matched entities are not in the same cluster.
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER
-
-
Constructor Details
-
ClusterUtil
public ClusterUtil()
-
-
Method Details
-
addCorrespondencesMultiCluster
public static <T> Alignment addCorrespondencesMultiCluster(Alignment alignment, Map<String, Set<T>> uriToClusterId) This function adds correspondences from the alignment where the source and target are in the same cluster. It needs the mapping URI to set of cluster ids. The provided alignment is not modified.- Type Parameters:
T
- the type of the cluster ID- Parameters:
alignment
- the alignmenturiToClusterId
- the mapping from uri to set of cluster ids- Returns:
- the alignment with added correspondences
-
removeCorrespondences
public static <T> Alignment removeCorrespondences(Alignment alignment, Map<String, T> uriToClusterId) This function removes correspondences from the alignment where the two matched entities are not in the same cluster. It needs the mapping URI to cluster id. The provided alignment is not modified.- Type Parameters:
T
- the type of the cluster ID- Parameters:
alignment
- the alignemnt to filteruriToClusterId
- the mapping from uri to cluster id- Returns:
- the filtered alignment
-
removeCorrespondencesMultiCluster
public static <T> Alignment removeCorrespondencesMultiCluster(Alignment alignment, Map<String, Set<T>> uriToClusterId) This function removes correspondences from the alignment where the two matched entities are not in the same cluster. It needs the mapping URI to set of cluster ids. The provided alignment is not modified.- Type Parameters:
T
- the type of the cluster ID- Parameters:
alignment
- the alignemnt to filteruriToClusterId
- the mapping from uri to set of cluster ids- Returns:
- the filtered alignment
-