/** * Basic interface for all DL-Learner knowledge sources. * * @author Jens Lehmann * */ @ComponentAnn(name = "Knowledge Sources", shortName = "ks", version = 0) public interface KnowledgeSource extends Component { }
@ComponentAnn(name = "Predictive Accuracy without Weak elimination", shortName = "pred_acc.ocel", version = 0) public class AccMethodPredAccOCEL implements AccMethodTwoValued, AccMethodNoWeakness { public AccMethodPredAccOCEL() { } public AccMethodPredAccOCEL(boolean init) { if (init) init(); } @Override public void init() { } @Override public double getAccOrTooWeak2(int tp, int fn, int fp, int tn, double noise) { int posExamples = tp + fn; int allExamples = posExamples + fp + tn; return Heuristics.divideOrZero( tp + tn, allExamples ); } }
@ComponentAnn(name = "Jaccard Coefficient", shortName = "jaccard", version = 0.1) public class AccMethodJaccard implements AccMethodTwoValued { public AccMethodJaccard() {} public AccMethodJaccard(boolean init) { if(init)init(); } @Override public void init() { } @Override public double getAccOrTooWeak2(int tp, int fn, int fp, int tn, double noise) { if(tp / (double) (tp+fn) <= 1 - noise) { return -1; } return Heuristics.getJaccardCoefficient(tp, tp + fn + fp); } }
@ComponentAnn(name = "PropertyAxiomLearningProblem", shortName = "palp", version = 0.6) public class PropertyAxiomLearningProblem<T extends OWLPropertyAxiom> extends AbstractLearningProblem<AxiomScore, T, EvaluatedAxiom<T>>{ private OWLProperty propertyToDescribe; @Override public void init() throws ComponentInitException { // TODO Auto-generated method stub throw new ComponentInitException("not implemented"); } @Override public AxiomScore computeScore(T hypothesis, double noise) { // TODO Auto-generated method stub return null; } @Override public double getAccuracyOrTooWeak(T hypothesis, double noise) { // TODO Auto-generated method stub return 0; } }
@ComponentAnn(name = "reflexive object property axiom learner", shortName = "oplrefl", version = 0.1, description="A learning algorithm for reflexive object property domain axioms.") public class ReflexiveObjectPropertyAxiomLearner extends ObjectPropertyCharacteristicsAxiomLearner<OWLReflexiveObjectPropertyAxiom> {
@ComponentAnn(name="symmetric object property axiom learner", shortName="oplsymm", version=0.1, description="A learning algorithm for symmetric object property axioms.") public class SymmetricObjectPropertyAxiomLearner extends ObjectPropertyCharacteristicsAxiomLearner<OWLSymmetricObjectPropertyAxiom> { public SymmetricObjectPropertyAxiomLearner(SparqlEndpointKS ks){ super(ks); super.posExamplesQueryTemplate = new ParameterizedSparqlString( "SELECT ?s ?o WHERE {?s ?p ?o . ?o ?p ?s .}"); super.negExamplesQueryTemplate = new ParameterizedSparqlString( "SELECT ?s ?o WHERE {?s ?p ?o . FILTER NOT EXISTS{?o ?p ?s .}"); super.POS_FREQUENCY_QUERY = new ParameterizedSparqlString( "SELECT (COUNT(*) AS ?cnt) WHERE {?s ?p ?o . ?o ?p ?s .}"); axiomType = AxiomType.SYMMETRIC_OBJECT_PROPERTY; } /* (non-Javadoc) * @see org.dllearner.algorithms.properties.ObjectPropertyCharacteristicsAxiomLearner#getAxiom(org.semanticweb.owlapi.model.OWLObjectProperty) */ @Override protected OWLSymmetricObjectPropertyAxiom getAxiom(OWLObjectProperty property) { return df.getOWLSymmetricObjectPropertyAxiom(property); } }
/** * * @author Giuseppe Cota <giuseppe.cota@unife.it>, Riccardo Zese * <riccardo.zese@unife.it> */ @ComponentAnn(name = "EDGEDistributedSingleStep", shortName = "edgesingle", version = 1.0) public class EDGEDistibutedSingleStep extends AbstractEDGEDistributed { public EDGEDistibutedSingleStep() { edge = new EDGEMPISingleStep(); } @Override public void init() throws ComponentInitException { super.init(); throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } @Override public void start() { throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. } }
@ComponentAnn(name = "irreflexive object property axiom learner", shortName = "oplirrefl", version = 0.1, description="A learning algorithm for irreflexive object property axioms.") public class IrreflexiveObjectPropertyAxiomLearner extends ObjectPropertyCharacteristicsAxiomLearner<OWLIrreflexiveObjectPropertyAxiom> { public IrreflexiveObjectPropertyAxiomLearner(SparqlEndpointKS ks) { super(ks); super.posExamplesQueryTemplate = new ParameterizedSparqlString( "SELECT DISTINCT ?s WHERE {?s ?p ?o . FILTER NOT EXISTS{?s ?p ?s .}}"); super.negExamplesQueryTemplate = new ParameterizedSparqlString( "SELECT DISTINCT ?s WHERE {?s ?p ?s .}"); super.POS_FREQUENCY_QUERY = new ParameterizedSparqlString( "SELECT (COUNT(DISTINCT(?s)) AS ?cnt) WHERE {?s ?p ?o . FILTER NOT EXISTS {?s ?p ?s .} }"); COUNT_QUERY = DISTINCT_SUBJECTS_COUNT_QUERY; axiomType = AxiomType.IRREFLEXIVE_OBJECT_PROPERTY; } /* (non-Javadoc) * @see org.dllearner.algorithms.properties.ObjectPropertyCharacteristicsAxiomLearner#getAxiom(org.semanticweb.owlapi.model.OWLObjectProperty) */ @Override protected OWLIrreflexiveObjectPropertyAxiom getAxiom(OWLObjectProperty property) { return df.getOWLIrreflexiveObjectPropertyAxiom(property); } }
@ComponentAnn(name = "DisjunctiveHeuristic", shortName = "disjunctive_heuristic", version = 0.1) public class DisjunctiveHeuristic implements ELHeuristic { ELDescriptionTreeComparator edt = new ELDescriptionTreeComparator(); @Override public int compare(SearchTreeNode tree1, SearchTreeNode tree2) { double diff = tree1.getScore().getAccuracy()-tree2.getScore().getAccuracy(); if(diff < 0.00001 && diff > -0.00001) { return edt.compare(tree1.getDescriptionTree(), tree2.getDescriptionTree()); } else if(diff > 0){ return 1; // return (int)Math.signum(diff); } else { return -1; } } /* (non-Javadoc) * @see org.dllearner.core.Component#init() */ @Override public void init() throws ComponentInitException { } }
/** * A stable comparator for search tree nodes. Stable means that the order * of nodes will not change during the run of the learning algorithm. In * this implementation, this is ensured by using only covered examples * and tree size as criteria. * * @author Jens Lehmann * */ @ComponentAnn(name = "Stable Heuristic", shortName = "el_heuristic", version = 0.1) public class StableHeuristic implements ELHeuristic { private final ELDescriptionTreeComparator cmp = new ELDescriptionTreeComparator(); @Override public int compare(SearchTreeNode o1, SearchTreeNode o2) { return ComparisonChain.start() .compare(o1.getScore().getAccuracy(), o2.getScore().getAccuracy()) .compare(o2.getDescriptionTree().size, o1.getDescriptionTree().size) .compare(o1.getDescriptionTree(), o2.getDescriptionTree(), cmp) .result(); } /* (non-Javadoc) * @see org.dllearner.core.Component#init() */ @Override public void init() throws ComponentInitException {} }
@ComponentAnn(name="data subproperty axiom learner", shortName="dplsubprop", version=0.1, description="A learning algorithm data subproperty axioms.") public class SubDataPropertyOfAxiomLearner extends DataPropertyHierarchyAxiomLearner<OWLSubDataPropertyOfAxiom> {
@ComponentAnn(name="equivalent data properties axiom learner", shortName="dplequiv", version=0.1, description="A learning algorithm for equivalent data properties axioms.") public class EquivalentDataPropertyAxiomLearner extends DataPropertyHierarchyAxiomLearner<OWLEquivalentDataPropertiesAxiom> {
@ComponentAnn(name="equivalent object properties axiom learner", shortName="oplequiv", version=0.1, description="A learning algorithm for equivalent object properties axioms.") public class EquivalentObjectPropertyAxiomLearner extends ObjectPropertyHierarchyAxiomLearner<OWLEquivalentObjectPropertiesAxiom> {
@ComponentAnn(name = "asymmetric object property axiom learner", shortName = "oplasymm", version = 0.1, description="A learning algorithm for asymmetric object property axioms.") public class AsymmetricObjectPropertyAxiomLearner extends ObjectPropertyCharacteristicsAxiomLearner<OWLAsymmetricObjectPropertyAxiom> {
@ComponentAnn(name="SemKernel Workflow", shortName="skw", version=0.1) public class SemKernelWorkflow extends AbstractComponent {
@ComponentAnn(name = "Generalised FMeasure", shortName = "gen_fmeasure", version = 0.1) public class AccMethodGenFMeasure implements AccMethodThreeValued, AccMethodWithBeta {
@ComponentAnn(name = "GLOBAL OPTIONS", version = 0, shortName = "") public abstract class GlobalDoc { // Implemented in: Class<PostProcessor> prefixesImpl = PostProcessor.class; @ConfigOption(description = "Mapping of prefixes to replace inside other configuration file entries", exampleValue = "[ (\"ex\",\"http://example.com/father#\") ]") Map<String,String> prefixes; // Implemented in: Class<ConfParserConfiguration> renderingImpl = ConfParserConfiguration.class; @ConfigOption(description = "The string renderer for any OWL expression output, can be \"dlsyntax\" or \"manchester\"", defaultValue = "manchester", exampleValue = "dlsyntax") String rendering; }
@ComponentAnn(name = "FMeasure", shortName = "fmeasure", version = 0) public class AccMethodFMeasure implements AccMethodTwoValued, AccMethodWithBeta {
@ComponentAnn(name = "Predictive Accuracy", shortName = "pred_acc", version = 0) public class AccMethodPredAcc implements AccMethodTwoValued, AccMethodWithBeta {
@ComponentAnn(name = "AMeasure", shortName = "ameasure", version = 0.1) public class AccMethodAMeasure implements Component, AccMethodTwoValued, AccMethodWithBeta {