From 9ce65c5a963b03ee97fe9cb6c5aa65a3c04a80a8 Mon Sep 17 00:00:00 2001 From: yzhou Date: Tue, 21 Apr 2015 10:34:27 +0100 Subject: initial version --- src/uk/ac/ox/cs/pagoda/approx/Clausifier.java | 37 +++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/uk/ac/ox/cs/pagoda/approx/Clausifier.java (limited to 'src/uk/ac/ox/cs/pagoda/approx/Clausifier.java') 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 @@ +package uk.ac.ox.cs.pagoda.approx; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Set; + +import org.semanticweb.HermiT.model.DLClause; +import org.semanticweb.owlapi.model.OWLDataFactory; +import org.semanticweb.owlapi.model.OWLDataProperty; +import org.semanticweb.owlapi.model.OWLOntology; + +public class Clausifier { + + OWLDataFactory factory; + Set dataProperties = new HashSet(); + + private Clausifier(OWLOntology ontology) { + factory = ontology.getOWLOntologyManager().getOWLDataFactory(); + for (OWLDataProperty dataProperty: ontology.getDataPropertiesInSignature(true)) + dataProperties.add(dataProperty.toStringID()); + } + + public Clause clasuify(DLClause clause) { + return new Clause(this, clause); + } + + private static HashMap AllInstances = new HashMap(); + + public static Clausifier getInstance(OWLOntology onto) { + Clausifier c = AllInstances.get(onto); + if (c != null) return c; + c = new Clausifier(onto); + AllInstances.put(onto, c); + return c; + } + +} -- cgit v1.2.3