-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
macro average for specified number of test cases fixed
- Loading branch information
Showing
3 changed files
with
247 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
...uni_mannheim/informatik/dws/melt/matching_eval/evaluator/metric/cm/TestCaseWithModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package de.uni_mannheim.informatik.dws.melt.matching_eval.evaluator.metric.cm; | ||
|
||
import de.uni_mannheim.informatik.dws.melt.matching_data.GoldStandardCompleteness; | ||
import de.uni_mannheim.informatik.dws.melt.matching_data.TestCase; | ||
import de.uni_mannheim.informatik.dws.melt.matching_data.Track; | ||
import de.uni_mannheim.informatik.dws.melt.yet_another_alignment_api.Alignment; | ||
import java.util.Properties; | ||
import org.apache.jena.ontology.OntModel; | ||
|
||
public class TestCaseWithModel extends TestCase { | ||
private OntModel sourceModel; | ||
private OntModel targetModel; | ||
private Alignment referenceAlignment; | ||
public TestCaseWithModel(String name, OntModel source, OntModel target, Alignment reference, Track track, GoldStandardCompleteness goldStandardCompleteness) { | ||
super(name, null, null, null, track, null, goldStandardCompleteness, null, null); | ||
this.sourceModel = source; | ||
this.targetModel = target; | ||
this.referenceAlignment = reference; | ||
} | ||
|
||
@Override | ||
public <T> T getSourceOntology(Class<T> clazz){ | ||
return getSourceOntology(clazz, null); | ||
} | ||
@Override | ||
@SuppressWarnings("unchecked") | ||
public <T> T getSourceOntology(Class<T> clazz, Properties parameters){ | ||
if(clazz.equals(OntModel.class)){ | ||
return (T) sourceModel; | ||
}else{ | ||
throw new IllegalArgumentException("Wrong ontology type"); | ||
} | ||
} | ||
|
||
|
||
@Override | ||
public <T> T getTargetOntology(Class<T> clazz){ | ||
return getTargetOntology(clazz, null); | ||
} | ||
@Override | ||
@SuppressWarnings("unchecked") | ||
public <T> T getTargetOntology(Class<T> clazz, Properties parameters){ | ||
if(clazz.equals(OntModel.class)){ | ||
return (T) targetModel; | ||
}else{ | ||
throw new IllegalArgumentException("Wrong ontology type"); | ||
} | ||
} | ||
|
||
@Override | ||
public Alignment getParsedReferenceAlignment() { | ||
return referenceAlignment; | ||
} | ||
|
||
} |