diff options
Diffstat (limited to 'src/uk/ac/ox/cs/pagoda/rules/DatalogProgram.java')
| -rw-r--r-- | src/uk/ac/ox/cs/pagoda/rules/DatalogProgram.java | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/src/uk/ac/ox/cs/pagoda/rules/DatalogProgram.java b/src/uk/ac/ox/cs/pagoda/rules/DatalogProgram.java new file mode 100644 index 0000000..1f7148c --- /dev/null +++ b/src/uk/ac/ox/cs/pagoda/rules/DatalogProgram.java | |||
| @@ -0,0 +1,64 @@ | |||
| 1 | package uk.ac.ox.cs.pagoda.rules; | ||
| 2 | |||
| 3 | import org.semanticweb.owlapi.model.OWLOntology; | ||
| 4 | |||
| 5 | import uk.ac.ox.cs.pagoda.constraints.*; | ||
| 6 | |||
| 7 | public class DatalogProgram { | ||
| 8 | |||
| 9 | UpperDatalogProgram upperProgram = new UpperDatalogProgram(); | ||
| 10 | LowerDatalogProgram lowerProgram; | ||
| 11 | GeneralProgram program = new GeneralProgram(); | ||
| 12 | |||
| 13 | BottomStrategy upperBottom; | ||
| 14 | |||
| 15 | public DatalogProgram(OWLOntology o) { | ||
| 16 | lowerProgram = new LowerDatalogProgram(); | ||
| 17 | init(o, false); | ||
| 18 | } | ||
| 19 | |||
| 20 | public DatalogProgram(OWLOntology o, boolean toClassify) { | ||
| 21 | lowerProgram = new LowerDatalogProgram(toClassify); | ||
| 22 | init(o, toClassify); | ||
| 23 | } | ||
| 24 | |||
| 25 | private void init(OWLOntology o, boolean forSemFacet) { | ||
| 26 | upperProgram.load(o, upperBottom = new UpperUnaryBottom()); | ||
| 27 | // upperProgram.load(o, upperBottom = new UnaryBottom()); | ||
| 28 | lowerProgram.clone(upperProgram); | ||
| 29 | program.clone(upperProgram); | ||
| 30 | // program.botStrategy = new UnaryBottom(); | ||
| 31 | |||
| 32 | upperProgram.transform(); | ||
| 33 | lowerProgram.transform(); | ||
| 34 | program.transform(); | ||
| 35 | |||
| 36 | program.buildDependencyGraph(); | ||
| 37 | PredicateDependency graph = upperProgram.buildDependencyGraph(); | ||
| 38 | lowerProgram.dependencyGraph = graph; | ||
| 39 | } | ||
| 40 | |||
| 41 | public LowerDatalogProgram getLower() { | ||
| 42 | return lowerProgram; | ||
| 43 | } | ||
| 44 | |||
| 45 | public UpperDatalogProgram getUpper() { | ||
| 46 | return upperProgram; | ||
| 47 | } | ||
| 48 | |||
| 49 | public GeneralProgram getGeneral() { | ||
| 50 | return program; | ||
| 51 | } | ||
| 52 | |||
| 53 | public String getAdditionalDataFile() { | ||
| 54 | return upperProgram.getAdditionalDataFile(); | ||
| 55 | } | ||
| 56 | |||
| 57 | public BottomStrategy getUpperBottomStrategy() { | ||
| 58 | return upperBottom; | ||
| 59 | } | ||
| 60 | |||
| 61 | public void deleteABoxTurtleFile() { | ||
| 62 | if (upperProgram != null) upperProgram.deleteABoxTurtleFile(); | ||
| 63 | } | ||
| 64 | } | ||
