diff options
Diffstat (limited to 'src/uk/ac/ox/cs/pagoda/approx/Clausifier.java')
| -rw-r--r-- | src/uk/ac/ox/cs/pagoda/approx/Clausifier.java | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/uk/ac/ox/cs/pagoda/approx/Clausifier.java b/src/uk/ac/ox/cs/pagoda/approx/Clausifier.java new file mode 100644 index 0000000..ee23def --- /dev/null +++ b/src/uk/ac/ox/cs/pagoda/approx/Clausifier.java | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | package uk.ac.ox.cs.pagoda.approx; | ||
| 2 | |||
| 3 | import java.util.HashMap; | ||
| 4 | import java.util.HashSet; | ||
| 5 | import java.util.Set; | ||
| 6 | |||
| 7 | import org.semanticweb.HermiT.model.DLClause; | ||
| 8 | import org.semanticweb.owlapi.model.OWLDataFactory; | ||
| 9 | import org.semanticweb.owlapi.model.OWLDataProperty; | ||
| 10 | import org.semanticweb.owlapi.model.OWLOntology; | ||
| 11 | |||
| 12 | public class Clausifier { | ||
| 13 | |||
| 14 | OWLDataFactory factory; | ||
| 15 | Set<String> dataProperties = new HashSet<String>(); | ||
| 16 | |||
| 17 | private Clausifier(OWLOntology ontology) { | ||
| 18 | factory = ontology.getOWLOntologyManager().getOWLDataFactory(); | ||
| 19 | for (OWLDataProperty dataProperty: ontology.getDataPropertiesInSignature(true)) | ||
| 20 | dataProperties.add(dataProperty.toStringID()); | ||
| 21 | } | ||
| 22 | |||
| 23 | public Clause clasuify(DLClause clause) { | ||
| 24 | return new Clause(this, clause); | ||
| 25 | } | ||
| 26 | |||
| 27 | private static HashMap<OWLOntology, Clausifier> AllInstances = new HashMap<OWLOntology, Clausifier>(); | ||
| 28 | |||
| 29 | public static Clausifier getInstance(OWLOntology onto) { | ||
| 30 | Clausifier c = AllInstances.get(onto); | ||
| 31 | if (c != null) return c; | ||
| 32 | c = new Clausifier(onto); | ||
| 33 | AllInstances.put(onto, c); | ||
| 34 | return c; | ||
| 35 | } | ||
| 36 | |||
| 37 | } | ||
