diff --git a/born-owlapi/src/test/java/de/tudresden/inf/lat/born/owlapi/processor/ProblogProcessorTest.java b/born-owlapi/src/test/java/de/tudresden/inf/lat/born/owlapi/processor/ProblogProcessorTest.java new file mode 100644 index 00000000..1baf9efa --- /dev/null +++ b/born-owlapi/src/test/java/de/tudresden/inf/lat/born/owlapi/processor/ProblogProcessorTest.java @@ -0,0 +1,52 @@ +package de.tudresden.inf.lat.born.owlapi.processor; + + +import java.io.*; +import java.net.URISyntaxException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.stream.IntStream; + +import de.tudresden.inf.lat.jproblog.JProblog; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +/** + * Test class for ProblogProcessor. + * + * @author Julian Mendez + */ +public class ProblogProcessorTest { + + String INPUT_FOR_PROBLOG = "input_for_problog.txt"; + + String OUTPUT_FROM_PROBLOG = "output_from_problog.txt"; + + public String readFile(String fileName) { + try { + return new String(Files.readAllBytes(Paths.get((getClass().getResource(fileName).toURI())))); + } catch (IOException e) { + throw new UncheckedIOException(e); + } catch (URISyntaxException e) { + throw new RuntimeException(e); + } + + } + + /** + * This tests the example ontologies. + */ + @Test + public void testApply() { + ProcessorConfiguration conf = new ProcessorConfigurationImpl(); + JProblog queryProcessor = new JProblog(); + conf.setQueryProcessor(queryProcessor); + IntStream.range(0, 6).forEach(index -> { + String input = readFile(File.separator + index + File.separator + INPUT_FOR_PROBLOG); + String expected = readFile(File.separator + index + File.separator + OUTPUT_FROM_PROBLOG); + String obtained = conf.getQueryProcessor().apply(input); + Assertions.assertEquals(expected, obtained); + }); + } + +} diff --git a/born-owlapi/src/test/resources/0/input_for_problog.txt b/born-owlapi/src/test/resources/0/input_for_problog.txt new file mode 100644 index 00000000..0797e08a --- /dev/null +++ b/born-owlapi/src/test/resources/0/input_for_problog.txt @@ -0,0 +1,114 @@ + +%% EL completion rules + + + +% Rules to interpret the queries +sub(X, B) :- +con(X), +con(B), +subx(X, B). +inst(X, B) :- +indiv(X), +con(B), +subx(X, B). +inst(R, X, B) :- +role(R), +indiv(X), +indiv(B), +subx(X, exists(R, A)), +subx(A, B). + +% Rules to process individuals +coni(X) :- con(X). +coni(X) :- indiv(X). + +% Basic rules for the completion +subx(X, X) :- coni(X). +subx(X, top) :- coni(X). +subx(X, B) :- gci(X, B). + +% EL complettion rules +subx(X, B) :- +gci(A, B), +subx(X, A), +coni(X), +coni(A), +coni(B). +subx(X, B) :- +gci(and(A1, A2), B), +subx(X, A1), +subx(X, A2), +coni(X), +coni(A1), +coni(A2), +coni(B). +subx(X, exists(R, B)) :- +gci(A, exists(R, B)), +subx(X, A), +coni(X), +coni(A), +coni(B), +role(R). +subx(X, B) :- +gci(exists(R, A), B), +subx(X, exists(R, Y)), +subx(Y, A), +coni(X), +coni(Y), +coni(A), +coni(B), +role(R). + +% Rules to avoid empty predicates of entities +con(-). +role(-). +indiv(-). + + +%% Ontology + +con('https://lat.inf.tu-dresden.de/systems/born/born-example#c'). +con('https://lat.inf.tu-dresden.de/systems/born/born-example#d'). +con('https://lat.inf.tu-dresden.de/systems/born/born-example#e'). +con('https://lat.inf.tu-dresden.de/systems/born/born-example#a'). +con('https://lat.inf.tu-dresden.de/systems/born/born-example#b'). +role('https://lat.inf.tu-dresden.de/systems/born/born-example#r'). +role('https://lat.inf.tu-dresden.de/systems/born/born-example#s'). +gci('https://lat.inf.tu-dresden.de/systems/born/born-example#a', 'https://lat.inf.tu-dresden.de/systems/born/born-example#c') :- x4. +gci(and('https://lat.inf.tu-dresden.de/systems/born/born-example#c', 'https://lat.inf.tu-dresden.de/systems/born/born-example#d'), 'https://lat.inf.tu-dresden.de/systems/born/born-example#e') :- x5. +gci(exists('https://lat.inf.tu-dresden.de/systems/born/born-example#r', 'https://lat.inf.tu-dresden.de/systems/born/born-example#b'), 'https://lat.inf.tu-dresden.de/systems/born/born-example#d') :- \+x2. +gci('https://lat.inf.tu-dresden.de/systems/born/born-example#a', exists('https://lat.inf.tu-dresden.de/systems/born/born-example#r', 'https://lat.inf.tu-dresden.de/systems/born/born-example#b')) :- x0. +gci('https://lat.inf.tu-dresden.de/systems/born/born-example#b', exists('https://lat.inf.tu-dresden.de/systems/born/born-example#s', 'https://lat.inf.tu-dresden.de/systems/born/born-example#c')) :- \+x3. +gci('https://lat.inf.tu-dresden.de/systems/born/born-example#c', 'https://lat.inf.tu-dresden.de/systems/born/born-example#e') :- x3. + + +%% Bayesian Network + + +0.3::x0. +0.4::x1. +0.8::x2. +0.3::x3. +0.3::x4. +0.7::x5. +0.9::x6. +0.3::x7. +0.2::x8. +0.1::x9. +0.5::x10. +0.8::x11. +0.3::x12. +0.8::x13. +0.9::x14. +0.6::x15. +0.5::x16. + + +%% Queries + + +query(sub('https://lat.inf.tu-dresden.de/systems/born/born-example#a', 'https://lat.inf.tu-dresden.de/systems/born/born-example#e')). + + + diff --git a/born-owlapi/src/test/resources/0/output_from_problog.txt b/born-owlapi/src/test/resources/0/output_from_problog.txt new file mode 100644 index 00000000..0e237c85 --- /dev/null +++ b/born-owlapi/src/test/resources/0/output_from_problog.txt @@ -0,0 +1 @@ +sub('https://lat.inf.tu-dresden.de/systems/born/born-example#a','https://lat.inf.tu-dresden.de/systems/born/born-example#e'): 0.09882 diff --git a/born-owlapi/src/test/resources/1/input_for_problog.txt b/born-owlapi/src/test/resources/1/input_for_problog.txt new file mode 100644 index 00000000..0596b755 --- /dev/null +++ b/born-owlapi/src/test/resources/1/input_for_problog.txt @@ -0,0 +1,2526 @@ + +%% EL completion rules + + + +% Rules to interpret the queries +sub(X, B) :- +con(X), +con(B), +subx(X, B). +inst(X, B) :- +indiv(X), +con(B), +subx(X, B). +inst(R, X, B) :- +role(R), +indiv(X), +indiv(B), +subx(X, exists(R, A)), +subx(A, B). + +% Rules to process individuals +coni(X) :- con(X). +coni(X) :- indiv(X). + +% Basic rules for the completion +subx(X, X) :- coni(X). +subx(X, top) :- coni(X). +subx(X, B) :- gci(X, B). + +% EL complettion rules +subx(X, B) :- +gci(A, B), +subx(X, A), +coni(X), +coni(A), +coni(B). +subx(X, B) :- +gci(and(A1, A2), B), +subx(X, A1), +subx(X, A2), +coni(X), +coni(A1), +coni(A2), +coni(B). +subx(X, exists(R, B)) :- +gci(A, exists(R, B)), +subx(X, A), +coni(X), +coni(A), +coni(B), +role(R). +subx(X, B) :- +gci(exists(R, A), B), +subx(X, exists(R, Y)), +subx(Y, A), +coni(X), +coni(Y), +coni(A), +coni(B), +role(R). + +% Rules to avoid empty predicates of entities +con(-). +role(-). +indiv(-). + + +%% Ontology + +con('https://lat.inf.tu-dresden.de/systems/born/born-example#c'). +con('https://lat.inf.tu-dresden.de/systems/born/born-example#d'). +con('https://lat.inf.tu-dresden.de/systems/born/born-example#e'). +con('https://lat.inf.tu-dresden.de/systems/born/born-example#a'). +con('https://lat.inf.tu-dresden.de/systems/born/born-example#b'). +role('https://lat.inf.tu-dresden.de/systems/born/born-example#r'). +role('https://lat.inf.tu-dresden.de/systems/born/born-example#s'). +gci('https://lat.inf.tu-dresden.de/systems/born/born-example#a', 'https://lat.inf.tu-dresden.de/systems/born/born-example#c') :- x4. +gci('https://lat.inf.tu-dresden.de/systems/born/born-example#b', exists('https://lat.inf.tu-dresden.de/systems/born/born-example#s', 'https://lat.inf.tu-dresden.de/systems/born/born-example#c')) :- \+x3. +gci(and('https://lat.inf.tu-dresden.de/systems/born/born-example#c', 'https://lat.inf.tu-dresden.de/systems/born/born-example#d'), 'https://lat.inf.tu-dresden.de/systems/born/born-example#e') :- x5. +gci('https://lat.inf.tu-dresden.de/systems/born/born-example#a', exists('https://lat.inf.tu-dresden.de/systems/born/born-example#r', 'https://lat.inf.tu-dresden.de/systems/born/born-example#b')) :- x0. +gci(exists('https://lat.inf.tu-dresden.de/systems/born/born-example#r', 'https://lat.inf.tu-dresden.de/systems/born/born-example#b'), 'https://lat.inf.tu-dresden.de/systems/born/born-example#d') :- \+x2. +gci('https://lat.inf.tu-dresden.de/systems/born/born-example#c', 'https://lat.inf.tu-dresden.de/systems/born/born-example#e') :- x3. + + +%% Bayesian Network + + +0.25::x0. + +0.84::x1 :- x0. + +0.27::x1 :- \+x0. + +0.77::x2 :- + x0, + x1. + +0.77::x2 :- + \+x0, + x1. + +0.45::x2 :- + x0, + \+x1. + +0.12::x2 :- + \+x0, + \+x1. + +0.88::x3 :- + x1, + x2. + +0.72::x3 :- + \+x1, + x2. + +0.00::x3 :- + x1, + \+x2. + +0.99::x3 :- + \+x1, + \+x2. + +0.42::x4 :- + x0, + x2, + x3. + +0.30::x4 :- + \+x0, + x2, + x3. + +0.01::x4 :- + x0, + \+x2, + x3. + +0.94::x4 :- + \+x0, + \+x2, + x3. + +0.98::x4 :- + x0, + x2, + \+x3. + +0.82::x4 :- + \+x0, + x2, + \+x3. + +0.18::x4 :- + x0, + \+x2, + \+x3. + +0.69::x4 :- + \+x0, + \+x2, + \+x3. + +0.64::x5 :- + x0, + x2, + x3. + +0.63::x5 :- + \+x0, + x2, + x3. + +0.26::x5 :- + x0, + \+x2, + x3. + +0.79::x5 :- + \+x0, + \+x2, + x3. + +0.66::x5 :- + x0, + x2, + \+x3. + +0.03::x5 :- + \+x0, + x2, + \+x3. + +0.62::x5 :- + x0, + \+x2, + \+x3. + +0.56::x5 :- + \+x0, + \+x2, + \+x3. + +0.21::x6 :- + x0, + x1, + x5. + +0.14::x6 :- + \+x0, + x1, + x5. + +0.21::x6 :- + x0, + \+x1, + x5. + +0.23::x6 :- + \+x0, + \+x1, + x5. + +0.51::x6 :- + x0, + x1, + \+x5. + +0.90::x6 :- + \+x0, + x1, + \+x5. + +0.47::x6 :- + x0, + \+x1, + \+x5. + +0.25::x6 :- + \+x0, + \+x1, + \+x5. + +0.82::x7 :- + x0, + x1, + x2, + x4. + +0.33::x7 :- + \+x0, + x1, + x2, + x4. + +0.47::x7 :- + x0, + \+x1, + x2, + x4. + +0.54::x7 :- + \+x0, + \+x1, + x2, + x4. + +0.52::x7 :- + x0, + x1, + \+x2, + x4. + +0.62::x7 :- + \+x0, + x1, + \+x2, + x4. + +0.28::x7 :- + x0, + \+x1, + \+x2, + x4. + +0.35::x7 :- + \+x0, + \+x1, + \+x2, + x4. + +0.58::x7 :- + x0, + x1, + x2, + \+x4. + +0.72::x7 :- + \+x0, + x1, + x2, + \+x4. + +0.12::x7 :- + x0, + \+x1, + x2, + \+x4. + +0.98::x7 :- + \+x0, + \+x1, + x2, + \+x4. + +0.81::x7 :- + x0, + x1, + \+x2, + \+x4. + +0.45::x7 :- + \+x0, + x1, + \+x2, + \+x4. + +0.67::x7 :- + x0, + \+x1, + \+x2, + \+x4. + +0.38::x7 :- + \+x0, + \+x1, + \+x2, + \+x4. + +0.00::x8 :- + x0, + x5, + x6, + x7. + +0.24::x8 :- + \+x0, + x5, + x6, + x7. + +0.16::x8 :- + x0, + \+x5, + x6, + x7. + +0.48::x8 :- + \+x0, + \+x5, + x6, + x7. + +0.60::x8 :- + x0, + x5, + \+x6, + x7. + +0.17::x8 :- + \+x0, + x5, + \+x6, + x7. + +0.91::x8 :- + x0, + \+x5, + \+x6, + x7. + +0.24::x8 :- + \+x0, + \+x5, + \+x6, + x7. + +0.37::x8 :- + x0, + x5, + x6, + \+x7. + +0.85::x8 :- + \+x0, + x5, + x6, + \+x7. + +0.12::x8 :- + x0, + \+x5, + x6, + \+x7. + +0.97::x8 :- + \+x0, + \+x5, + x6, + \+x7. + +0.07::x8 :- + x0, + x5, + \+x6, + \+x7. + +0.45::x8 :- + \+x0, + x5, + \+x6, + \+x7. + +0.76::x8 :- + x0, + \+x5, + \+x6, + \+x7. + +0.74::x8 :- + \+x0, + \+x5, + \+x6, + \+x7. + +0.55::x9 :- + x0, + x1, + x3, + x4. + +0.93::x9 :- + \+x0, + x1, + x3, + x4. + +0.43::x9 :- + x0, + \+x1, + x3, + x4. + +0.41::x9 :- + \+x0, + \+x1, + x3, + x4. + +0.81::x9 :- + x0, + x1, + \+x3, + x4. + +0.23::x9 :- + \+x0, + x1, + \+x3, + x4. + +0.96::x9 :- + x0, + \+x1, + \+x3, + x4. + +0.35::x9 :- + \+x0, + \+x1, + \+x3, + x4. + +0.20::x9 :- + x0, + x1, + x3, + \+x4. + +0.54::x9 :- + \+x0, + x1, + x3, + \+x4. + +0.06::x9 :- + x0, + \+x1, + x3, + \+x4. + +0.37::x9 :- + \+x0, + \+x1, + x3, + \+x4. + +0.52::x9 :- + x0, + x1, + \+x3, + \+x4. + +0.32::x9 :- + \+x0, + x1, + \+x3, + \+x4. + +0.21::x9 :- + x0, + \+x1, + \+x3, + \+x4. + +0.09::x9 :- + \+x0, + \+x1, + \+x3, + \+x4. + +0.48::x10 :- + x0, + x5, + x8, + x9. + +0.26::x10 :- + \+x0, + x5, + x8, + x9. + +0.71::x10 :- + x0, + \+x5, + x8, + x9. + +0.31::x10 :- + \+x0, + \+x5, + x8, + x9. + +0.59::x10 :- + x0, + x5, + \+x8, + x9. + +0.46::x10 :- + \+x0, + x5, + \+x8, + x9. + +0.10::x10 :- + x0, + \+x5, + \+x8, + x9. + +0.71::x10 :- + \+x0, + \+x5, + \+x8, + x9. + +0.47::x10 :- + x0, + x5, + x8, + \+x9. + +0.66::x10 :- + \+x0, + x5, + x8, + \+x9. + +0.03::x10 :- + x0, + \+x5, + x8, + \+x9. + +0.21::x10 :- + \+x0, + \+x5, + x8, + \+x9. + +0.40::x10 :- + x0, + x5, + \+x8, + \+x9. + +0.75::x10 :- + \+x0, + x5, + \+x8, + \+x9. + +0.62::x10 :- + x0, + \+x5, + \+x8, + \+x9. + +0.85::x10 :- + \+x0, + \+x5, + \+x8, + \+x9. + +0.54::x11 :- + x5, + x6, + x7, + x10. + +0.73::x11 :- + \+x5, + x6, + x7, + x10. + +0.90::x11 :- + x5, + \+x6, + x7, + x10. + +0.58::x11 :- + \+x5, + \+x6, + x7, + x10. + +0.19::x11 :- + x5, + x6, + \+x7, + x10. + +0.78::x11 :- + \+x5, + x6, + \+x7, + x10. + +0.33::x11 :- + x5, + \+x6, + \+x7, + x10. + +0.17::x11 :- + \+x5, + \+x6, + \+x7, + x10. + +0.09::x11 :- + x5, + x6, + x7, + \+x10. + +0.46::x11 :- + \+x5, + x6, + x7, + \+x10. + +0.44::x11 :- + x5, + \+x6, + x7, + \+x10. + +0.81::x11 :- + \+x5, + \+x6, + x7, + \+x10. + +0.24::x11 :- + x5, + x6, + \+x7, + \+x10. + +0.99::x11 :- + \+x5, + x6, + \+x7, + \+x10. + +0.63::x11 :- + x5, + \+x6, + \+x7, + \+x10. + +0.38::x11 :- + \+x5, + \+x6, + \+x7, + \+x10. + +0.07::x12 :- + x0, + x1, + x2, + x5, + x7. + +0.49::x12 :- + \+x0, + x1, + x2, + x5, + x7. + +0.66::x12 :- + x0, + \+x1, + x2, + x5, + x7. + +0.45::x12 :- + \+x0, + \+x1, + x2, + x5, + x7. + +0.96::x12 :- + x0, + x1, + \+x2, + x5, + x7. + +0.00::x12 :- + \+x0, + x1, + \+x2, + x5, + x7. + +0.24::x12 :- + x0, + \+x1, + \+x2, + x5, + x7. + +0.32::x12 :- + \+x0, + \+x1, + \+x2, + x5, + x7. + +0.74::x12 :- + x0, + x1, + x2, + \+x5, + x7. + +0.93::x12 :- + \+x0, + x1, + x2, + \+x5, + x7. + +0.31::x12 :- + x0, + \+x1, + x2, + \+x5, + x7. + +0.32::x12 :- + \+x0, + \+x1, + x2, + \+x5, + x7. + +0.58::x12 :- + x0, + x1, + \+x2, + \+x5, + x7. + +0.45::x12 :- + \+x0, + x1, + \+x2, + \+x5, + x7. + +0.08::x12 :- + x0, + \+x1, + \+x2, + \+x5, + x7. + +0.53::x12 :- + \+x0, + \+x1, + \+x2, + \+x5, + x7. + +0.06::x12 :- + x0, + x1, + x2, + x5, + \+x7. + +0.42::x12 :- + \+x0, + x1, + x2, + x5, + \+x7. + +0.83::x12 :- + x0, + \+x1, + x2, + x5, + \+x7. + +0.69::x12 :- + \+x0, + \+x1, + x2, + x5, + \+x7. + +0.72::x12 :- + x0, + x1, + \+x2, + x5, + \+x7. + +0.11::x12 :- + \+x0, + x1, + \+x2, + x5, + \+x7. + +0.96::x12 :- + x0, + \+x1, + \+x2, + x5, + \+x7. + +0.92::x12 :- + \+x0, + \+x1, + \+x2, + x5, + \+x7. + +0.04::x12 :- + x0, + x1, + x2, + \+x5, + \+x7. + +0.36::x12 :- + \+x0, + x1, + x2, + \+x5, + \+x7. + +0.52::x12 :- + x0, + \+x1, + x2, + \+x5, + \+x7. + +0.12::x12 :- + \+x0, + \+x1, + x2, + \+x5, + \+x7. + +0.00::x12 :- + x0, + x1, + \+x2, + \+x5, + \+x7. + +0.47::x12 :- + \+x0, + x1, + \+x2, + \+x5, + \+x7. + +0.70::x12 :- + x0, + \+x1, + \+x2, + \+x5, + \+x7. + +0.72::x12 :- + \+x0, + \+x1, + \+x2, + \+x5, + \+x7. + +0.09::x13 :- + x0, + x4, + x6, + x8, + x10. + +0.84::x13 :- + \+x0, + x4, + x6, + x8, + x10. + +0.59::x13 :- + x0, + \+x4, + x6, + x8, + x10. + +0.62::x13 :- + \+x0, + \+x4, + x6, + x8, + x10. + +0.32::x13 :- + x0, + x4, + \+x6, + x8, + x10. + +0.20::x13 :- + \+x0, + x4, + \+x6, + x8, + x10. + +0.72::x13 :- + x0, + \+x4, + \+x6, + x8, + x10. + +0.16::x13 :- + \+x0, + \+x4, + \+x6, + x8, + x10. + +0.75::x13 :- + x0, + x4, + x6, + \+x8, + x10. + +0.07::x13 :- + \+x0, + x4, + x6, + \+x8, + x10. + +0.02::x13 :- + x0, + \+x4, + x6, + \+x8, + x10. + +0.79::x13 :- + \+x0, + \+x4, + x6, + \+x8, + x10. + +0.59::x13 :- + x0, + x4, + \+x6, + \+x8, + x10. + +0.84::x13 :- + \+x0, + x4, + \+x6, + \+x8, + x10. + +0.37::x13 :- + x0, + \+x4, + \+x6, + \+x8, + x10. + +0.21::x13 :- + \+x0, + \+x4, + \+x6, + \+x8, + x10. + +0.98::x13 :- + x0, + x4, + x6, + x8, + \+x10. + +0.07::x13 :- + \+x0, + x4, + x6, + x8, + \+x10. + +0.03::x13 :- + x0, + \+x4, + x6, + x8, + \+x10. + +0.48::x13 :- + \+x0, + \+x4, + x6, + x8, + \+x10. + +0.24::x13 :- + x0, + x4, + \+x6, + x8, + \+x10. + +0.55::x13 :- + \+x0, + x4, + \+x6, + x8, + \+x10. + +0.58::x13 :- + x0, + \+x4, + \+x6, + x8, + \+x10. + +0.46::x13 :- + \+x0, + \+x4, + \+x6, + x8, + \+x10. + +0.37::x13 :- + x0, + x4, + x6, + \+x8, + \+x10. + +0.16::x13 :- + \+x0, + x4, + x6, + \+x8, + \+x10. + +0.76::x13 :- + x0, + \+x4, + x6, + \+x8, + \+x10. + +0.50::x13 :- + \+x0, + \+x4, + x6, + \+x8, + \+x10. + +0.96::x13 :- + x0, + x4, + \+x6, + \+x8, + \+x10. + +0.03::x13 :- + \+x0, + x4, + \+x6, + \+x8, + \+x10. + +0.05::x13 :- + x0, + \+x4, + \+x6, + \+x8, + \+x10. + +0.67::x13 :- + \+x0, + \+x4, + \+x6, + \+x8, + \+x10. + +0.94::x14 :- + x2, + x10, + x11, + x12, + x13. + +0.88::x14 :- + \+x2, + x10, + x11, + x12, + x13. + +0.78::x14 :- + x2, + \+x10, + x11, + x12, + x13. + +0.82::x14 :- + \+x2, + \+x10, + x11, + x12, + x13. + +0.37::x14 :- + x2, + x10, + \+x11, + x12, + x13. + +0.28::x14 :- + \+x2, + x10, + \+x11, + x12, + x13. + +0.22::x14 :- + x2, + \+x10, + \+x11, + x12, + x13. + +0.61::x14 :- + \+x2, + \+x10, + \+x11, + x12, + x13. + +0.45::x14 :- + x2, + x10, + x11, + \+x12, + x13. + +0.75::x14 :- + \+x2, + x10, + x11, + \+x12, + x13. + +0.32::x14 :- + x2, + \+x10, + x11, + \+x12, + x13. + +0.36::x14 :- + \+x2, + \+x10, + x11, + \+x12, + x13. + +0.60::x14 :- + x2, + x10, + \+x11, + \+x12, + x13. + +0.26::x14 :- + \+x2, + x10, + \+x11, + \+x12, + x13. + +0.19::x14 :- + x2, + \+x10, + \+x11, + \+x12, + x13. + +0.80::x14 :- + \+x2, + \+x10, + \+x11, + \+x12, + x13. + +0.96::x14 :- + x2, + x10, + x11, + x12, + \+x13. + +0.67::x14 :- + \+x2, + x10, + x11, + x12, + \+x13. + +0.20::x14 :- + x2, + \+x10, + x11, + x12, + \+x13. + +0.22::x14 :- + \+x2, + \+x10, + x11, + x12, + \+x13. + +0.70::x14 :- + x2, + x10, + \+x11, + x12, + \+x13. + +0.64::x14 :- + \+x2, + x10, + \+x11, + x12, + \+x13. + +0.43::x14 :- + x2, + \+x10, + \+x11, + x12, + \+x13. + +0.45::x14 :- + \+x2, + \+x10, + \+x11, + x12, + \+x13. + +0.77::x14 :- + x2, + x10, + x11, + \+x12, + \+x13. + +0.44::x14 :- + \+x2, + x10, + x11, + \+x12, + \+x13. + +0.87::x14 :- + x2, + \+x10, + x11, + \+x12, + \+x13. + +0.72::x14 :- + \+x2, + \+x10, + x11, + \+x12, + \+x13. + +0.08::x14 :- + x2, + x10, + \+x11, + \+x12, + \+x13. + +0.73::x14 :- + \+x2, + x10, + \+x11, + \+x12, + \+x13. + +0.12::x14 :- + x2, + \+x10, + \+x11, + \+x12, + \+x13. + +0.80::x14 :- + \+x2, + \+x10, + \+x11, + \+x12, + \+x13. + +0.50::x15 :- + x0, + x1, + x5, + x8, + x14. + +0.87::x15 :- + \+x0, + x1, + x5, + x8, + x14. + +0.67::x15 :- + x0, + \+x1, + x5, + x8, + x14. + +0.58::x15 :- + \+x0, + \+x1, + x5, + x8, + x14. + +0.80::x15 :- + x0, + x1, + \+x5, + x8, + x14. + +0.13::x15 :- + \+x0, + x1, + \+x5, + x8, + x14. + +0.56::x15 :- + x0, + \+x1, + \+x5, + x8, + x14. + +0.43::x15 :- + \+x0, + \+x1, + \+x5, + x8, + x14. + +0.73::x15 :- + x0, + x1, + x5, + \+x8, + x14. + +0.78::x15 :- + \+x0, + x1, + x5, + \+x8, + x14. + +0.28::x15 :- + x0, + \+x1, + x5, + \+x8, + x14. + +0.34::x15 :- + \+x0, + \+x1, + x5, + \+x8, + x14. + +0.54::x15 :- + x0, + x1, + \+x5, + \+x8, + x14. + +0.56::x15 :- + \+x0, + x1, + \+x5, + \+x8, + x14. + +0.14::x15 :- + x0, + \+x1, + \+x5, + \+x8, + x14. + +0.76::x15 :- + \+x0, + \+x1, + \+x5, + \+x8, + x14. + +0.72::x15 :- + x0, + x1, + x5, + x8, + \+x14. + +0.73::x15 :- + \+x0, + x1, + x5, + x8, + \+x14. + +0.20::x15 :- + x0, + \+x1, + x5, + x8, + \+x14. + +0.02::x15 :- + \+x0, + \+x1, + x5, + x8, + \+x14. + +0.35::x15 :- + x0, + x1, + \+x5, + x8, + \+x14. + +0.50::x15 :- + \+x0, + x1, + \+x5, + x8, + \+x14. + +0.24::x15 :- + x0, + \+x1, + \+x5, + x8, + \+x14. + +0.23::x15 :- + \+x0, + \+x1, + \+x5, + x8, + \+x14. + +0.44::x15 :- + x0, + x1, + x5, + \+x8, + \+x14. + +0.06::x15 :- + \+x0, + x1, + x5, + \+x8, + \+x14. + +0.60::x15 :- + x0, + \+x1, + x5, + \+x8, + \+x14. + +0.46::x15 :- + \+x0, + \+x1, + x5, + \+x8, + \+x14. + +0.98::x15 :- + x0, + x1, + \+x5, + \+x8, + \+x14. + +0.23::x15 :- + \+x0, + x1, + \+x5, + \+x8, + \+x14. + +0.39::x15 :- + x0, + \+x1, + \+x5, + \+x8, + \+x14. + +0.58::x15 :- + \+x0, + \+x1, + \+x5, + \+x8, + \+x14. + +0.58::x16 :- + x1, + x2, + x5, + x6, + x7. + +0.33::x16 :- + \+x1, + x2, + x5, + x6, + x7. + +0.91::x16 :- + x1, + \+x2, + x5, + x6, + x7. + +0.42::x16 :- + \+x1, + \+x2, + x5, + x6, + x7. + +0.91::x16 :- + x1, + x2, + \+x5, + x6, + x7. + +0.49::x16 :- + \+x1, + x2, + \+x5, + x6, + x7. + +0.09::x16 :- + x1, + \+x2, + \+x5, + x6, + x7. + +0.11::x16 :- + \+x1, + \+x2, + \+x5, + x6, + x7. + +0.29::x16 :- + x1, + x2, + x5, + \+x6, + x7. + +0.62::x16 :- + \+x1, + x2, + x5, + \+x6, + x7. + +0.46::x16 :- + x1, + \+x2, + x5, + \+x6, + x7. + +0.66::x16 :- + \+x1, + \+x2, + x5, + \+x6, + x7. + +0.47::x16 :- + x1, + x2, + \+x5, + \+x6, + x7. + +0.87::x16 :- + \+x1, + x2, + \+x5, + \+x6, + x7. + +0.47::x16 :- + x1, + \+x2, + \+x5, + \+x6, + x7. + +0.18::x16 :- + \+x1, + \+x2, + \+x5, + \+x6, + x7. + +0.42::x16 :- + x1, + x2, + x5, + x6, + \+x7. + +0.26::x16 :- + \+x1, + x2, + x5, + x6, + \+x7. + +0.72::x16 :- + x1, + \+x2, + x5, + x6, + \+x7. + +0.31::x16 :- + \+x1, + \+x2, + x5, + x6, + \+x7. + +0.92::x16 :- + x1, + x2, + \+x5, + x6, + \+x7. + +0.38::x16 :- + \+x1, + x2, + \+x5, + x6, + \+x7. + +0.50::x16 :- + x1, + \+x2, + \+x5, + x6, + \+x7. + +0.69::x16 :- + \+x1, + \+x2, + \+x5, + x6, + \+x7. + +0.95::x16 :- + x1, + x2, + x5, + \+x6, + \+x7. + +0.01::x16 :- + \+x1, + x2, + x5, + \+x6, + \+x7. + +0.84::x16 :- + x1, + \+x2, + x5, + \+x6, + \+x7. + +0.52::x16 :- + \+x1, + \+x2, + x5, + \+x6, + \+x7. + +0.15::x16 :- + x1, + x2, + \+x5, + \+x6, + \+x7. + +0.91::x16 :- + \+x1, + x2, + \+x5, + \+x6, + \+x7. + +0.61::x16 :- + x1, + \+x2, + \+x5, + \+x6, + \+x7. + +0.06::x16 :- + \+x1, + \+x2, + \+x5, + \+x6, + \+x7. + +0.80::x17 :- + x1, + x7, + x11, + x12, + x16. + +0.33::x17 :- + \+x1, + x7, + x11, + x12, + x16. + +0.75::x17 :- + x1, + \+x7, + x11, + x12, + x16. + +0.18::x17 :- + \+x1, + \+x7, + x11, + x12, + x16. + +0.01::x17 :- + x1, + x7, + \+x11, + x12, + x16. + +0.12::x17 :- + \+x1, + x7, + \+x11, + x12, + x16. + +0.89::x17 :- + x1, + \+x7, + \+x11, + x12, + x16. + +0.13::x17 :- + \+x1, + \+x7, + \+x11, + x12, + x16. + +0.64::x17 :- + x1, + x7, + x11, + \+x12, + x16. + +0.73::x17 :- + \+x1, + x7, + x11, + \+x12, + x16. + +0.70::x17 :- + x1, + \+x7, + x11, + \+x12, + x16. + +0.76::x17 :- + \+x1, + \+x7, + x11, + \+x12, + x16. + +0.61::x17 :- + x1, + x7, + \+x11, + \+x12, + x16. + +0.97::x17 :- + \+x1, + x7, + \+x11, + \+x12, + x16. + +0.41::x17 :- + x1, + \+x7, + \+x11, + \+x12, + x16. + +0.24::x17 :- + \+x1, + \+x7, + \+x11, + \+x12, + x16. + +0.61::x17 :- + x1, + x7, + x11, + x12, + \+x16. + +0.81::x17 :- + \+x1, + x7, + x11, + x12, + \+x16. + +0.97::x17 :- + x1, + \+x7, + x11, + x12, + \+x16. + +0.81::x17 :- + \+x1, + \+x7, + x11, + x12, + \+x16. + +0.54::x17 :- + x1, + x7, + \+x11, + x12, + \+x16. + +0.29::x17 :- + \+x1, + x7, + \+x11, + x12, + \+x16. + +0.64::x17 :- + x1, + \+x7, + \+x11, + x12, + \+x16. + +0.78::x17 :- + \+x1, + \+x7, + \+x11, + x12, + \+x16. + +0.70::x17 :- + x1, + x7, + x11, + \+x12, + \+x16. + +0.09::x17 :- + \+x1, + x7, + x11, + \+x12, + \+x16. + +0.23::x17 :- + x1, + \+x7, + x11, + \+x12, + \+x16. + +0.31::x17 :- + \+x1, + \+x7, + x11, + \+x12, + \+x16. + +0.66::x17 :- + x1, + x7, + \+x11, + \+x12, + \+x16. + +0.33::x17 :- + \+x1, + x7, + \+x11, + \+x12, + \+x16. + +0.50::x17 :- + x1, + \+x7, + \+x11, + \+x12, + \+x16. + +0.42::x17 :- + \+x1, + \+x7, + \+x11, + \+x12, + \+x16. + +0.19::x18 :- + x1, + x2, + x3, + x8, + x17. + +0.43::x18 :- + \+x1, + x2, + x3, + x8, + x17. + +0.69::x18 :- + x1, + \+x2, + x3, + x8, + x17. + +0.25::x18 :- + \+x1, + \+x2, + x3, + x8, + x17. + +0.78::x18 :- + x1, + x2, + \+x3, + x8, + x17. + +0.71::x18 :- + \+x1, + x2, + \+x3, + x8, + x17. + +0.14::x18 :- + x1, + \+x2, + \+x3, + x8, + x17. + +0.74::x18 :- + \+x1, + \+x2, + \+x3, + x8, + x17. + +0.89::x18 :- + x1, + x2, + x3, + \+x8, + x17. + +0.11::x18 :- + \+x1, + x2, + x3, + \+x8, + x17. + +0.15::x18 :- + x1, + \+x2, + x3, + \+x8, + x17. + +0.98::x18 :- + \+x1, + \+x2, + x3, + \+x8, + x17. + +0.97::x18 :- + x1, + x2, + \+x3, + \+x8, + x17. + +0.22::x18 :- + \+x1, + x2, + \+x3, + \+x8, + x17. + +0.21::x18 :- + x1, + \+x2, + \+x3, + \+x8, + x17. + +0.82::x18 :- + \+x1, + \+x2, + \+x3, + \+x8, + x17. + +0.00::x18 :- + x1, + x2, + x3, + x8, + \+x17. + +0.96::x18 :- + \+x1, + x2, + x3, + x8, + \+x17. + +0.72::x18 :- + x1, + \+x2, + x3, + x8, + \+x17. + +0.95::x18 :- + \+x1, + \+x2, + x3, + x8, + \+x17. + +0.20::x18 :- + x1, + x2, + \+x3, + x8, + \+x17. + +0.34::x18 :- + \+x1, + x2, + \+x3, + x8, + \+x17. + +0.66::x18 :- + x1, + \+x2, + \+x3, + x8, + \+x17. + +0.81::x18 :- + \+x1, + \+x2, + \+x3, + x8, + \+x17. + +0.96::x18 :- + x1, + x2, + x3, + \+x8, + \+x17. + +0.08::x18 :- + \+x1, + x2, + x3, + \+x8, + \+x17. + +0.69::x18 :- + x1, + \+x2, + x3, + \+x8, + \+x17. + +0.19::x18 :- + \+x1, + \+x2, + x3, + \+x8, + \+x17. + +0.76::x18 :- + x1, + x2, + \+x3, + \+x8, + \+x17. + +0.38::x18 :- + \+x1, + x2, + \+x3, + \+x8, + \+x17. + +0.35::x18 :- + x1, + \+x2, + \+x3, + \+x8, + \+x17. + +0.67::x18 :- + \+x1, + \+x2, + \+x3, + \+x8, + \+x17. + +0.99::x19 :- + x5, + x8, + x15, + x16, + x18. + +0.08::x19 :- + \+x5, + x8, + x15, + x16, + x18. + +0.47::x19 :- + x5, + \+x8, + x15, + x16, + x18. + +0.30::x19 :- + \+x5, + \+x8, + x15, + x16, + x18. + +0.91::x19 :- + x5, + x8, + \+x15, + x16, + x18. + +0.91::x19 :- + \+x5, + x8, + \+x15, + x16, + x18. + +0.65::x19 :- + x5, + \+x8, + \+x15, + x16, + x18. + +0.58::x19 :- + \+x5, + \+x8, + \+x15, + x16, + x18. + +0.62::x19 :- + x5, + x8, + x15, + \+x16, + x18. + +0.65::x19 :- + \+x5, + x8, + x15, + \+x16, + x18. + +0.40::x19 :- + x5, + \+x8, + x15, + \+x16, + x18. + +0.21::x19 :- + \+x5, + \+x8, + x15, + \+x16, + x18. + +0.33::x19 :- + x5, + x8, + \+x15, + \+x16, + x18. + +0.70::x19 :- + \+x5, + x8, + \+x15, + \+x16, + x18. + +0.76::x19 :- + x5, + \+x8, + \+x15, + \+x16, + x18. + +0.59::x19 :- + \+x5, + \+x8, + \+x15, + \+x16, + x18. + +0.54::x19 :- + x5, + x8, + x15, + x16, + \+x18. + +0.68::x19 :- + \+x5, + x8, + x15, + x16, + \+x18. + +0.24::x19 :- + x5, + \+x8, + x15, + x16, + \+x18. + +0.40::x19 :- + \+x5, + \+x8, + x15, + x16, + \+x18. + +0.97::x19 :- + x5, + x8, + \+x15, + x16, + \+x18. + +0.43::x19 :- + \+x5, + x8, + \+x15, + x16, + \+x18. + +0.91::x19 :- + x5, + \+x8, + \+x15, + x16, + \+x18. + +0.75::x19 :- + \+x5, + \+x8, + \+x15, + x16, + \+x18. + +0.42::x19 :- + x5, + x8, + x15, + \+x16, + \+x18. + +0.64::x19 :- + \+x5, + x8, + x15, + \+x16, + \+x18. + +0.53::x19 :- + x5, + \+x8, + x15, + \+x16, + \+x18. + +0.50::x19 :- + \+x5, + \+x8, + x15, + \+x16, + \+x18. + +0.01::x19 :- + x5, + x8, + \+x15, + \+x16, + \+x18. + +0.69::x19 :- + \+x5, + x8, + \+x15, + \+x16, + \+x18. + +0.44::x19 :- + x5, + \+x8, + \+x15, + \+x16, + \+x18. + +0.04::x19 :- + \+x5, + \+x8, + \+x15, + \+x16, + \+x18. + + +%% Queries + + +query(sub('https://lat.inf.tu-dresden.de/systems/born/born-example#a', 'https://lat.inf.tu-dresden.de/systems/born/born-example#e')). + + + diff --git a/born-owlapi/src/test/resources/1/output_from_problog.txt b/born-owlapi/src/test/resources/1/output_from_problog.txt new file mode 100644 index 00000000..fedf207d --- /dev/null +++ b/born-owlapi/src/test/resources/1/output_from_problog.txt @@ -0,0 +1 @@ +sub('https://lat.inf.tu-dresden.de/systems/born/born-example#a','https://lat.inf.tu-dresden.de/systems/born/born-example#e'): 0.57455863 diff --git a/born-owlapi/src/test/resources/2/input_for_problog.txt b/born-owlapi/src/test/resources/2/input_for_problog.txt new file mode 100644 index 00000000..af064250 --- /dev/null +++ b/born-owlapi/src/test/resources/2/input_for_problog.txt @@ -0,0 +1,2536 @@ + +%% EL completion rules + + + +% Rules to interpret the queries +sub(X, B) :- +con(X), +con(B), +subx(X, B). +inst(X, B) :- +indiv(X), +con(B), +subx(X, B). +inst(R, X, B) :- +role(R), +indiv(X), +indiv(B), +subx(X, exists(R, A)), +subx(A, B). + +% Rules to process individuals +coni(X) :- con(X). +coni(X) :- indiv(X). + +% Basic rules for the completion +subx(X, X) :- coni(X). +subx(X, top) :- coni(X). +subx(X, B) :- gci(X, B). + +% EL complettion rules +subx(X, B) :- +gci(A, B), +subx(X, A), +coni(X), +coni(A), +coni(B). +subx(X, B) :- +gci(and(A1, A2), B), +subx(X, A1), +subx(X, A2), +coni(X), +coni(A1), +coni(A2), +coni(B). +subx(X, exists(R, B)) :- +gci(A, exists(R, B)), +subx(X, A), +coni(X), +coni(A), +coni(B), +role(R). +subx(X, B) :- +gci(exists(R, A), B), +subx(X, exists(R, Y)), +subx(Y, A), +coni(X), +coni(Y), +coni(A), +coni(B), +role(R). + +% Rules to avoid empty predicates of entities +con(-). +role(-). +indiv(-). + + +%% Ontology + +con('https://lat.inf.tu-dresden.de/systems/born/born-example#a'). +con('https://lat.inf.tu-dresden.de/systems/born/born-example#c'). +con('https://lat.inf.tu-dresden.de/systems/born/born-example#d'). +con('https://lat.inf.tu-dresden.de/systems/born/born-example#e'). +con('https://lat.inf.tu-dresden.de/systems/born/born-example#b'). +con('AuxiliaryEntity24'). +con('AuxiliaryEntity25'). +role('https://lat.inf.tu-dresden.de/systems/born/born-example#r'). +role('https://lat.inf.tu-dresden.de/systems/born/born-example#s'). +indiv('https://lat.inf.tu-dresden.de/systems/born/born-example#i0'). +indiv('https://lat.inf.tu-dresden.de/systems/born/born-example#i1'). +gci(exists('https://lat.inf.tu-dresden.de/systems/born/born-example#r', 'https://lat.inf.tu-dresden.de/systems/born/born-example#b'), 'https://lat.inf.tu-dresden.de/systems/born/born-example#d') :- \+x2. +gci('AuxiliaryEntity25', 'https://lat.inf.tu-dresden.de/systems/born/born-example#b') :- x5. +gci('https://lat.inf.tu-dresden.de/systems/born/born-example#i0', 'AuxiliaryEntity24'). +gci('AuxiliaryEntity24', 'https://lat.inf.tu-dresden.de/systems/born/born-example#i0'). +gci('https://lat.inf.tu-dresden.de/systems/born/born-example#a', 'https://lat.inf.tu-dresden.de/systems/born/born-example#c') :- x4. +gci('AuxiliaryEntity24', 'https://lat.inf.tu-dresden.de/systems/born/born-example#a') :- x3. +gci(and('https://lat.inf.tu-dresden.de/systems/born/born-example#c', 'https://lat.inf.tu-dresden.de/systems/born/born-example#d'), 'https://lat.inf.tu-dresden.de/systems/born/born-example#e') :- x5. +gci('https://lat.inf.tu-dresden.de/systems/born/born-example#a', exists('https://lat.inf.tu-dresden.de/systems/born/born-example#r', 'https://lat.inf.tu-dresden.de/systems/born/born-example#b')) :- x0. +gci('https://lat.inf.tu-dresden.de/systems/born/born-example#c', 'https://lat.inf.tu-dresden.de/systems/born/born-example#e') :- x3. +gci('https://lat.inf.tu-dresden.de/systems/born/born-example#i1', 'AuxiliaryEntity25'). +gci('AuxiliaryEntity25', 'https://lat.inf.tu-dresden.de/systems/born/born-example#i1'). +gci('https://lat.inf.tu-dresden.de/systems/born/born-example#b', exists('https://lat.inf.tu-dresden.de/systems/born/born-example#s', 'https://lat.inf.tu-dresden.de/systems/born/born-example#c')) :- \+x3. + + +%% Bayesian Network + + +0.25::x0. + +0.84::x1 :- x0. + +0.27::x1 :- \+x0. + +0.77::x2 :- + x0, + x1. + +0.77::x2 :- + \+x0, + x1. + +0.45::x2 :- + x0, + \+x1. + +0.12::x2 :- + \+x0, + \+x1. + +0.88::x3 :- + x1, + x2. + +0.72::x3 :- + \+x1, + x2. + +0.00::x3 :- + x1, + \+x2. + +0.99::x3 :- + \+x1, + \+x2. + +0.42::x4 :- + x0, + x2, + x3. + +0.30::x4 :- + \+x0, + x2, + x3. + +0.01::x4 :- + x0, + \+x2, + x3. + +0.94::x4 :- + \+x0, + \+x2, + x3. + +0.98::x4 :- + x0, + x2, + \+x3. + +0.82::x4 :- + \+x0, + x2, + \+x3. + +0.18::x4 :- + x0, + \+x2, + \+x3. + +0.69::x4 :- + \+x0, + \+x2, + \+x3. + +0.64::x5 :- + x0, + x2, + x3. + +0.63::x5 :- + \+x0, + x2, + x3. + +0.26::x5 :- + x0, + \+x2, + x3. + +0.79::x5 :- + \+x0, + \+x2, + x3. + +0.66::x5 :- + x0, + x2, + \+x3. + +0.03::x5 :- + \+x0, + x2, + \+x3. + +0.62::x5 :- + x0, + \+x2, + \+x3. + +0.56::x5 :- + \+x0, + \+x2, + \+x3. + +0.21::x6 :- + x0, + x1, + x5. + +0.14::x6 :- + \+x0, + x1, + x5. + +0.21::x6 :- + x0, + \+x1, + x5. + +0.23::x6 :- + \+x0, + \+x1, + x5. + +0.51::x6 :- + x0, + x1, + \+x5. + +0.90::x6 :- + \+x0, + x1, + \+x5. + +0.47::x6 :- + x0, + \+x1, + \+x5. + +0.25::x6 :- + \+x0, + \+x1, + \+x5. + +0.82::x7 :- + x0, + x1, + x2, + x4. + +0.33::x7 :- + \+x0, + x1, + x2, + x4. + +0.47::x7 :- + x0, + \+x1, + x2, + x4. + +0.54::x7 :- + \+x0, + \+x1, + x2, + x4. + +0.52::x7 :- + x0, + x1, + \+x2, + x4. + +0.62::x7 :- + \+x0, + x1, + \+x2, + x4. + +0.28::x7 :- + x0, + \+x1, + \+x2, + x4. + +0.35::x7 :- + \+x0, + \+x1, + \+x2, + x4. + +0.58::x7 :- + x0, + x1, + x2, + \+x4. + +0.72::x7 :- + \+x0, + x1, + x2, + \+x4. + +0.12::x7 :- + x0, + \+x1, + x2, + \+x4. + +0.98::x7 :- + \+x0, + \+x1, + x2, + \+x4. + +0.81::x7 :- + x0, + x1, + \+x2, + \+x4. + +0.45::x7 :- + \+x0, + x1, + \+x2, + \+x4. + +0.67::x7 :- + x0, + \+x1, + \+x2, + \+x4. + +0.38::x7 :- + \+x0, + \+x1, + \+x2, + \+x4. + +0.00::x8 :- + x0, + x5, + x6, + x7. + +0.24::x8 :- + \+x0, + x5, + x6, + x7. + +0.16::x8 :- + x0, + \+x5, + x6, + x7. + +0.48::x8 :- + \+x0, + \+x5, + x6, + x7. + +0.60::x8 :- + x0, + x5, + \+x6, + x7. + +0.17::x8 :- + \+x0, + x5, + \+x6, + x7. + +0.91::x8 :- + x0, + \+x5, + \+x6, + x7. + +0.24::x8 :- + \+x0, + \+x5, + \+x6, + x7. + +0.37::x8 :- + x0, + x5, + x6, + \+x7. + +0.85::x8 :- + \+x0, + x5, + x6, + \+x7. + +0.12::x8 :- + x0, + \+x5, + x6, + \+x7. + +0.97::x8 :- + \+x0, + \+x5, + x6, + \+x7. + +0.07::x8 :- + x0, + x5, + \+x6, + \+x7. + +0.45::x8 :- + \+x0, + x5, + \+x6, + \+x7. + +0.76::x8 :- + x0, + \+x5, + \+x6, + \+x7. + +0.74::x8 :- + \+x0, + \+x5, + \+x6, + \+x7. + +0.55::x9 :- + x0, + x1, + x3, + x4. + +0.93::x9 :- + \+x0, + x1, + x3, + x4. + +0.43::x9 :- + x0, + \+x1, + x3, + x4. + +0.41::x9 :- + \+x0, + \+x1, + x3, + x4. + +0.81::x9 :- + x0, + x1, + \+x3, + x4. + +0.23::x9 :- + \+x0, + x1, + \+x3, + x4. + +0.96::x9 :- + x0, + \+x1, + \+x3, + x4. + +0.35::x9 :- + \+x0, + \+x1, + \+x3, + x4. + +0.20::x9 :- + x0, + x1, + x3, + \+x4. + +0.54::x9 :- + \+x0, + x1, + x3, + \+x4. + +0.06::x9 :- + x0, + \+x1, + x3, + \+x4. + +0.37::x9 :- + \+x0, + \+x1, + x3, + \+x4. + +0.52::x9 :- + x0, + x1, + \+x3, + \+x4. + +0.32::x9 :- + \+x0, + x1, + \+x3, + \+x4. + +0.21::x9 :- + x0, + \+x1, + \+x3, + \+x4. + +0.09::x9 :- + \+x0, + \+x1, + \+x3, + \+x4. + +0.48::x10 :- + x0, + x5, + x8, + x9. + +0.26::x10 :- + \+x0, + x5, + x8, + x9. + +0.71::x10 :- + x0, + \+x5, + x8, + x9. + +0.31::x10 :- + \+x0, + \+x5, + x8, + x9. + +0.59::x10 :- + x0, + x5, + \+x8, + x9. + +0.46::x10 :- + \+x0, + x5, + \+x8, + x9. + +0.10::x10 :- + x0, + \+x5, + \+x8, + x9. + +0.71::x10 :- + \+x0, + \+x5, + \+x8, + x9. + +0.47::x10 :- + x0, + x5, + x8, + \+x9. + +0.66::x10 :- + \+x0, + x5, + x8, + \+x9. + +0.03::x10 :- + x0, + \+x5, + x8, + \+x9. + +0.21::x10 :- + \+x0, + \+x5, + x8, + \+x9. + +0.40::x10 :- + x0, + x5, + \+x8, + \+x9. + +0.75::x10 :- + \+x0, + x5, + \+x8, + \+x9. + +0.62::x10 :- + x0, + \+x5, + \+x8, + \+x9. + +0.85::x10 :- + \+x0, + \+x5, + \+x8, + \+x9. + +0.54::x11 :- + x5, + x6, + x7, + x10. + +0.73::x11 :- + \+x5, + x6, + x7, + x10. + +0.90::x11 :- + x5, + \+x6, + x7, + x10. + +0.58::x11 :- + \+x5, + \+x6, + x7, + x10. + +0.19::x11 :- + x5, + x6, + \+x7, + x10. + +0.78::x11 :- + \+x5, + x6, + \+x7, + x10. + +0.33::x11 :- + x5, + \+x6, + \+x7, + x10. + +0.17::x11 :- + \+x5, + \+x6, + \+x7, + x10. + +0.09::x11 :- + x5, + x6, + x7, + \+x10. + +0.46::x11 :- + \+x5, + x6, + x7, + \+x10. + +0.44::x11 :- + x5, + \+x6, + x7, + \+x10. + +0.81::x11 :- + \+x5, + \+x6, + x7, + \+x10. + +0.24::x11 :- + x5, + x6, + \+x7, + \+x10. + +0.99::x11 :- + \+x5, + x6, + \+x7, + \+x10. + +0.63::x11 :- + x5, + \+x6, + \+x7, + \+x10. + +0.38::x11 :- + \+x5, + \+x6, + \+x7, + \+x10. + +0.07::x12 :- + x0, + x1, + x2, + x5, + x7. + +0.49::x12 :- + \+x0, + x1, + x2, + x5, + x7. + +0.66::x12 :- + x0, + \+x1, + x2, + x5, + x7. + +0.45::x12 :- + \+x0, + \+x1, + x2, + x5, + x7. + +0.96::x12 :- + x0, + x1, + \+x2, + x5, + x7. + +0.00::x12 :- + \+x0, + x1, + \+x2, + x5, + x7. + +0.24::x12 :- + x0, + \+x1, + \+x2, + x5, + x7. + +0.32::x12 :- + \+x0, + \+x1, + \+x2, + x5, + x7. + +0.74::x12 :- + x0, + x1, + x2, + \+x5, + x7. + +0.93::x12 :- + \+x0, + x1, + x2, + \+x5, + x7. + +0.31::x12 :- + x0, + \+x1, + x2, + \+x5, + x7. + +0.32::x12 :- + \+x0, + \+x1, + x2, + \+x5, + x7. + +0.58::x12 :- + x0, + x1, + \+x2, + \+x5, + x7. + +0.45::x12 :- + \+x0, + x1, + \+x2, + \+x5, + x7. + +0.08::x12 :- + x0, + \+x1, + \+x2, + \+x5, + x7. + +0.53::x12 :- + \+x0, + \+x1, + \+x2, + \+x5, + x7. + +0.06::x12 :- + x0, + x1, + x2, + x5, + \+x7. + +0.42::x12 :- + \+x0, + x1, + x2, + x5, + \+x7. + +0.83::x12 :- + x0, + \+x1, + x2, + x5, + \+x7. + +0.69::x12 :- + \+x0, + \+x1, + x2, + x5, + \+x7. + +0.72::x12 :- + x0, + x1, + \+x2, + x5, + \+x7. + +0.11::x12 :- + \+x0, + x1, + \+x2, + x5, + \+x7. + +0.96::x12 :- + x0, + \+x1, + \+x2, + x5, + \+x7. + +0.92::x12 :- + \+x0, + \+x1, + \+x2, + x5, + \+x7. + +0.04::x12 :- + x0, + x1, + x2, + \+x5, + \+x7. + +0.36::x12 :- + \+x0, + x1, + x2, + \+x5, + \+x7. + +0.52::x12 :- + x0, + \+x1, + x2, + \+x5, + \+x7. + +0.12::x12 :- + \+x0, + \+x1, + x2, + \+x5, + \+x7. + +0.00::x12 :- + x0, + x1, + \+x2, + \+x5, + \+x7. + +0.47::x12 :- + \+x0, + x1, + \+x2, + \+x5, + \+x7. + +0.70::x12 :- + x0, + \+x1, + \+x2, + \+x5, + \+x7. + +0.72::x12 :- + \+x0, + \+x1, + \+x2, + \+x5, + \+x7. + +0.09::x13 :- + x0, + x4, + x6, + x8, + x10. + +0.84::x13 :- + \+x0, + x4, + x6, + x8, + x10. + +0.59::x13 :- + x0, + \+x4, + x6, + x8, + x10. + +0.62::x13 :- + \+x0, + \+x4, + x6, + x8, + x10. + +0.32::x13 :- + x0, + x4, + \+x6, + x8, + x10. + +0.20::x13 :- + \+x0, + x4, + \+x6, + x8, + x10. + +0.72::x13 :- + x0, + \+x4, + \+x6, + x8, + x10. + +0.16::x13 :- + \+x0, + \+x4, + \+x6, + x8, + x10. + +0.75::x13 :- + x0, + x4, + x6, + \+x8, + x10. + +0.07::x13 :- + \+x0, + x4, + x6, + \+x8, + x10. + +0.02::x13 :- + x0, + \+x4, + x6, + \+x8, + x10. + +0.79::x13 :- + \+x0, + \+x4, + x6, + \+x8, + x10. + +0.59::x13 :- + x0, + x4, + \+x6, + \+x8, + x10. + +0.84::x13 :- + \+x0, + x4, + \+x6, + \+x8, + x10. + +0.37::x13 :- + x0, + \+x4, + \+x6, + \+x8, + x10. + +0.21::x13 :- + \+x0, + \+x4, + \+x6, + \+x8, + x10. + +0.98::x13 :- + x0, + x4, + x6, + x8, + \+x10. + +0.07::x13 :- + \+x0, + x4, + x6, + x8, + \+x10. + +0.03::x13 :- + x0, + \+x4, + x6, + x8, + \+x10. + +0.48::x13 :- + \+x0, + \+x4, + x6, + x8, + \+x10. + +0.24::x13 :- + x0, + x4, + \+x6, + x8, + \+x10. + +0.55::x13 :- + \+x0, + x4, + \+x6, + x8, + \+x10. + +0.58::x13 :- + x0, + \+x4, + \+x6, + x8, + \+x10. + +0.46::x13 :- + \+x0, + \+x4, + \+x6, + x8, + \+x10. + +0.37::x13 :- + x0, + x4, + x6, + \+x8, + \+x10. + +0.16::x13 :- + \+x0, + x4, + x6, + \+x8, + \+x10. + +0.76::x13 :- + x0, + \+x4, + x6, + \+x8, + \+x10. + +0.50::x13 :- + \+x0, + \+x4, + x6, + \+x8, + \+x10. + +0.96::x13 :- + x0, + x4, + \+x6, + \+x8, + \+x10. + +0.03::x13 :- + \+x0, + x4, + \+x6, + \+x8, + \+x10. + +0.05::x13 :- + x0, + \+x4, + \+x6, + \+x8, + \+x10. + +0.67::x13 :- + \+x0, + \+x4, + \+x6, + \+x8, + \+x10. + +0.94::x14 :- + x2, + x10, + x11, + x12, + x13. + +0.88::x14 :- + \+x2, + x10, + x11, + x12, + x13. + +0.78::x14 :- + x2, + \+x10, + x11, + x12, + x13. + +0.82::x14 :- + \+x2, + \+x10, + x11, + x12, + x13. + +0.37::x14 :- + x2, + x10, + \+x11, + x12, + x13. + +0.28::x14 :- + \+x2, + x10, + \+x11, + x12, + x13. + +0.22::x14 :- + x2, + \+x10, + \+x11, + x12, + x13. + +0.61::x14 :- + \+x2, + \+x10, + \+x11, + x12, + x13. + +0.45::x14 :- + x2, + x10, + x11, + \+x12, + x13. + +0.75::x14 :- + \+x2, + x10, + x11, + \+x12, + x13. + +0.32::x14 :- + x2, + \+x10, + x11, + \+x12, + x13. + +0.36::x14 :- + \+x2, + \+x10, + x11, + \+x12, + x13. + +0.60::x14 :- + x2, + x10, + \+x11, + \+x12, + x13. + +0.26::x14 :- + \+x2, + x10, + \+x11, + \+x12, + x13. + +0.19::x14 :- + x2, + \+x10, + \+x11, + \+x12, + x13. + +0.80::x14 :- + \+x2, + \+x10, + \+x11, + \+x12, + x13. + +0.96::x14 :- + x2, + x10, + x11, + x12, + \+x13. + +0.67::x14 :- + \+x2, + x10, + x11, + x12, + \+x13. + +0.20::x14 :- + x2, + \+x10, + x11, + x12, + \+x13. + +0.22::x14 :- + \+x2, + \+x10, + x11, + x12, + \+x13. + +0.70::x14 :- + x2, + x10, + \+x11, + x12, + \+x13. + +0.64::x14 :- + \+x2, + x10, + \+x11, + x12, + \+x13. + +0.43::x14 :- + x2, + \+x10, + \+x11, + x12, + \+x13. + +0.45::x14 :- + \+x2, + \+x10, + \+x11, + x12, + \+x13. + +0.77::x14 :- + x2, + x10, + x11, + \+x12, + \+x13. + +0.44::x14 :- + \+x2, + x10, + x11, + \+x12, + \+x13. + +0.87::x14 :- + x2, + \+x10, + x11, + \+x12, + \+x13. + +0.72::x14 :- + \+x2, + \+x10, + x11, + \+x12, + \+x13. + +0.08::x14 :- + x2, + x10, + \+x11, + \+x12, + \+x13. + +0.73::x14 :- + \+x2, + x10, + \+x11, + \+x12, + \+x13. + +0.12::x14 :- + x2, + \+x10, + \+x11, + \+x12, + \+x13. + +0.80::x14 :- + \+x2, + \+x10, + \+x11, + \+x12, + \+x13. + +0.50::x15 :- + x0, + x1, + x5, + x8, + x14. + +0.87::x15 :- + \+x0, + x1, + x5, + x8, + x14. + +0.67::x15 :- + x0, + \+x1, + x5, + x8, + x14. + +0.58::x15 :- + \+x0, + \+x1, + x5, + x8, + x14. + +0.80::x15 :- + x0, + x1, + \+x5, + x8, + x14. + +0.13::x15 :- + \+x0, + x1, + \+x5, + x8, + x14. + +0.56::x15 :- + x0, + \+x1, + \+x5, + x8, + x14. + +0.43::x15 :- + \+x0, + \+x1, + \+x5, + x8, + x14. + +0.73::x15 :- + x0, + x1, + x5, + \+x8, + x14. + +0.78::x15 :- + \+x0, + x1, + x5, + \+x8, + x14. + +0.28::x15 :- + x0, + \+x1, + x5, + \+x8, + x14. + +0.34::x15 :- + \+x0, + \+x1, + x5, + \+x8, + x14. + +0.54::x15 :- + x0, + x1, + \+x5, + \+x8, + x14. + +0.56::x15 :- + \+x0, + x1, + \+x5, + \+x8, + x14. + +0.14::x15 :- + x0, + \+x1, + \+x5, + \+x8, + x14. + +0.76::x15 :- + \+x0, + \+x1, + \+x5, + \+x8, + x14. + +0.72::x15 :- + x0, + x1, + x5, + x8, + \+x14. + +0.73::x15 :- + \+x0, + x1, + x5, + x8, + \+x14. + +0.20::x15 :- + x0, + \+x1, + x5, + x8, + \+x14. + +0.02::x15 :- + \+x0, + \+x1, + x5, + x8, + \+x14. + +0.35::x15 :- + x0, + x1, + \+x5, + x8, + \+x14. + +0.50::x15 :- + \+x0, + x1, + \+x5, + x8, + \+x14. + +0.24::x15 :- + x0, + \+x1, + \+x5, + x8, + \+x14. + +0.23::x15 :- + \+x0, + \+x1, + \+x5, + x8, + \+x14. + +0.44::x15 :- + x0, + x1, + x5, + \+x8, + \+x14. + +0.06::x15 :- + \+x0, + x1, + x5, + \+x8, + \+x14. + +0.60::x15 :- + x0, + \+x1, + x5, + \+x8, + \+x14. + +0.46::x15 :- + \+x0, + \+x1, + x5, + \+x8, + \+x14. + +0.98::x15 :- + x0, + x1, + \+x5, + \+x8, + \+x14. + +0.23::x15 :- + \+x0, + x1, + \+x5, + \+x8, + \+x14. + +0.39::x15 :- + x0, + \+x1, + \+x5, + \+x8, + \+x14. + +0.58::x15 :- + \+x0, + \+x1, + \+x5, + \+x8, + \+x14. + +0.58::x16 :- + x1, + x2, + x5, + x6, + x7. + +0.33::x16 :- + \+x1, + x2, + x5, + x6, + x7. + +0.91::x16 :- + x1, + \+x2, + x5, + x6, + x7. + +0.42::x16 :- + \+x1, + \+x2, + x5, + x6, + x7. + +0.91::x16 :- + x1, + x2, + \+x5, + x6, + x7. + +0.49::x16 :- + \+x1, + x2, + \+x5, + x6, + x7. + +0.09::x16 :- + x1, + \+x2, + \+x5, + x6, + x7. + +0.11::x16 :- + \+x1, + \+x2, + \+x5, + x6, + x7. + +0.29::x16 :- + x1, + x2, + x5, + \+x6, + x7. + +0.62::x16 :- + \+x1, + x2, + x5, + \+x6, + x7. + +0.46::x16 :- + x1, + \+x2, + x5, + \+x6, + x7. + +0.66::x16 :- + \+x1, + \+x2, + x5, + \+x6, + x7. + +0.47::x16 :- + x1, + x2, + \+x5, + \+x6, + x7. + +0.87::x16 :- + \+x1, + x2, + \+x5, + \+x6, + x7. + +0.47::x16 :- + x1, + \+x2, + \+x5, + \+x6, + x7. + +0.18::x16 :- + \+x1, + \+x2, + \+x5, + \+x6, + x7. + +0.42::x16 :- + x1, + x2, + x5, + x6, + \+x7. + +0.26::x16 :- + \+x1, + x2, + x5, + x6, + \+x7. + +0.72::x16 :- + x1, + \+x2, + x5, + x6, + \+x7. + +0.31::x16 :- + \+x1, + \+x2, + x5, + x6, + \+x7. + +0.92::x16 :- + x1, + x2, + \+x5, + x6, + \+x7. + +0.38::x16 :- + \+x1, + x2, + \+x5, + x6, + \+x7. + +0.50::x16 :- + x1, + \+x2, + \+x5, + x6, + \+x7. + +0.69::x16 :- + \+x1, + \+x2, + \+x5, + x6, + \+x7. + +0.95::x16 :- + x1, + x2, + x5, + \+x6, + \+x7. + +0.01::x16 :- + \+x1, + x2, + x5, + \+x6, + \+x7. + +0.84::x16 :- + x1, + \+x2, + x5, + \+x6, + \+x7. + +0.52::x16 :- + \+x1, + \+x2, + x5, + \+x6, + \+x7. + +0.15::x16 :- + x1, + x2, + \+x5, + \+x6, + \+x7. + +0.91::x16 :- + \+x1, + x2, + \+x5, + \+x6, + \+x7. + +0.61::x16 :- + x1, + \+x2, + \+x5, + \+x6, + \+x7. + +0.06::x16 :- + \+x1, + \+x2, + \+x5, + \+x6, + \+x7. + +0.80::x17 :- + x1, + x7, + x11, + x12, + x16. + +0.33::x17 :- + \+x1, + x7, + x11, + x12, + x16. + +0.75::x17 :- + x1, + \+x7, + x11, + x12, + x16. + +0.18::x17 :- + \+x1, + \+x7, + x11, + x12, + x16. + +0.01::x17 :- + x1, + x7, + \+x11, + x12, + x16. + +0.12::x17 :- + \+x1, + x7, + \+x11, + x12, + x16. + +0.89::x17 :- + x1, + \+x7, + \+x11, + x12, + x16. + +0.13::x17 :- + \+x1, + \+x7, + \+x11, + x12, + x16. + +0.64::x17 :- + x1, + x7, + x11, + \+x12, + x16. + +0.73::x17 :- + \+x1, + x7, + x11, + \+x12, + x16. + +0.70::x17 :- + x1, + \+x7, + x11, + \+x12, + x16. + +0.76::x17 :- + \+x1, + \+x7, + x11, + \+x12, + x16. + +0.61::x17 :- + x1, + x7, + \+x11, + \+x12, + x16. + +0.97::x17 :- + \+x1, + x7, + \+x11, + \+x12, + x16. + +0.41::x17 :- + x1, + \+x7, + \+x11, + \+x12, + x16. + +0.24::x17 :- + \+x1, + \+x7, + \+x11, + \+x12, + x16. + +0.61::x17 :- + x1, + x7, + x11, + x12, + \+x16. + +0.81::x17 :- + \+x1, + x7, + x11, + x12, + \+x16. + +0.97::x17 :- + x1, + \+x7, + x11, + x12, + \+x16. + +0.81::x17 :- + \+x1, + \+x7, + x11, + x12, + \+x16. + +0.54::x17 :- + x1, + x7, + \+x11, + x12, + \+x16. + +0.29::x17 :- + \+x1, + x7, + \+x11, + x12, + \+x16. + +0.64::x17 :- + x1, + \+x7, + \+x11, + x12, + \+x16. + +0.78::x17 :- + \+x1, + \+x7, + \+x11, + x12, + \+x16. + +0.70::x17 :- + x1, + x7, + x11, + \+x12, + \+x16. + +0.09::x17 :- + \+x1, + x7, + x11, + \+x12, + \+x16. + +0.23::x17 :- + x1, + \+x7, + x11, + \+x12, + \+x16. + +0.31::x17 :- + \+x1, + \+x7, + x11, + \+x12, + \+x16. + +0.66::x17 :- + x1, + x7, + \+x11, + \+x12, + \+x16. + +0.33::x17 :- + \+x1, + x7, + \+x11, + \+x12, + \+x16. + +0.50::x17 :- + x1, + \+x7, + \+x11, + \+x12, + \+x16. + +0.42::x17 :- + \+x1, + \+x7, + \+x11, + \+x12, + \+x16. + +0.19::x18 :- + x1, + x2, + x3, + x8, + x17. + +0.43::x18 :- + \+x1, + x2, + x3, + x8, + x17. + +0.69::x18 :- + x1, + \+x2, + x3, + x8, + x17. + +0.25::x18 :- + \+x1, + \+x2, + x3, + x8, + x17. + +0.78::x18 :- + x1, + x2, + \+x3, + x8, + x17. + +0.71::x18 :- + \+x1, + x2, + \+x3, + x8, + x17. + +0.14::x18 :- + x1, + \+x2, + \+x3, + x8, + x17. + +0.74::x18 :- + \+x1, + \+x2, + \+x3, + x8, + x17. + +0.89::x18 :- + x1, + x2, + x3, + \+x8, + x17. + +0.11::x18 :- + \+x1, + x2, + x3, + \+x8, + x17. + +0.15::x18 :- + x1, + \+x2, + x3, + \+x8, + x17. + +0.98::x18 :- + \+x1, + \+x2, + x3, + \+x8, + x17. + +0.97::x18 :- + x1, + x2, + \+x3, + \+x8, + x17. + +0.22::x18 :- + \+x1, + x2, + \+x3, + \+x8, + x17. + +0.21::x18 :- + x1, + \+x2, + \+x3, + \+x8, + x17. + +0.82::x18 :- + \+x1, + \+x2, + \+x3, + \+x8, + x17. + +0.00::x18 :- + x1, + x2, + x3, + x8, + \+x17. + +0.96::x18 :- + \+x1, + x2, + x3, + x8, + \+x17. + +0.72::x18 :- + x1, + \+x2, + x3, + x8, + \+x17. + +0.95::x18 :- + \+x1, + \+x2, + x3, + x8, + \+x17. + +0.20::x18 :- + x1, + x2, + \+x3, + x8, + \+x17. + +0.34::x18 :- + \+x1, + x2, + \+x3, + x8, + \+x17. + +0.66::x18 :- + x1, + \+x2, + \+x3, + x8, + \+x17. + +0.81::x18 :- + \+x1, + \+x2, + \+x3, + x8, + \+x17. + +0.96::x18 :- + x1, + x2, + x3, + \+x8, + \+x17. + +0.08::x18 :- + \+x1, + x2, + x3, + \+x8, + \+x17. + +0.69::x18 :- + x1, + \+x2, + x3, + \+x8, + \+x17. + +0.19::x18 :- + \+x1, + \+x2, + x3, + \+x8, + \+x17. + +0.76::x18 :- + x1, + x2, + \+x3, + \+x8, + \+x17. + +0.38::x18 :- + \+x1, + x2, + \+x3, + \+x8, + \+x17. + +0.35::x18 :- + x1, + \+x2, + \+x3, + \+x8, + \+x17. + +0.67::x18 :- + \+x1, + \+x2, + \+x3, + \+x8, + \+x17. + +0.99::x19 :- + x5, + x8, + x15, + x16, + x18. + +0.08::x19 :- + \+x5, + x8, + x15, + x16, + x18. + +0.47::x19 :- + x5, + \+x8, + x15, + x16, + x18. + +0.30::x19 :- + \+x5, + \+x8, + x15, + x16, + x18. + +0.91::x19 :- + x5, + x8, + \+x15, + x16, + x18. + +0.91::x19 :- + \+x5, + x8, + \+x15, + x16, + x18. + +0.65::x19 :- + x5, + \+x8, + \+x15, + x16, + x18. + +0.58::x19 :- + \+x5, + \+x8, + \+x15, + x16, + x18. + +0.62::x19 :- + x5, + x8, + x15, + \+x16, + x18. + +0.65::x19 :- + \+x5, + x8, + x15, + \+x16, + x18. + +0.40::x19 :- + x5, + \+x8, + x15, + \+x16, + x18. + +0.21::x19 :- + \+x5, + \+x8, + x15, + \+x16, + x18. + +0.33::x19 :- + x5, + x8, + \+x15, + \+x16, + x18. + +0.70::x19 :- + \+x5, + x8, + \+x15, + \+x16, + x18. + +0.76::x19 :- + x5, + \+x8, + \+x15, + \+x16, + x18. + +0.59::x19 :- + \+x5, + \+x8, + \+x15, + \+x16, + x18. + +0.54::x19 :- + x5, + x8, + x15, + x16, + \+x18. + +0.68::x19 :- + \+x5, + x8, + x15, + x16, + \+x18. + +0.24::x19 :- + x5, + \+x8, + x15, + x16, + \+x18. + +0.40::x19 :- + \+x5, + \+x8, + x15, + x16, + \+x18. + +0.97::x19 :- + x5, + x8, + \+x15, + x16, + \+x18. + +0.43::x19 :- + \+x5, + x8, + \+x15, + x16, + \+x18. + +0.91::x19 :- + x5, + \+x8, + \+x15, + x16, + \+x18. + +0.75::x19 :- + \+x5, + \+x8, + \+x15, + x16, + \+x18. + +0.42::x19 :- + x5, + x8, + x15, + \+x16, + \+x18. + +0.64::x19 :- + \+x5, + x8, + x15, + \+x16, + \+x18. + +0.53::x19 :- + x5, + \+x8, + x15, + \+x16, + \+x18. + +0.50::x19 :- + \+x5, + \+x8, + x15, + \+x16, + \+x18. + +0.01::x19 :- + x5, + x8, + \+x15, + \+x16, + \+x18. + +0.69::x19 :- + \+x5, + x8, + \+x15, + \+x16, + \+x18. + +0.44::x19 :- + x5, + \+x8, + \+x15, + \+x16, + \+x18. + +0.04::x19 :- + \+x5, + \+x8, + \+x15, + \+x16, + \+x18. + + +%% Queries + + +query(inst('https://lat.inf.tu-dresden.de/systems/born/born-example#i0', 'https://lat.inf.tu-dresden.de/systems/born/born-example#e')). + + + diff --git a/born-owlapi/src/test/resources/2/output_from_problog.txt b/born-owlapi/src/test/resources/2/output_from_problog.txt new file mode 100644 index 00000000..4dec7473 --- /dev/null +++ b/born-owlapi/src/test/resources/2/output_from_problog.txt @@ -0,0 +1 @@ +inst('https://lat.inf.tu-dresden.de/systems/born/born-example#i0','https://lat.inf.tu-dresden.de/systems/born/born-example#e'): 0.5691438 diff --git a/born-owlapi/src/test/resources/3/input_for_problog.txt b/born-owlapi/src/test/resources/3/input_for_problog.txt new file mode 100644 index 00000000..88ce22ef --- /dev/null +++ b/born-owlapi/src/test/resources/3/input_for_problog.txt @@ -0,0 +1,2537 @@ + +%% EL completion rules + + + +% Rules to interpret the queries +sub(X, B) :- +con(X), +con(B), +subx(X, B). +inst(X, B) :- +indiv(X), +con(B), +subx(X, B). +inst(R, X, B) :- +role(R), +indiv(X), +indiv(B), +subx(X, exists(R, A)), +subx(A, B). + +% Rules to process individuals +coni(X) :- con(X). +coni(X) :- indiv(X). + +% Basic rules for the completion +subx(X, X) :- coni(X). +subx(X, top) :- coni(X). +subx(X, B) :- gci(X, B). + +% EL complettion rules +subx(X, B) :- +gci(A, B), +subx(X, A), +coni(X), +coni(A), +coni(B). +subx(X, B) :- +gci(and(A1, A2), B), +subx(X, A1), +subx(X, A2), +coni(X), +coni(A1), +coni(A2), +coni(B). +subx(X, exists(R, B)) :- +gci(A, exists(R, B)), +subx(X, A), +coni(X), +coni(A), +coni(B), +role(R). +subx(X, B) :- +gci(exists(R, A), B), +subx(X, exists(R, Y)), +subx(Y, A), +coni(X), +coni(Y), +coni(A), +coni(B), +role(R). + +% Rules to avoid empty predicates of entities +con(-). +role(-). +indiv(-). + + +%% Ontology + +con('https://lat.inf.tu-dresden.de/systems/born/born-example#a'). +con('https://lat.inf.tu-dresden.de/systems/born/born-example#c'). +con('https://lat.inf.tu-dresden.de/systems/born/born-example#d'). +con('https://lat.inf.tu-dresden.de/systems/born/born-example#e'). +con('https://lat.inf.tu-dresden.de/systems/born/born-example#b'). +con('AuxiliaryEntity24'). +con('AuxiliaryEntity25'). +role('https://lat.inf.tu-dresden.de/systems/born/born-example#r'). +role('https://lat.inf.tu-dresden.de/systems/born/born-example#s'). +indiv('https://lat.inf.tu-dresden.de/systems/born/born-example#i0'). +indiv('https://lat.inf.tu-dresden.de/systems/born/born-example#i1'). +gci('AuxiliaryEntity24', 'https://lat.inf.tu-dresden.de/systems/born/born-example#i0'). +gci('https://lat.inf.tu-dresden.de/systems/born/born-example#i0', 'AuxiliaryEntity24'). +gci('https://lat.inf.tu-dresden.de/systems/born/born-example#a', 'https://lat.inf.tu-dresden.de/systems/born/born-example#c') :- x4. +gci('AuxiliaryEntity25', 'https://lat.inf.tu-dresden.de/systems/born/born-example#b') :- x5. +gci('AuxiliaryEntity24', 'https://lat.inf.tu-dresden.de/systems/born/born-example#a') :- x3. +gci(exists('https://lat.inf.tu-dresden.de/systems/born/born-example#r', 'https://lat.inf.tu-dresden.de/systems/born/born-example#b'), 'https://lat.inf.tu-dresden.de/systems/born/born-example#d') :- \+x2. +gci(and('https://lat.inf.tu-dresden.de/systems/born/born-example#c', 'https://lat.inf.tu-dresden.de/systems/born/born-example#d'), 'https://lat.inf.tu-dresden.de/systems/born/born-example#e') :- x5. +gci('https://lat.inf.tu-dresden.de/systems/born/born-example#b', exists('https://lat.inf.tu-dresden.de/systems/born/born-example#s', 'https://lat.inf.tu-dresden.de/systems/born/born-example#c')) :- \+x3. +gci('https://lat.inf.tu-dresden.de/systems/born/born-example#c', 'https://lat.inf.tu-dresden.de/systems/born/born-example#e') :- x3. +gci('https://lat.inf.tu-dresden.de/systems/born/born-example#i1', 'AuxiliaryEntity25'). +gci('AuxiliaryEntity25', 'https://lat.inf.tu-dresden.de/systems/born/born-example#i1'). +gci('https://lat.inf.tu-dresden.de/systems/born/born-example#a', exists('https://lat.inf.tu-dresden.de/systems/born/born-example#r', 'https://lat.inf.tu-dresden.de/systems/born/born-example#b')) :- x0. +gci('AuxiliaryEntity24', exists('https://lat.inf.tu-dresden.de/systems/born/born-example#r', 'AuxiliaryEntity25')) :- x4. + + +%% Bayesian Network + + +0.25::x0. + +0.84::x1 :- x0. + +0.27::x1 :- \+x0. + +0.77::x2 :- + x0, + x1. + +0.77::x2 :- + \+x0, + x1. + +0.45::x2 :- + x0, + \+x1. + +0.12::x2 :- + \+x0, + \+x1. + +0.88::x3 :- + x1, + x2. + +0.72::x3 :- + \+x1, + x2. + +0.00::x3 :- + x1, + \+x2. + +0.99::x3 :- + \+x1, + \+x2. + +0.42::x4 :- + x0, + x2, + x3. + +0.30::x4 :- + \+x0, + x2, + x3. + +0.01::x4 :- + x0, + \+x2, + x3. + +0.94::x4 :- + \+x0, + \+x2, + x3. + +0.98::x4 :- + x0, + x2, + \+x3. + +0.82::x4 :- + \+x0, + x2, + \+x3. + +0.18::x4 :- + x0, + \+x2, + \+x3. + +0.69::x4 :- + \+x0, + \+x2, + \+x3. + +0.64::x5 :- + x0, + x2, + x3. + +0.63::x5 :- + \+x0, + x2, + x3. + +0.26::x5 :- + x0, + \+x2, + x3. + +0.79::x5 :- + \+x0, + \+x2, + x3. + +0.66::x5 :- + x0, + x2, + \+x3. + +0.03::x5 :- + \+x0, + x2, + \+x3. + +0.62::x5 :- + x0, + \+x2, + \+x3. + +0.56::x5 :- + \+x0, + \+x2, + \+x3. + +0.21::x6 :- + x0, + x1, + x5. + +0.14::x6 :- + \+x0, + x1, + x5. + +0.21::x6 :- + x0, + \+x1, + x5. + +0.23::x6 :- + \+x0, + \+x1, + x5. + +0.51::x6 :- + x0, + x1, + \+x5. + +0.90::x6 :- + \+x0, + x1, + \+x5. + +0.47::x6 :- + x0, + \+x1, + \+x5. + +0.25::x6 :- + \+x0, + \+x1, + \+x5. + +0.82::x7 :- + x0, + x1, + x2, + x4. + +0.33::x7 :- + \+x0, + x1, + x2, + x4. + +0.47::x7 :- + x0, + \+x1, + x2, + x4. + +0.54::x7 :- + \+x0, + \+x1, + x2, + x4. + +0.52::x7 :- + x0, + x1, + \+x2, + x4. + +0.62::x7 :- + \+x0, + x1, + \+x2, + x4. + +0.28::x7 :- + x0, + \+x1, + \+x2, + x4. + +0.35::x7 :- + \+x0, + \+x1, + \+x2, + x4. + +0.58::x7 :- + x0, + x1, + x2, + \+x4. + +0.72::x7 :- + \+x0, + x1, + x2, + \+x4. + +0.12::x7 :- + x0, + \+x1, + x2, + \+x4. + +0.98::x7 :- + \+x0, + \+x1, + x2, + \+x4. + +0.81::x7 :- + x0, + x1, + \+x2, + \+x4. + +0.45::x7 :- + \+x0, + x1, + \+x2, + \+x4. + +0.67::x7 :- + x0, + \+x1, + \+x2, + \+x4. + +0.38::x7 :- + \+x0, + \+x1, + \+x2, + \+x4. + +0.00::x8 :- + x0, + x5, + x6, + x7. + +0.24::x8 :- + \+x0, + x5, + x6, + x7. + +0.16::x8 :- + x0, + \+x5, + x6, + x7. + +0.48::x8 :- + \+x0, + \+x5, + x6, + x7. + +0.60::x8 :- + x0, + x5, + \+x6, + x7. + +0.17::x8 :- + \+x0, + x5, + \+x6, + x7. + +0.91::x8 :- + x0, + \+x5, + \+x6, + x7. + +0.24::x8 :- + \+x0, + \+x5, + \+x6, + x7. + +0.37::x8 :- + x0, + x5, + x6, + \+x7. + +0.85::x8 :- + \+x0, + x5, + x6, + \+x7. + +0.12::x8 :- + x0, + \+x5, + x6, + \+x7. + +0.97::x8 :- + \+x0, + \+x5, + x6, + \+x7. + +0.07::x8 :- + x0, + x5, + \+x6, + \+x7. + +0.45::x8 :- + \+x0, + x5, + \+x6, + \+x7. + +0.76::x8 :- + x0, + \+x5, + \+x6, + \+x7. + +0.74::x8 :- + \+x0, + \+x5, + \+x6, + \+x7. + +0.55::x9 :- + x0, + x1, + x3, + x4. + +0.93::x9 :- + \+x0, + x1, + x3, + x4. + +0.43::x9 :- + x0, + \+x1, + x3, + x4. + +0.41::x9 :- + \+x0, + \+x1, + x3, + x4. + +0.81::x9 :- + x0, + x1, + \+x3, + x4. + +0.23::x9 :- + \+x0, + x1, + \+x3, + x4. + +0.96::x9 :- + x0, + \+x1, + \+x3, + x4. + +0.35::x9 :- + \+x0, + \+x1, + \+x3, + x4. + +0.20::x9 :- + x0, + x1, + x3, + \+x4. + +0.54::x9 :- + \+x0, + x1, + x3, + \+x4. + +0.06::x9 :- + x0, + \+x1, + x3, + \+x4. + +0.37::x9 :- + \+x0, + \+x1, + x3, + \+x4. + +0.52::x9 :- + x0, + x1, + \+x3, + \+x4. + +0.32::x9 :- + \+x0, + x1, + \+x3, + \+x4. + +0.21::x9 :- + x0, + \+x1, + \+x3, + \+x4. + +0.09::x9 :- + \+x0, + \+x1, + \+x3, + \+x4. + +0.48::x10 :- + x0, + x5, + x8, + x9. + +0.26::x10 :- + \+x0, + x5, + x8, + x9. + +0.71::x10 :- + x0, + \+x5, + x8, + x9. + +0.31::x10 :- + \+x0, + \+x5, + x8, + x9. + +0.59::x10 :- + x0, + x5, + \+x8, + x9. + +0.46::x10 :- + \+x0, + x5, + \+x8, + x9. + +0.10::x10 :- + x0, + \+x5, + \+x8, + x9. + +0.71::x10 :- + \+x0, + \+x5, + \+x8, + x9. + +0.47::x10 :- + x0, + x5, + x8, + \+x9. + +0.66::x10 :- + \+x0, + x5, + x8, + \+x9. + +0.03::x10 :- + x0, + \+x5, + x8, + \+x9. + +0.21::x10 :- + \+x0, + \+x5, + x8, + \+x9. + +0.40::x10 :- + x0, + x5, + \+x8, + \+x9. + +0.75::x10 :- + \+x0, + x5, + \+x8, + \+x9. + +0.62::x10 :- + x0, + \+x5, + \+x8, + \+x9. + +0.85::x10 :- + \+x0, + \+x5, + \+x8, + \+x9. + +0.54::x11 :- + x5, + x6, + x7, + x10. + +0.73::x11 :- + \+x5, + x6, + x7, + x10. + +0.90::x11 :- + x5, + \+x6, + x7, + x10. + +0.58::x11 :- + \+x5, + \+x6, + x7, + x10. + +0.19::x11 :- + x5, + x6, + \+x7, + x10. + +0.78::x11 :- + \+x5, + x6, + \+x7, + x10. + +0.33::x11 :- + x5, + \+x6, + \+x7, + x10. + +0.17::x11 :- + \+x5, + \+x6, + \+x7, + x10. + +0.09::x11 :- + x5, + x6, + x7, + \+x10. + +0.46::x11 :- + \+x5, + x6, + x7, + \+x10. + +0.44::x11 :- + x5, + \+x6, + x7, + \+x10. + +0.81::x11 :- + \+x5, + \+x6, + x7, + \+x10. + +0.24::x11 :- + x5, + x6, + \+x7, + \+x10. + +0.99::x11 :- + \+x5, + x6, + \+x7, + \+x10. + +0.63::x11 :- + x5, + \+x6, + \+x7, + \+x10. + +0.38::x11 :- + \+x5, + \+x6, + \+x7, + \+x10. + +0.07::x12 :- + x0, + x1, + x2, + x5, + x7. + +0.49::x12 :- + \+x0, + x1, + x2, + x5, + x7. + +0.66::x12 :- + x0, + \+x1, + x2, + x5, + x7. + +0.45::x12 :- + \+x0, + \+x1, + x2, + x5, + x7. + +0.96::x12 :- + x0, + x1, + \+x2, + x5, + x7. + +0.00::x12 :- + \+x0, + x1, + \+x2, + x5, + x7. + +0.24::x12 :- + x0, + \+x1, + \+x2, + x5, + x7. + +0.32::x12 :- + \+x0, + \+x1, + \+x2, + x5, + x7. + +0.74::x12 :- + x0, + x1, + x2, + \+x5, + x7. + +0.93::x12 :- + \+x0, + x1, + x2, + \+x5, + x7. + +0.31::x12 :- + x0, + \+x1, + x2, + \+x5, + x7. + +0.32::x12 :- + \+x0, + \+x1, + x2, + \+x5, + x7. + +0.58::x12 :- + x0, + x1, + \+x2, + \+x5, + x7. + +0.45::x12 :- + \+x0, + x1, + \+x2, + \+x5, + x7. + +0.08::x12 :- + x0, + \+x1, + \+x2, + \+x5, + x7. + +0.53::x12 :- + \+x0, + \+x1, + \+x2, + \+x5, + x7. + +0.06::x12 :- + x0, + x1, + x2, + x5, + \+x7. + +0.42::x12 :- + \+x0, + x1, + x2, + x5, + \+x7. + +0.83::x12 :- + x0, + \+x1, + x2, + x5, + \+x7. + +0.69::x12 :- + \+x0, + \+x1, + x2, + x5, + \+x7. + +0.72::x12 :- + x0, + x1, + \+x2, + x5, + \+x7. + +0.11::x12 :- + \+x0, + x1, + \+x2, + x5, + \+x7. + +0.96::x12 :- + x0, + \+x1, + \+x2, + x5, + \+x7. + +0.92::x12 :- + \+x0, + \+x1, + \+x2, + x5, + \+x7. + +0.04::x12 :- + x0, + x1, + x2, + \+x5, + \+x7. + +0.36::x12 :- + \+x0, + x1, + x2, + \+x5, + \+x7. + +0.52::x12 :- + x0, + \+x1, + x2, + \+x5, + \+x7. + +0.12::x12 :- + \+x0, + \+x1, + x2, + \+x5, + \+x7. + +0.00::x12 :- + x0, + x1, + \+x2, + \+x5, + \+x7. + +0.47::x12 :- + \+x0, + x1, + \+x2, + \+x5, + \+x7. + +0.70::x12 :- + x0, + \+x1, + \+x2, + \+x5, + \+x7. + +0.72::x12 :- + \+x0, + \+x1, + \+x2, + \+x5, + \+x7. + +0.09::x13 :- + x0, + x4, + x6, + x8, + x10. + +0.84::x13 :- + \+x0, + x4, + x6, + x8, + x10. + +0.59::x13 :- + x0, + \+x4, + x6, + x8, + x10. + +0.62::x13 :- + \+x0, + \+x4, + x6, + x8, + x10. + +0.32::x13 :- + x0, + x4, + \+x6, + x8, + x10. + +0.20::x13 :- + \+x0, + x4, + \+x6, + x8, + x10. + +0.72::x13 :- + x0, + \+x4, + \+x6, + x8, + x10. + +0.16::x13 :- + \+x0, + \+x4, + \+x6, + x8, + x10. + +0.75::x13 :- + x0, + x4, + x6, + \+x8, + x10. + +0.07::x13 :- + \+x0, + x4, + x6, + \+x8, + x10. + +0.02::x13 :- + x0, + \+x4, + x6, + \+x8, + x10. + +0.79::x13 :- + \+x0, + \+x4, + x6, + \+x8, + x10. + +0.59::x13 :- + x0, + x4, + \+x6, + \+x8, + x10. + +0.84::x13 :- + \+x0, + x4, + \+x6, + \+x8, + x10. + +0.37::x13 :- + x0, + \+x4, + \+x6, + \+x8, + x10. + +0.21::x13 :- + \+x0, + \+x4, + \+x6, + \+x8, + x10. + +0.98::x13 :- + x0, + x4, + x6, + x8, + \+x10. + +0.07::x13 :- + \+x0, + x4, + x6, + x8, + \+x10. + +0.03::x13 :- + x0, + \+x4, + x6, + x8, + \+x10. + +0.48::x13 :- + \+x0, + \+x4, + x6, + x8, + \+x10. + +0.24::x13 :- + x0, + x4, + \+x6, + x8, + \+x10. + +0.55::x13 :- + \+x0, + x4, + \+x6, + x8, + \+x10. + +0.58::x13 :- + x0, + \+x4, + \+x6, + x8, + \+x10. + +0.46::x13 :- + \+x0, + \+x4, + \+x6, + x8, + \+x10. + +0.37::x13 :- + x0, + x4, + x6, + \+x8, + \+x10. + +0.16::x13 :- + \+x0, + x4, + x6, + \+x8, + \+x10. + +0.76::x13 :- + x0, + \+x4, + x6, + \+x8, + \+x10. + +0.50::x13 :- + \+x0, + \+x4, + x6, + \+x8, + \+x10. + +0.96::x13 :- + x0, + x4, + \+x6, + \+x8, + \+x10. + +0.03::x13 :- + \+x0, + x4, + \+x6, + \+x8, + \+x10. + +0.05::x13 :- + x0, + \+x4, + \+x6, + \+x8, + \+x10. + +0.67::x13 :- + \+x0, + \+x4, + \+x6, + \+x8, + \+x10. + +0.94::x14 :- + x2, + x10, + x11, + x12, + x13. + +0.88::x14 :- + \+x2, + x10, + x11, + x12, + x13. + +0.78::x14 :- + x2, + \+x10, + x11, + x12, + x13. + +0.82::x14 :- + \+x2, + \+x10, + x11, + x12, + x13. + +0.37::x14 :- + x2, + x10, + \+x11, + x12, + x13. + +0.28::x14 :- + \+x2, + x10, + \+x11, + x12, + x13. + +0.22::x14 :- + x2, + \+x10, + \+x11, + x12, + x13. + +0.61::x14 :- + \+x2, + \+x10, + \+x11, + x12, + x13. + +0.45::x14 :- + x2, + x10, + x11, + \+x12, + x13. + +0.75::x14 :- + \+x2, + x10, + x11, + \+x12, + x13. + +0.32::x14 :- + x2, + \+x10, + x11, + \+x12, + x13. + +0.36::x14 :- + \+x2, + \+x10, + x11, + \+x12, + x13. + +0.60::x14 :- + x2, + x10, + \+x11, + \+x12, + x13. + +0.26::x14 :- + \+x2, + x10, + \+x11, + \+x12, + x13. + +0.19::x14 :- + x2, + \+x10, + \+x11, + \+x12, + x13. + +0.80::x14 :- + \+x2, + \+x10, + \+x11, + \+x12, + x13. + +0.96::x14 :- + x2, + x10, + x11, + x12, + \+x13. + +0.67::x14 :- + \+x2, + x10, + x11, + x12, + \+x13. + +0.20::x14 :- + x2, + \+x10, + x11, + x12, + \+x13. + +0.22::x14 :- + \+x2, + \+x10, + x11, + x12, + \+x13. + +0.70::x14 :- + x2, + x10, + \+x11, + x12, + \+x13. + +0.64::x14 :- + \+x2, + x10, + \+x11, + x12, + \+x13. + +0.43::x14 :- + x2, + \+x10, + \+x11, + x12, + \+x13. + +0.45::x14 :- + \+x2, + \+x10, + \+x11, + x12, + \+x13. + +0.77::x14 :- + x2, + x10, + x11, + \+x12, + \+x13. + +0.44::x14 :- + \+x2, + x10, + x11, + \+x12, + \+x13. + +0.87::x14 :- + x2, + \+x10, + x11, + \+x12, + \+x13. + +0.72::x14 :- + \+x2, + \+x10, + x11, + \+x12, + \+x13. + +0.08::x14 :- + x2, + x10, + \+x11, + \+x12, + \+x13. + +0.73::x14 :- + \+x2, + x10, + \+x11, + \+x12, + \+x13. + +0.12::x14 :- + x2, + \+x10, + \+x11, + \+x12, + \+x13. + +0.80::x14 :- + \+x2, + \+x10, + \+x11, + \+x12, + \+x13. + +0.50::x15 :- + x0, + x1, + x5, + x8, + x14. + +0.87::x15 :- + \+x0, + x1, + x5, + x8, + x14. + +0.67::x15 :- + x0, + \+x1, + x5, + x8, + x14. + +0.58::x15 :- + \+x0, + \+x1, + x5, + x8, + x14. + +0.80::x15 :- + x0, + x1, + \+x5, + x8, + x14. + +0.13::x15 :- + \+x0, + x1, + \+x5, + x8, + x14. + +0.56::x15 :- + x0, + \+x1, + \+x5, + x8, + x14. + +0.43::x15 :- + \+x0, + \+x1, + \+x5, + x8, + x14. + +0.73::x15 :- + x0, + x1, + x5, + \+x8, + x14. + +0.78::x15 :- + \+x0, + x1, + x5, + \+x8, + x14. + +0.28::x15 :- + x0, + \+x1, + x5, + \+x8, + x14. + +0.34::x15 :- + \+x0, + \+x1, + x5, + \+x8, + x14. + +0.54::x15 :- + x0, + x1, + \+x5, + \+x8, + x14. + +0.56::x15 :- + \+x0, + x1, + \+x5, + \+x8, + x14. + +0.14::x15 :- + x0, + \+x1, + \+x5, + \+x8, + x14. + +0.76::x15 :- + \+x0, + \+x1, + \+x5, + \+x8, + x14. + +0.72::x15 :- + x0, + x1, + x5, + x8, + \+x14. + +0.73::x15 :- + \+x0, + x1, + x5, + x8, + \+x14. + +0.20::x15 :- + x0, + \+x1, + x5, + x8, + \+x14. + +0.02::x15 :- + \+x0, + \+x1, + x5, + x8, + \+x14. + +0.35::x15 :- + x0, + x1, + \+x5, + x8, + \+x14. + +0.50::x15 :- + \+x0, + x1, + \+x5, + x8, + \+x14. + +0.24::x15 :- + x0, + \+x1, + \+x5, + x8, + \+x14. + +0.23::x15 :- + \+x0, + \+x1, + \+x5, + x8, + \+x14. + +0.44::x15 :- + x0, + x1, + x5, + \+x8, + \+x14. + +0.06::x15 :- + \+x0, + x1, + x5, + \+x8, + \+x14. + +0.60::x15 :- + x0, + \+x1, + x5, + \+x8, + \+x14. + +0.46::x15 :- + \+x0, + \+x1, + x5, + \+x8, + \+x14. + +0.98::x15 :- + x0, + x1, + \+x5, + \+x8, + \+x14. + +0.23::x15 :- + \+x0, + x1, + \+x5, + \+x8, + \+x14. + +0.39::x15 :- + x0, + \+x1, + \+x5, + \+x8, + \+x14. + +0.58::x15 :- + \+x0, + \+x1, + \+x5, + \+x8, + \+x14. + +0.58::x16 :- + x1, + x2, + x5, + x6, + x7. + +0.33::x16 :- + \+x1, + x2, + x5, + x6, + x7. + +0.91::x16 :- + x1, + \+x2, + x5, + x6, + x7. + +0.42::x16 :- + \+x1, + \+x2, + x5, + x6, + x7. + +0.91::x16 :- + x1, + x2, + \+x5, + x6, + x7. + +0.49::x16 :- + \+x1, + x2, + \+x5, + x6, + x7. + +0.09::x16 :- + x1, + \+x2, + \+x5, + x6, + x7. + +0.11::x16 :- + \+x1, + \+x2, + \+x5, + x6, + x7. + +0.29::x16 :- + x1, + x2, + x5, + \+x6, + x7. + +0.62::x16 :- + \+x1, + x2, + x5, + \+x6, + x7. + +0.46::x16 :- + x1, + \+x2, + x5, + \+x6, + x7. + +0.66::x16 :- + \+x1, + \+x2, + x5, + \+x6, + x7. + +0.47::x16 :- + x1, + x2, + \+x5, + \+x6, + x7. + +0.87::x16 :- + \+x1, + x2, + \+x5, + \+x6, + x7. + +0.47::x16 :- + x1, + \+x2, + \+x5, + \+x6, + x7. + +0.18::x16 :- + \+x1, + \+x2, + \+x5, + \+x6, + x7. + +0.42::x16 :- + x1, + x2, + x5, + x6, + \+x7. + +0.26::x16 :- + \+x1, + x2, + x5, + x6, + \+x7. + +0.72::x16 :- + x1, + \+x2, + x5, + x6, + \+x7. + +0.31::x16 :- + \+x1, + \+x2, + x5, + x6, + \+x7. + +0.92::x16 :- + x1, + x2, + \+x5, + x6, + \+x7. + +0.38::x16 :- + \+x1, + x2, + \+x5, + x6, + \+x7. + +0.50::x16 :- + x1, + \+x2, + \+x5, + x6, + \+x7. + +0.69::x16 :- + \+x1, + \+x2, + \+x5, + x6, + \+x7. + +0.95::x16 :- + x1, + x2, + x5, + \+x6, + \+x7. + +0.01::x16 :- + \+x1, + x2, + x5, + \+x6, + \+x7. + +0.84::x16 :- + x1, + \+x2, + x5, + \+x6, + \+x7. + +0.52::x16 :- + \+x1, + \+x2, + x5, + \+x6, + \+x7. + +0.15::x16 :- + x1, + x2, + \+x5, + \+x6, + \+x7. + +0.91::x16 :- + \+x1, + x2, + \+x5, + \+x6, + \+x7. + +0.61::x16 :- + x1, + \+x2, + \+x5, + \+x6, + \+x7. + +0.06::x16 :- + \+x1, + \+x2, + \+x5, + \+x6, + \+x7. + +0.80::x17 :- + x1, + x7, + x11, + x12, + x16. + +0.33::x17 :- + \+x1, + x7, + x11, + x12, + x16. + +0.75::x17 :- + x1, + \+x7, + x11, + x12, + x16. + +0.18::x17 :- + \+x1, + \+x7, + x11, + x12, + x16. + +0.01::x17 :- + x1, + x7, + \+x11, + x12, + x16. + +0.12::x17 :- + \+x1, + x7, + \+x11, + x12, + x16. + +0.89::x17 :- + x1, + \+x7, + \+x11, + x12, + x16. + +0.13::x17 :- + \+x1, + \+x7, + \+x11, + x12, + x16. + +0.64::x17 :- + x1, + x7, + x11, + \+x12, + x16. + +0.73::x17 :- + \+x1, + x7, + x11, + \+x12, + x16. + +0.70::x17 :- + x1, + \+x7, + x11, + \+x12, + x16. + +0.76::x17 :- + \+x1, + \+x7, + x11, + \+x12, + x16. + +0.61::x17 :- + x1, + x7, + \+x11, + \+x12, + x16. + +0.97::x17 :- + \+x1, + x7, + \+x11, + \+x12, + x16. + +0.41::x17 :- + x1, + \+x7, + \+x11, + \+x12, + x16. + +0.24::x17 :- + \+x1, + \+x7, + \+x11, + \+x12, + x16. + +0.61::x17 :- + x1, + x7, + x11, + x12, + \+x16. + +0.81::x17 :- + \+x1, + x7, + x11, + x12, + \+x16. + +0.97::x17 :- + x1, + \+x7, + x11, + x12, + \+x16. + +0.81::x17 :- + \+x1, + \+x7, + x11, + x12, + \+x16. + +0.54::x17 :- + x1, + x7, + \+x11, + x12, + \+x16. + +0.29::x17 :- + \+x1, + x7, + \+x11, + x12, + \+x16. + +0.64::x17 :- + x1, + \+x7, + \+x11, + x12, + \+x16. + +0.78::x17 :- + \+x1, + \+x7, + \+x11, + x12, + \+x16. + +0.70::x17 :- + x1, + x7, + x11, + \+x12, + \+x16. + +0.09::x17 :- + \+x1, + x7, + x11, + \+x12, + \+x16. + +0.23::x17 :- + x1, + \+x7, + x11, + \+x12, + \+x16. + +0.31::x17 :- + \+x1, + \+x7, + x11, + \+x12, + \+x16. + +0.66::x17 :- + x1, + x7, + \+x11, + \+x12, + \+x16. + +0.33::x17 :- + \+x1, + x7, + \+x11, + \+x12, + \+x16. + +0.50::x17 :- + x1, + \+x7, + \+x11, + \+x12, + \+x16. + +0.42::x17 :- + \+x1, + \+x7, + \+x11, + \+x12, + \+x16. + +0.19::x18 :- + x1, + x2, + x3, + x8, + x17. + +0.43::x18 :- + \+x1, + x2, + x3, + x8, + x17. + +0.69::x18 :- + x1, + \+x2, + x3, + x8, + x17. + +0.25::x18 :- + \+x1, + \+x2, + x3, + x8, + x17. + +0.78::x18 :- + x1, + x2, + \+x3, + x8, + x17. + +0.71::x18 :- + \+x1, + x2, + \+x3, + x8, + x17. + +0.14::x18 :- + x1, + \+x2, + \+x3, + x8, + x17. + +0.74::x18 :- + \+x1, + \+x2, + \+x3, + x8, + x17. + +0.89::x18 :- + x1, + x2, + x3, + \+x8, + x17. + +0.11::x18 :- + \+x1, + x2, + x3, + \+x8, + x17. + +0.15::x18 :- + x1, + \+x2, + x3, + \+x8, + x17. + +0.98::x18 :- + \+x1, + \+x2, + x3, + \+x8, + x17. + +0.97::x18 :- + x1, + x2, + \+x3, + \+x8, + x17. + +0.22::x18 :- + \+x1, + x2, + \+x3, + \+x8, + x17. + +0.21::x18 :- + x1, + \+x2, + \+x3, + \+x8, + x17. + +0.82::x18 :- + \+x1, + \+x2, + \+x3, + \+x8, + x17. + +0.00::x18 :- + x1, + x2, + x3, + x8, + \+x17. + +0.96::x18 :- + \+x1, + x2, + x3, + x8, + \+x17. + +0.72::x18 :- + x1, + \+x2, + x3, + x8, + \+x17. + +0.95::x18 :- + \+x1, + \+x2, + x3, + x8, + \+x17. + +0.20::x18 :- + x1, + x2, + \+x3, + x8, + \+x17. + +0.34::x18 :- + \+x1, + x2, + \+x3, + x8, + \+x17. + +0.66::x18 :- + x1, + \+x2, + \+x3, + x8, + \+x17. + +0.81::x18 :- + \+x1, + \+x2, + \+x3, + x8, + \+x17. + +0.96::x18 :- + x1, + x2, + x3, + \+x8, + \+x17. + +0.08::x18 :- + \+x1, + x2, + x3, + \+x8, + \+x17. + +0.69::x18 :- + x1, + \+x2, + x3, + \+x8, + \+x17. + +0.19::x18 :- + \+x1, + \+x2, + x3, + \+x8, + \+x17. + +0.76::x18 :- + x1, + x2, + \+x3, + \+x8, + \+x17. + +0.38::x18 :- + \+x1, + x2, + \+x3, + \+x8, + \+x17. + +0.35::x18 :- + x1, + \+x2, + \+x3, + \+x8, + \+x17. + +0.67::x18 :- + \+x1, + \+x2, + \+x3, + \+x8, + \+x17. + +0.99::x19 :- + x5, + x8, + x15, + x16, + x18. + +0.08::x19 :- + \+x5, + x8, + x15, + x16, + x18. + +0.47::x19 :- + x5, + \+x8, + x15, + x16, + x18. + +0.30::x19 :- + \+x5, + \+x8, + x15, + x16, + x18. + +0.91::x19 :- + x5, + x8, + \+x15, + x16, + x18. + +0.91::x19 :- + \+x5, + x8, + \+x15, + x16, + x18. + +0.65::x19 :- + x5, + \+x8, + \+x15, + x16, + x18. + +0.58::x19 :- + \+x5, + \+x8, + \+x15, + x16, + x18. + +0.62::x19 :- + x5, + x8, + x15, + \+x16, + x18. + +0.65::x19 :- + \+x5, + x8, + x15, + \+x16, + x18. + +0.40::x19 :- + x5, + \+x8, + x15, + \+x16, + x18. + +0.21::x19 :- + \+x5, + \+x8, + x15, + \+x16, + x18. + +0.33::x19 :- + x5, + x8, + \+x15, + \+x16, + x18. + +0.70::x19 :- + \+x5, + x8, + \+x15, + \+x16, + x18. + +0.76::x19 :- + x5, + \+x8, + \+x15, + \+x16, + x18. + +0.59::x19 :- + \+x5, + \+x8, + \+x15, + \+x16, + x18. + +0.54::x19 :- + x5, + x8, + x15, + x16, + \+x18. + +0.68::x19 :- + \+x5, + x8, + x15, + x16, + \+x18. + +0.24::x19 :- + x5, + \+x8, + x15, + x16, + \+x18. + +0.40::x19 :- + \+x5, + \+x8, + x15, + x16, + \+x18. + +0.97::x19 :- + x5, + x8, + \+x15, + x16, + \+x18. + +0.43::x19 :- + \+x5, + x8, + \+x15, + x16, + \+x18. + +0.91::x19 :- + x5, + \+x8, + \+x15, + x16, + \+x18. + +0.75::x19 :- + \+x5, + \+x8, + \+x15, + x16, + \+x18. + +0.42::x19 :- + x5, + x8, + x15, + \+x16, + \+x18. + +0.64::x19 :- + \+x5, + x8, + x15, + \+x16, + \+x18. + +0.53::x19 :- + x5, + \+x8, + x15, + \+x16, + \+x18. + +0.50::x19 :- + \+x5, + \+x8, + x15, + \+x16, + \+x18. + +0.01::x19 :- + x5, + x8, + \+x15, + \+x16, + \+x18. + +0.69::x19 :- + \+x5, + x8, + \+x15, + \+x16, + \+x18. + +0.44::x19 :- + x5, + \+x8, + \+x15, + \+x16, + \+x18. + +0.04::x19 :- + \+x5, + \+x8, + \+x15, + \+x16, + \+x18. + + +%% Queries + + +query(inst('https://lat.inf.tu-dresden.de/systems/born/born-example#r', 'https://lat.inf.tu-dresden.de/systems/born/born-example#i0', 'https://lat.inf.tu-dresden.de/systems/born/born-example#i1')). + + + diff --git a/born-owlapi/src/test/resources/3/output_from_problog.txt b/born-owlapi/src/test/resources/3/output_from_problog.txt new file mode 100644 index 00000000..b0d97f4e --- /dev/null +++ b/born-owlapi/src/test/resources/3/output_from_problog.txt @@ -0,0 +1 @@ +inst('https://lat.inf.tu-dresden.de/systems/born/born-example#r','https://lat.inf.tu-dresden.de/systems/born/born-example#i0','https://lat.inf.tu-dresden.de/systems/born/born-example#i1'): 0.66772143 diff --git a/born-owlapi/src/test/resources/4/input_for_problog.txt b/born-owlapi/src/test/resources/4/input_for_problog.txt new file mode 100644 index 00000000..8b2aa261 --- /dev/null +++ b/born-owlapi/src/test/resources/4/input_for_problog.txt @@ -0,0 +1,216 @@ + +%% EL completion rules + + + +% Rules to interpret the queries +sub(X, B) :- +con(X), +con(B), +subx(X, B). +inst(X, B) :- +indiv(X), +con(B), +subx(X, B). +inst(R, X, B) :- +role(R), +indiv(X), +indiv(B), +subx(X, exists(R, A)), +subx(A, B). + +% Rules to process individuals +coni(X) :- con(X). +coni(X) :- indiv(X). + +% Basic rules for the completion +subx(X, X) :- coni(X). +subx(X, top) :- coni(X). +subx(X, B) :- gci(X, B). + +% EL complettion rules +subx(X, B) :- +gci(A, B), +subx(X, A), +coni(X), +coni(A), +coni(B). +subx(X, B) :- +gci(and(A1, A2), B), +subx(X, A1), +subx(X, A2), +coni(X), +coni(A1), +coni(A2), +coni(B). +subx(X, exists(R, B)) :- +gci(A, exists(R, B)), +subx(X, A), +coni(X), +coni(A), +coni(B), +role(R). +subx(X, B) :- +gci(exists(R, A), B), +subx(X, exists(R, Y)), +subx(Y, A), +coni(X), +coni(Y), +coni(A), +coni(B), +role(R). + +% Rules to avoid empty predicates of entities +con(-). +role(-). +indiv(-). + + +%% Ontology + +con('https://lat.inf.tu-dresden.de/systems/born/born-example#a'). +con('https://lat.inf.tu-dresden.de/systems/born/born-example#b'). +con('AuxiliaryEntity16'). +con('AuxiliaryEntity17'). +role('https://lat.inf.tu-dresden.de/systems/born/born-example#r'). +indiv('https://lat.inf.tu-dresden.de/systems/born/born-example#i0'). +indiv('https://lat.inf.tu-dresden.de/systems/born/born-example#i1'). +gci('https://lat.inf.tu-dresden.de/systems/born/born-example#i1', 'AuxiliaryEntity17'). +gci('AuxiliaryEntity17', 'https://lat.inf.tu-dresden.de/systems/born/born-example#i1'). +gci('AuxiliaryEntity16', exists('https://lat.inf.tu-dresden.de/systems/born/born-example#r', 'AuxiliaryEntity17')) :- x0. +gci('AuxiliaryEntity17', 'https://lat.inf.tu-dresden.de/systems/born/born-example#b') :- x5. +gci('AuxiliaryEntity16', 'https://lat.inf.tu-dresden.de/systems/born/born-example#i0'). +gci('https://lat.inf.tu-dresden.de/systems/born/born-example#i0', 'AuxiliaryEntity16'). +gci('AuxiliaryEntity16', 'https://lat.inf.tu-dresden.de/systems/born/born-example#a') :- x3. + + +%% Bayesian Network + + +0.25::x0. + +0.84::x1 :- x0. + +0.27::x1 :- \+x0. + +0.77::x2 :- + x0, + x1. + +0.77::x2 :- + \+x0, + x1. + +0.45::x2 :- + x0, + \+x1. + +0.12::x2 :- + \+x0, + \+x1. + +0.88::x3 :- + x1, + x2. + +0.72::x3 :- + \+x1, + x2. + +0.00::x3 :- + x1, + \+x2. + +0.99::x3 :- + \+x1, + \+x2. + +0.42::x4 :- + x0, + x2, + x3. + +0.30::x4 :- + \+x0, + x2, + x3. + +0.01::x4 :- + x0, + \+x2, + x3. + +0.94::x4 :- + \+x0, + \+x2, + x3. + +0.98::x4 :- + x0, + x2, + \+x3. + +0.82::x4 :- + \+x0, + x2, + \+x3. + +0.18::x4 :- + x0, + \+x2, + \+x3. + +0.69::x4 :- + \+x0, + \+x2, + \+x3. + +0.64::x5 :- + x0, + x2, + x3. + +0.63::x5 :- + \+x0, + x2, + x3. + +0.26::x5 :- + x0, + \+x2, + x3. + +0.79::x5 :- + \+x0, + \+x2, + x3. + +0.66::x5 :- + x0, + x2, + \+x3. + +0.03::x5 :- + \+x0, + x2, + \+x3. + +0.62::x5 :- + x0, + \+x2, + \+x3. + +0.56::x5 :- + \+x0, + \+x2, + \+x3. + + + +%% Queries + + +query(inst('https://lat.inf.tu-dresden.de/systems/born/born-example#r', 'https://lat.inf.tu-dresden.de/systems/born/born-example#i0', 'https://lat.inf.tu-dresden.de/systems/born/born-example#i1')). + + + diff --git a/born-owlapi/src/test/resources/4/output_from_problog.txt b/born-owlapi/src/test/resources/4/output_from_problog.txt new file mode 100644 index 00000000..374f75ce --- /dev/null +++ b/born-owlapi/src/test/resources/4/output_from_problog.txt @@ -0,0 +1 @@ +inst('https://lat.inf.tu-dresden.de/systems/born/born-example#r','https://lat.inf.tu-dresden.de/systems/born/born-example#i0','https://lat.inf.tu-dresden.de/systems/born/born-example#i1'): 0.25 diff --git a/born-owlapi/src/test/resources/5/input_for_problog.txt b/born-owlapi/src/test/resources/5/input_for_problog.txt new file mode 100644 index 00000000..c7de2d41 --- /dev/null +++ b/born-owlapi/src/test/resources/5/input_for_problog.txt @@ -0,0 +1,114 @@ + +%% EL completion rules + + + +% Rules to interpret the queries +sub(X, B) :- +con(X), +con(B), +subx(X, B). +inst(X, B) :- +indiv(X), +con(B), +subx(X, B). +inst(R, X, B) :- +role(R), +indiv(X), +indiv(B), +subx(X, exists(R, A)), +subx(A, B). + +% Rules to process individuals +coni(X) :- con(X). +coni(X) :- indiv(X). + +% Basic rules for the completion +subx(X, X) :- coni(X). +subx(X, top) :- coni(X). +subx(X, B) :- gci(X, B). + +% EL complettion rules +subx(X, B) :- +gci(A, B), +subx(X, A), +coni(X), +coni(A), +coni(B). +subx(X, B) :- +gci(and(A1, A2), B), +subx(X, A1), +subx(X, A2), +coni(X), +coni(A1), +coni(A2), +coni(B). +subx(X, exists(R, B)) :- +gci(A, exists(R, B)), +subx(X, A), +coni(X), +coni(A), +coni(B), +role(R). +subx(X, B) :- +gci(exists(R, A), B), +subx(X, exists(R, Y)), +subx(Y, A), +coni(X), +coni(Y), +coni(A), +coni(B), +role(R). + +% Rules to avoid empty predicates of entities +con(-). +role(-). +indiv(-). + + +%% Ontology + +con('https://lat.inf.tu-dresden.de/systems/born/born-example#a'). +con('https://lat.inf.tu-dresden.de/systems/born/born-example#b'). +con('https://lat.inf.tu-dresden.de/systems/born/born-example#c'). +con('https://lat.inf.tu-dresden.de/systems/born/born-example#d'). +role('https://lat.inf.tu-dresden.de/systems/born/born-example#r'). +gci(exists('https://lat.inf.tu-dresden.de/systems/born/born-example#r', 'https://lat.inf.tu-dresden.de/systems/born/born-example#c'), 'https://lat.inf.tu-dresden.de/systems/born/born-example#d') :- x0. +gci('https://lat.inf.tu-dresden.de/systems/born/born-example#b', 'https://lat.inf.tu-dresden.de/systems/born/born-example#c') :- x0. +gci('https://lat.inf.tu-dresden.de/systems/born/born-example#a', exists('https://lat.inf.tu-dresden.de/systems/born/born-example#r', 'https://lat.inf.tu-dresden.de/systems/born/born-example#b')) :- x0. + + +%% Bayesian Network + + +0.25::x0. + +0.84::x1 :- x0. + +0.27::x1 :- \+x0. + +0.77::x2 :- + x0, + x1. + +0.77::x2 :- + \+x0, + x1. + +0.45::x2 :- + x0, + \+x1. + +0.12::x2 :- + \+x0, + \+x1. + + + +%% Queries + + +query(sub('https://lat.inf.tu-dresden.de/systems/born/born-example#a', 'https://lat.inf.tu-dresden.de/systems/born/born-example#d')). + + + diff --git a/born-owlapi/src/test/resources/5/output_from_problog.txt b/born-owlapi/src/test/resources/5/output_from_problog.txt new file mode 100644 index 00000000..cd55accb --- /dev/null +++ b/born-owlapi/src/test/resources/5/output_from_problog.txt @@ -0,0 +1 @@ +sub('https://lat.inf.tu-dresden.de/systems/born/born-example#a','https://lat.inf.tu-dresden.de/systems/born/born-example#d'): 0.25