Requirements

Build

Open a terminal and go into the extracted folder. Then, execute the command below:

javac -cp owl-parser-example-1.3.1.jar fr/lirmm/graphik/graal/examples/owlparser/OWLParser.java

Run the example

Execute this command:

java -cp owl-parser-example-1.3.1.jar fr/lirmm/graphik/graal/examples/owlparser/OWLParser ./data/univ-bench.owl

What does this example do?

  1. Create a DLGP writer to print parsed ontology:
    
        DlgpWriter writer = new DlgpWriter();
        
  2. Create a OWL parser from the specified owl file:
    
        File f = new File(owlFilePath);
        OWL2Parser parser = new OWL2Parser(f);
        
  3. Parse the file and display the ontology:
    
        while (parser.hasNext()) {
            writer.write(parser.next());
            writer.flush();
        }
        
  4. Close resources:
    
        parser.close();
        writer.close();