Skip to content

Instantly share code, notes, and snippets.

@stain
Created February 21, 2012 14:10
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save stain/1876732 to your computer and use it in GitHub Desktop.
OWL2 RL checker - needs OWL api
package no.s11.owlapi;
import java.io.File;
import org.semanticweb.owlapi.apibinding.OWLManager;
import org.semanticweb.owlapi.model.OWLOntology;
import org.semanticweb.owlapi.model.OWLOntologyCreationException;
import org.semanticweb.owlapi.model.OWLOntologyManager;
import org.semanticweb.owlapi.profiles.OWL2RLProfile;
import org.semanticweb.owlapi.profiles.OWLProfileReport;
import org.semanticweb.owlapi.profiles.OWLProfileViolation;
public class ProfileChecker {
public static void main(String[] args) throws OWLOntologyCreationException {
OWLOntologyManager m = OWLManager.createOWLOntologyManager();
File file = new File(args[0]);
OWLOntology o = m
.loadOntologyFromOntologyDocument(file);
OWL2RLProfile p = new OWL2RLProfile();
OWLProfileReport report = p.checkOntology(o);
for (OWLProfileViolation v : report.getViolations()) {
System.out.println(v);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment