@Test public void testFullMatch() throws Exception { Set<Concept> source = Collections.singleton(kb.getConcept("con864995873")); Set<Concept> expected = new HashSet<Concept>(); expected.add(kb.getConcept("con1428646343")); expected.add(kb.getConcept("con864995873")); expected.add(kb.getConcept("con241744282")); expected.add(kb.getConcept("con1988815758")); expected.add(kb.getConcept("con1627111892")); expected.add(kb.getConcept("con1226699739")); assertEquals(expected, matchGraph.partialMatch(source, expected).getTargetElements()); }
@Override public MatchTable<Concept, Boolean> fullMatch(Set<Concept> source, Set<Concept> target) { MatchTable<Concept, Boolean> matchTable = new MatchTable<Concept, Boolean>(); for(Concept src : source){ Set<Concept> validTargets = new HashSet<Concept>(kb.getSuperclasses(src)); validTargets.add(src); validTargets.retainAll(target); for(Concept tg : validTargets){ matchTable.addMatch(src, tg, true); } } return matchTable; }
WSCKBMatchGraph extends AbstractMatchGraph<Concept, Boolean> { @Override public MatchTable<Concept, Boolean> fullMatch(Set<Concept> source, Set<Concept> target) { MatchTable<Concept, Boolean> matchTable = new MatchTable<Concept, Boolean>(); for(Concept src : source){ Set<Concept> validTargets = new HashSet<Concept>(kb.getSuperclasses(src)); validTargets.add(src); validTargets.retainAll(target); for(Concept tg : validTargets){ matchTable.addMatch(src, tg, true); } } return matchTable; } }
WSCKBMatchGraph extends AbstractMatchGraph<Concept, Boolean> { @Override public MatchTable<Concept, Boolean> fullMatch(Set<Concept> source, Set<Concept> target) { MatchTable<Concept, Boolean> matchTable = new MatchTable<Concept, Boolean>(); for(Concept src : source){ Set<Concept> validTargets = new HashSet<Concept>(kb.getSuperclasses(src)); validTargets.add(src); validTargets.retainAll(target); for(Concept tg : validTargets){ matchTable.addMatch(src, tg, true); } } return matchTable; } WSCKBMatchGraph(HierarchicalKnowledgeBase kb); }
WSCKBMatchGraph extends AbstractMatchGraph<Concept, Boolean> { @Override public MatchTable<Concept, Boolean> fullMatch(Set<Concept> source, Set<Concept> target) { MatchTable<Concept, Boolean> matchTable = new MatchTable<Concept, Boolean>(); for(Concept src : source){ Set<Concept> validTargets = new HashSet<Concept>(kb.getSuperclasses(src)); validTargets.add(src); validTargets.retainAll(target); for(Concept tg : validTargets){ matchTable.addMatch(src, tg, true); } } return matchTable; } WSCKBMatchGraph(HierarchicalKnowledgeBase kb); @Override Set<Concept> getElements(); @Override Map<Concept, Boolean> getTargetElementsMatchedBy(Concept source); @Override Map<Concept, Boolean> getSourceElementsThatMatch(Concept target); @Override MatchTable<Concept, Boolean> partialMatch(Set<Concept> source, Set<Concept> target); @Override MatchTable<Concept, Boolean> fullMatch(Set<Concept> source, Set<Concept> target); @Override Boolean match(Concept source, Concept target); }
WSCKBMatchGraph extends AbstractMatchGraph<Concept, Boolean> { @Override public MatchTable<Concept, Boolean> fullMatch(Set<Concept> source, Set<Concept> target) { MatchTable<Concept, Boolean> matchTable = new MatchTable<Concept, Boolean>(); for(Concept src : source){ Set<Concept> validTargets = new HashSet<Concept>(kb.getSuperclasses(src)); validTargets.add(src); validTargets.retainAll(target); for(Concept tg : validTargets){ matchTable.addMatch(src, tg, true); } } return matchTable; } WSCKBMatchGraph(HierarchicalKnowledgeBase kb); @Override Set<Concept> getElements(); @Override Map<Concept, Boolean> getTargetElementsMatchedBy(Concept source); @Override Map<Concept, Boolean> getSourceElementsThatMatch(Concept target); @Override MatchTable<Concept, Boolean> partialMatch(Set<Concept> source, Set<Concept> target); @Override MatchTable<Concept, Boolean> fullMatch(Set<Concept> source, Set<Concept> target); @Override Boolean match(Concept source, Concept target);  }