diff options
| author | Federico Igne <federico.igne@cs.ox.ac.uk> | 2022-05-10 18:17:06 +0100 |
|---|---|---|
| committer | Federico Igne <federico.igne@cs.ox.ac.uk> | 2022-05-11 12:34:47 +0100 |
| commit | 17bd9beaf7f358a44e5bf36a5855fe6727d506dc (patch) | |
| tree | 47e9310a0cff869d9ec017dcb2c81876407782c8 /src/uk/ac/ox/cs/pagoda/rules/DatalogProgram.java | |
| parent | 8651164cd632a5db310b457ce32d4fbc97bdc41c (diff) | |
| download | ACQuA-17bd9beaf7f358a44e5bf36a5855fe6727d506dc.tar.gz ACQuA-17bd9beaf7f358a44e5bf36a5855fe6727d506dc.zip | |
[pagoda] Move project to Scala
This commit includes a few changes:
- The repository still uses Maven to manage dependency but it is now a
Scala project.
- The code has been ported from OWLAPI 3.4.10 to 5.1.20
- A proof of concept program using both RSAComb and PAGOdA has been
added.
Diffstat (limited to 'src/uk/ac/ox/cs/pagoda/rules/DatalogProgram.java')
| -rw-r--r-- | src/uk/ac/ox/cs/pagoda/rules/DatalogProgram.java | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/src/uk/ac/ox/cs/pagoda/rules/DatalogProgram.java b/src/uk/ac/ox/cs/pagoda/rules/DatalogProgram.java deleted file mode 100644 index e2a171d..0000000 --- a/src/uk/ac/ox/cs/pagoda/rules/DatalogProgram.java +++ /dev/null | |||
| @@ -1,81 +0,0 @@ | |||
| 1 | package uk.ac.ox.cs.pagoda.rules; | ||
| 2 | |||
| 3 | import org.semanticweb.owlapi.model.OWLOntology; | ||
| 4 | import uk.ac.ox.cs.pagoda.constraints.BottomStrategy; | ||
| 5 | import uk.ac.ox.cs.pagoda.constraints.UpperUnaryBottom; | ||
| 6 | import uk.ac.ox.cs.pagoda.util.disposable.Disposable; | ||
| 7 | import uk.ac.ox.cs.pagoda.util.disposable.DisposedException; | ||
| 8 | |||
| 9 | import java.io.InputStream; | ||
| 10 | |||
| 11 | public class DatalogProgram extends Disposable { | ||
| 12 | |||
| 13 | UpperDatalogProgram upperProgram = new UpperDatalogProgram(); | ||
| 14 | LowerDatalogProgram lowerProgram; | ||
| 15 | GeneralProgram program = new GeneralProgram(); | ||
| 16 | |||
| 17 | BottomStrategy upperBottom; | ||
| 18 | |||
| 19 | public DatalogProgram(InputStream inputStream) { | ||
| 20 | lowerProgram = new LowerDatalogProgram(); | ||
| 21 | |||
| 22 | upperProgram.load(inputStream, upperBottom = new UpperUnaryBottom()); | ||
| 23 | lowerProgram.clone(upperProgram); | ||
| 24 | program.clone(upperProgram); | ||
| 25 | |||
| 26 | upperProgram.transform(); | ||
| 27 | lowerProgram.transform(); | ||
| 28 | program.transform(); | ||
| 29 | |||
| 30 | program.buildDependencyGraph(); | ||
| 31 | lowerProgram.dependencyGraph = upperProgram.buildDependencyGraph(); | ||
| 32 | } | ||
| 33 | |||
| 34 | public DatalogProgram(OWLOntology o) { | ||
| 35 | lowerProgram = new LowerDatalogProgram(); | ||
| 36 | |||
| 37 | upperProgram.load(o, upperBottom = new UpperUnaryBottom()); | ||
| 38 | // upperProgram.load(o, upperBottom = new UnaryBottom()); | ||
| 39 | lowerProgram.clone(upperProgram); | ||
| 40 | program.clone(upperProgram); | ||
| 41 | // program.botStrategy = new UnaryBottom(); | ||
| 42 | |||
| 43 | upperProgram.transform(); | ||
| 44 | lowerProgram.transform(); | ||
| 45 | program.transform(); | ||
| 46 | |||
| 47 | program.buildDependencyGraph(); | ||
| 48 | lowerProgram.dependencyGraph = upperProgram.buildDependencyGraph(); | ||
| 49 | } | ||
| 50 | |||
| 51 | public LowerDatalogProgram getLower() { | ||
| 52 | if(isDisposed()) throw new DisposedException(); | ||
| 53 | return lowerProgram; | ||
| 54 | } | ||
| 55 | |||
| 56 | public UpperDatalogProgram getUpper() { | ||
| 57 | if(isDisposed()) throw new DisposedException(); | ||
| 58 | return upperProgram; | ||
| 59 | } | ||
| 60 | |||
| 61 | public GeneralProgram getGeneral() { | ||
| 62 | if(isDisposed()) throw new DisposedException(); | ||
| 63 | return program; | ||
| 64 | } | ||
| 65 | |||
| 66 | public String getAdditionalDataFile() { | ||
| 67 | if(isDisposed()) throw new DisposedException(); | ||
| 68 | return upperProgram.getAdditionalDataFile(); | ||
| 69 | } | ||
| 70 | |||
| 71 | public BottomStrategy getUpperBottomStrategy() { | ||
| 72 | if(isDisposed()) throw new DisposedException(); | ||
| 73 | return upperBottom; | ||
| 74 | } | ||
| 75 | |||
| 76 | @Override | ||
| 77 | public void dispose() { | ||
| 78 | super.dispose(); | ||
| 79 | if(upperProgram != null) upperProgram.deleteABoxTurtleFile(); | ||
| 80 | } | ||
| 81 | } | ||
