Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
<dependency>
<groupId>net.sourceforge.owlapi</groupId>
<artifactId>owlapi-osgidistribution</artifactId>
<version>[3.5.1,3.9)</version>
<version>[4.0.2,4.1)</version>
</dependency>
</dependencies>

Expand All @@ -90,8 +90,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>

Expand Down Expand Up @@ -145,7 +145,7 @@
<artifactId>maven-pmd-plugin</artifactId>
<version>3.0</version>
<configuration>
<targetJdk>1.6</targetJdk>
<targetJdk>1.7</targetJdk>
</configuration>
</plugin>
</plugins>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package org.protege.xmlcatalog.owlapi;

import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.util.Set;

import junit.framework.TestCase;

import org.protege.xmlcatalog.CatalogUtilities;
import org.semanticweb.owlapi.apibinding.OWLManager;
import org.semanticweb.owlapi.model.IRI;
import org.semanticweb.owlapi.model.OWLImportsDeclaration;
Expand All @@ -21,15 +21,16 @@ public class IRIMapperTest extends TestCase {

public void testIRIMapper() throws MalformedURLException, IOException, OWLOntologyCreationException {
OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
manager.addIRIMapper(new XMLCatalogIRIMapper(new File("src/test/resources/owl/redirect-to-pizza.xml")));
OWLOntology ontology = manager.loadOntology(IRI.create(new File("src/test/resources/owl/TestFunnyPizzaImport.owl")));
manager.addIRIMapper(new XMLCatalogIRIMapper(CatalogUtilities.parseDocument(getClass().getResource("/owl/redirect-to-pizza.xml"))));
OWLOntology ontology = manager.loadOntologyFromOntologyDocument(getClass().getResourceAsStream("/owl/TestFunnyPizzaImport.owl"));
Set<OWLImportsDeclaration> importDeclarations = ontology.getImportsDeclarations();
assertEquals(1, importDeclarations.size());
assertEquals(IMPORT_LOCATION, importDeclarations.iterator().next().getIRI());
Set<OWLOntology> importedOntologies = ontology.getImports();
assertEquals(1, importedOntologies.size());
OWLOntology pizzaOntology = importedOntologies.iterator().next();
assertEquals(PIZZA_IRI, pizzaOntology.getOntologyID().getOntologyIRI());
assertEquals(PIZZA_IRI, pizzaOntology.getOntologyID().getOntologyIRI()
.get());
assertEquals(REDIRECT_LOCATION, manager.getOntologyDocumentIRI(pizzaOntology));
}
}