From 17bd9beaf7f358a44e5bf36a5855fe6727d506dc Mon Sep 17 00:00:00 2001 From: Federico Igne Date: Tue, 10 May 2022 18:17:06 +0100 Subject: [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. --- .../cs/pagoda/endomorph/DependencyGraphTest.java | 60 ---------------------- 1 file changed, 60 deletions(-) delete mode 100644 test/uk/ac/ox/cs/pagoda/endomorph/DependencyGraphTest.java (limited to 'test/uk/ac/ox/cs/pagoda/endomorph/DependencyGraphTest.java') diff --git a/test/uk/ac/ox/cs/pagoda/endomorph/DependencyGraphTest.java b/test/uk/ac/ox/cs/pagoda/endomorph/DependencyGraphTest.java deleted file mode 100644 index a4579a3..0000000 --- a/test/uk/ac/ox/cs/pagoda/endomorph/DependencyGraphTest.java +++ /dev/null @@ -1,60 +0,0 @@ -package uk.ac.ox.cs.pagoda.endomorph; - -import org.semanticweb.owlapi.apibinding.OWLManager; -import org.semanticweb.owlapi.model.*; -import org.testng.Assert; -import org.testng.annotations.Test; -import uk.ac.ox.cs.JRDFox.model.GroundTerm; -import uk.ac.ox.cs.JRDFox.model.Individual; -import uk.ac.ox.cs.pagoda.query.AnswerTuple; -import uk.ac.ox.cs.pagoda.summary.Graph; -import uk.ac.ox.cs.pagoda.summary.NodeTuple; -import uk.ac.ox.cs.pagoda.util.TestUtil; - -import java.util.HashSet; - -import static uk.ac.ox.cs.pagoda.util.TestUtil.getEntityIRI; - -public class DependencyGraphTest { - - private OWLOntology getOntology() throws OWLOntologyCreationException { - OWLOntologyManager manager = OWLManager.createOWLOntologyManager(); - OWLDataFactory factory = manager.getOWLDataFactory(); - OWLOntology ontology = manager.createOntology(); - - OWLClass hardWorkingStudent = factory.getOWLClass(getEntityIRI("HardWorkingStudent")); - manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(hardWorkingStudent)); - OWLNamedIndividual a = factory.getOWLNamedIndividual(getEntityIRI("a")); - OWLNamedIndividual b = factory.getOWLNamedIndividual(getEntityIRI("b")); - OWLObjectProperty takesCourse = factory.getOWLObjectProperty(IRI.create(String.format(TestUtil.NS, "takesCourse"))); - manager.addAxiom(ontology, factory.getOWLDeclarationAxiom(takesCourse)); - - // Class assertions - manager.addAxiom(ontology, factory.getOWLClassAssertionAxiom(hardWorkingStudent, a)); // HardWorkingStudent(a) - manager.addAxiom(ontology, factory.getOWLClassAssertionAxiom(hardWorkingStudent, b)); // HardWorkingStudent(b) - - // Minimum cardinality axiom - manager.addAxiom(ontology, - factory.getOWLEquivalentClassesAxiom(hardWorkingStudent, - factory.getOWLObjectMinCardinality(3, - takesCourse))); - return ontology; - } - - @Test - public void test() throws OWLOntologyCreationException { - OWLOntology ontology = getOntology(); - Graph graph = new Graph(ontology); - DependencyGraph dependencyGraph = new DependencyGraph(graph); - - HashSet tuples = new HashSet<>(); - tuples.add(graph.getNodeTuple(new AnswerTuple(new GroundTerm[]{Individual.create(String.format(TestUtil.NS, "a")), Individual.create(String.format(TestUtil.NS, "a"))}))); - tuples.add(graph.getNodeTuple(new AnswerTuple(new GroundTerm[]{Individual.create(String.format(TestUtil.NS, "a")), Individual.create(String.format(TestUtil.NS, "b"))}))); - tuples.add(graph.getNodeTuple(new AnswerTuple(new GroundTerm[]{Individual.create(String.format(TestUtil.NS, "b")), Individual.create(String.format(TestUtil.NS, "a"))}))); - tuples.add(graph.getNodeTuple(new AnswerTuple(new GroundTerm[]{Individual.create(String.format(TestUtil.NS, "b")), Individual.create(String.format(TestUtil.NS, "b"))}))); - - dependencyGraph.build(tuples); - - Assert.assertTrue(dependencyGraph.getTopologicalOrder().size() >= 2); - } -} -- cgit v1.2.3