Skip to content

Java Wrapper

elisasibarani edited this page Jun 14, 2016 · 2 revisions

Usage

Please check the JavaDoc documentation of the sources for further details.

XML output

Java code for extracting RXR from OMDoc:

Krextor k = new Krextor();
nu.xom.Document outputDocument = 
  k.extract(
    /* inputFormat = */   "omdoc", // the name of an extraction module
    /* outputFormat = */  "rxr",   // the name of an output module
    /* nu.xom.Document */ inputDocument);

See the main documentation for a list of extraction and output modules.

Text output does not work at the moment.

Output via Java callback

Krextor k = new Krextor();
k.extract(inputFormat, inputDocument, new TripleAdder() {
  public void addTriple(
    String subject,
    String subjectType,
    String predicate,
    String object,
    String objectType,
    String objectLanguage,
    String objectDatatype) {
    /* your code here */
  }
});

Building

In the main directory, say ant jars. This will create krextor-VERSION.jar in src/dist, and another one with copies of JAR dependencies in src/dist-all.

ant dist additionally generates the Javadoc documentation.

Clone this wiki locally