Commit a1608dc7 authored by DanFaria's avatar DanFaria
Browse files

Updated SizeCategory to differentiate entity types

parent f006734e
...@@ -111,7 +111,9 @@ public class AML ...@@ -111,7 +111,9 @@ public class AML
private Set<Integer> targetIndividualsToMatch; private Set<Integer> targetIndividualsToMatch;
private InstanceMatchingCategory inst; private InstanceMatchingCategory inst;
private LanguageSetting lang; private LanguageSetting lang;
private SizeCategory size; private SizeCategory classSize;
private SizeCategory propSize;
private SizeCategory indivSize;
private Set<String> languages; private Set<String> languages;
private SelectionType sType; private SelectionType sType;
//Manual matching settings //Manual matching settings
...@@ -257,18 +259,14 @@ public class AML ...@@ -257,18 +259,14 @@ public class AML
matchClasses = false; matchClasses = false;
matchProperties = false; matchProperties = false;
} }
else if(sourceRatio > 1 && targetRatio > 1)
{
matchClasses = false;
matchProperties = false;
}
sourceIndividualsToMatch = source.getEntities(EntityType.INDIVIDUAL); sourceIndividualsToMatch = source.getEntities(EntityType.INDIVIDUAL);
targetIndividualsToMatch = target.getEntities(EntityType.INDIVIDUAL); targetIndividualsToMatch = target.getEntities(EntityType.INDIVIDUAL);
} }
size = SizeCategory.getSizeCategory(); classSize = SizeCategory.getSizeCategory(source.count(EntityType.CLASS), target.count(EntityType.CLASS));
if(size.equals(SizeCategory.HUGE)) propSize = SizeCategory.getSizeCategory(source.count(EntityType.DATA)+source.count(EntityType.OBJECT), target.count(EntityType.DATA)+target.count(EntityType.OBJECT));
threshold = 0.7; indivSize = SizeCategory.getSizeCategory(source.count(EntityType.INDIVIDUAL), target.count(EntityType.INDIVIDUAL));
lang = LanguageSetting.getLanguageSetting(); lang = LanguageSetting.getLanguageSetting();
languages = new HashSet<String>(); languages = new HashSet<String>();
for(String s : source.getLexicon().getLanguages()) for(String s : source.getLexicon().getLanguages())
...@@ -283,7 +281,7 @@ public class AML ...@@ -283,7 +281,7 @@ public class AML
nss = NeighborSimilarityStrategy.DESCENDANTS; nss = NeighborSimilarityStrategy.DESCENDANTS;
directNeighbors = false; directNeighbors = false;
sType = SelectionType.getSelectionType(); sType = SelectionType.getSelectionType();
structuralSelection = size.equals(SizeCategory.HUGE); structuralSelection = classSize.equals(SizeCategory.HUGE);
flagSteps = new Vector<Problem>(); flagSteps = new Vector<Problem>();
for(Problem f : Problem.values()) for(Problem f : Problem.values())
flagSteps.add(f); flagSteps.add(f);
...@@ -554,11 +552,27 @@ public class AML ...@@ -554,11 +552,27 @@ public class AML
} }
/** /**
* @return the SizeCategory of the current ontology pair * @return the SizeCategory of the classes in the current ontology pair
*/
public SizeCategory getSizeClasses()
{
return classSize;
}
/**
* @return the SizeCategory of the properties in the current ontology pair
*/
public SizeCategory getSizeProperties()
{
return propSize;
}
/**
* @return the SizeCategory of the individuals in the current ontology pair
*/ */
public SizeCategory getSizeCategory() public SizeCategory getSizeIndividuals()
{ {
return size; return indivSize;
} }
/** /**
......
...@@ -47,7 +47,7 @@ public class StopWordExtender implements LexiconExtender ...@@ -47,7 +47,7 @@ public class StopWordExtender implements LexiconExtender
{ {
stopList = StopList.read(); stopList = StopList.read();
AML aml = AML.getInstance(); AML aml = AML.getInstance();
s = aml.getSizeCategory(); s = aml.getSizeClasses();
Lexicon source = aml.getSource().getLexicon(); Lexicon source = aml.getSource().getLexicon();
extend(source); extend(source);
Lexicon target = aml.getTarget().getLexicon(); Lexicon target = aml.getTarget().getLexicon();
......
...@@ -23,7 +23,6 @@ import aml.AML; ...@@ -23,7 +23,6 @@ import aml.AML;
import aml.match.Alignment; import aml.match.Alignment;
import aml.match.Mapping; import aml.match.Mapping;
import aml.settings.MappingStatus; import aml.settings.MappingStatus;
import aml.settings.SizeCategory;
import aml.util.InteractionManager; import aml.util.InteractionManager;
public class InteractiveFilterer implements Filterer public class InteractiveFilterer implements Filterer
...@@ -39,8 +38,6 @@ public class InteractiveFilterer implements Filterer ...@@ -39,8 +38,6 @@ public class InteractiveFilterer implements Filterer
private final double HIGH_THRESH = 0.7; private final double HIGH_THRESH = 0.7;
private final double AVERAGE_THRESH = 0.2; private final double AVERAGE_THRESH = 0.2;
private double lowThresh = 0.45; private double lowThresh = 0.45;
//Auxiliary variables
private SizeCategory size;
//Constructors //Constructors
...@@ -48,7 +45,6 @@ public class InteractiveFilterer implements Filterer ...@@ -48,7 +45,6 @@ public class InteractiveFilterer implements Filterer
{ {
aml = AML.getInstance(); aml = AML.getInstance();
im = aml.getInteractionManager(); im = aml.getInteractionManager();
size = aml.getSizeCategory();
a = aml.getAlignment(); a = aml.getAlignment();
qf = aml.buildQualityFlagger(); qf = aml.buildQualityFlagger();
} }
...@@ -70,7 +66,7 @@ public class InteractiveFilterer implements Filterer ...@@ -70,7 +66,7 @@ public class InteractiveFilterer implements Filterer
int consecutiveNegativeCount = 0; int consecutiveNegativeCount = 0;
boolean updated = false; boolean updated = false;
int consecutiveNegativeLimit; int consecutiveNegativeLimit;
if(size.equals(SizeCategory.SMALL) && size.equals(SizeCategory.MEDIUM)) if(a.size() < 10000)
consecutiveNegativeLimit = 5; consecutiveNegativeLimit = 5;
else else
consecutiveNegativeLimit = 10; consecutiveNegativeLimit = 10;
......
...@@ -53,7 +53,7 @@ public class QualityFlagger implements Flagger ...@@ -53,7 +53,7 @@ public class QualityFlagger implements Flagger
{ {
aml = AML.getInstance(); aml = AML.getInstance();
a = aml.getAlignment(); a = aml.getAlignment();
size = aml.getSizeCategory(); size = aml.getSizeClasses();
//Construct the list of auxiliary (re)matchers and alignments //Construct the list of auxiliary (re)matchers and alignments
auxMatchers = new Vector<String>(); auxMatchers = new Vector<String>();
auxAlignments = new Vector<Alignment>(); auxAlignments = new Vector<Alignment>();
......
...@@ -40,7 +40,7 @@ public enum SelectionType ...@@ -40,7 +40,7 @@ public enum SelectionType
public static SelectionType getSelectionType() public static SelectionType getSelectionType()
{ {
SizeCategory size = AML.getInstance().getSizeCategory(); SizeCategory size = AML.getInstance().getSizeClasses();
if(size.equals(SizeCategory.SMALL)) if(size.equals(SizeCategory.SMALL))
return SelectionType.STRICT; return SelectionType.STRICT;
else if(size.equals(SizeCategory.MEDIUM)) else if(size.equals(SizeCategory.MEDIUM))
......
...@@ -18,9 +18,6 @@ ...@@ -18,9 +18,6 @@
******************************************************************************/ ******************************************************************************/
package aml.settings; package aml.settings;
import aml.AML;
import aml.ontology.Ontology;
public enum SizeCategory public enum SizeCategory
{ {
SMALL, SMALL,
...@@ -34,15 +31,11 @@ public enum SizeCategory ...@@ -34,15 +31,11 @@ public enum SizeCategory
* Computes the size category of the matching problem * Computes the size category of the matching problem
* based on the number of classes of the input ontologies * based on the number of classes of the input ontologies
*/ */
public static SizeCategory getSizeCategory() public static SizeCategory getSizeCategory(int sourceEntities, int targetEntities)
{ {
Ontology source = AML.getInstance().getSource(); int max = Math.max(sourceEntities, targetEntities);
Ontology target = AML.getInstance().getTarget(); int min = Math.min(sourceEntities, targetEntities);
int sSize = source.count(); if(max > 60000 || min > 40000)
int tSize = target.count();
int max = Math.max(sSize, tSize);
int min = Math.min(sSize, tSize);
if(max > 60000 || (min > 30000 && sSize*tSize > 1000000000))
return HUGE; return HUGE;
else if(max > 5000) else if(max > 5000)
return LARGE; return LARGE;
......
...@@ -128,7 +128,7 @@ public class DetailedOptions extends JDialog implements ActionListener, ItemList ...@@ -128,7 +128,7 @@ public class DetailedOptions extends JDialog implements ActionListener, ItemList
string = new JComboBox<String>(measures); string = new JComboBox<String>(measures);
string.setSelectedItem(aml.getStringSimMeasure().toString()); string.setSelectedItem(aml.getStringSimMeasure().toString());
primaryString = new JCheckBox("Global Match"); primaryString = new JCheckBox("Global Match");
primaryString.setSelected(aml.getSizeCategory().equals(SizeCategory.SMALL)); primaryString.setSelected(aml.getSizeClasses().equals(SizeCategory.SMALL));
//Structural Matcher //Structural Matcher
Vector<String> strategies = new Vector<String>(5); Vector<String> strategies = new Vector<String>(5);
for(NeighborSimilarityStrategy ns : NeighborSimilarityStrategy.values()) for(NeighborSimilarityStrategy ns : NeighborSimilarityStrategy.values())
...@@ -144,7 +144,7 @@ public class DetailedOptions extends JDialog implements ActionListener, ItemList ...@@ -144,7 +144,7 @@ public class DetailedOptions extends JDialog implements ActionListener, ItemList
select = new JComboBox<String>(types); select = new JComboBox<String>(types);
select.setSelectedItem(aml.getSelectionType().toString()); select.setSelectedItem(aml.getSelectionType().toString());
structSelection = new JCheckBox("Structure-Based Selection"); structSelection = new JCheckBox("Structure-Based Selection");
structSelection.setSelected(aml.getSizeCategory().equals(SizeCategory.HUGE)); structSelection.setSelected(aml.getSizeClasses().equals(SizeCategory.HUGE));
//Options Panel //Options Panel
optionPanel = new JPanel(); optionPanel = new JPanel();
...@@ -268,7 +268,7 @@ public class DetailedOptions extends JDialog implements ActionListener, ItemList ...@@ -268,7 +268,7 @@ public class DetailedOptions extends JDialog implements ActionListener, ItemList
panel.add(p1); panel.add(p1);
JPanel p2 = new JPanel(); JPanel p2 = new JPanel();
p2.add(primaryString, BorderLayout.CENTER); p2.add(primaryString, BorderLayout.CENTER);
if(!aml.getSizeCategory().equals(SizeCategory.SMALL)) if(!aml.getSizeClasses().equals(SizeCategory.SMALL))
{ {
JLabel warning = new JLabel("Warning: quadratic time-complexity!"); JLabel warning = new JLabel("Warning: quadratic time-complexity!");
warning.setForeground(Color.RED); warning.setForeground(Color.RED);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment