Class Transforms

java.lang.Object
org.opensextant.output.Transforms
All Implemented Interfaces:
org.opensextant.data.MatchSchema

public class Transforms extends Object implements org.opensextant.data.MatchSchema
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Cutoff confidence for geocoding results:
    static final String
     
    static final String
     
    static final String
     
    static final String
     

    Fields inherited from interface org.opensextant.data.MatchSchema

    VAL_COORD, VAL_COUNTRY, VAL_PLACE, VAL_POSTAL, VAL_TAXON
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    createGeocoding(org.opensextant.data.Geocoding geo, jodd.json.JsonObject node)
    Given an existing JSON object, add geocoding metadata to it.
    static org.opensextant.extraction.TextMatch
    Convert JSON object for an annotation into a Xponents TextMatch instance.
    static void
    parseDate(org.opensextant.extractors.xtemporal.DateMatch d, jodd.json.JsonObject a)
    First stab at deserializing JSON date annotation.
    static void
    parseGeocoding(org.opensextant.data.Place geo, jodd.json.JsonObject node)
    Given a JSON object, parse fields relevant to the geocoding and populate that JSON data TODO: implement Parsing reverse geocoding structures related_place_name and nearest_places
    static void
    parseTaxon(TaxonMatch x, String t, jodd.json.JsonObject a)
    Parse out a taxon from JSON/REST
    static jodd.json.JsonObject
    toJSON(List<org.opensextant.extraction.TextMatch> matches, org.opensextant.processing.Parameters jobParams)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • Transforms

      public Transforms()
  • Method Details

    • parseAnnotation

      public static org.opensextant.extraction.TextMatch parseAnnotation(Object data)
      Convert JSON object for an annotation into a Xponents TextMatch instance. Parsing data from JSON/REST representations has very limited capability compared to using Java API for processing routines directly.
      Parameters:
      data -
      Returns:
      TextMatch object represented by json annotation
      See Also:
      • utility and package. This Annotation approach is more general with respect to the data model overall. This Transforms utility is about transforming matches directly to JSON output ready for RESTful response.
    • parseDate

      public static void parseDate(org.opensextant.extractors.xtemporal.DateMatch d, jodd.json.JsonObject a)
      First stab at deserializing JSON date annotation.
      Parameters:
      d - datematch
      a - json annot
    • parseTaxon

      public static void parseTaxon(TaxonMatch x, String t, jodd.json.JsonObject a)
      Parse out a taxon from JSON/REST
      Parameters:
      x - a taxon object
      t - type of taxon
      a - JSON annotation
    • createGeocoding

      public static void createGeocoding(org.opensextant.data.Geocoding geo, jodd.json.JsonObject node)
      Given an existing JSON object, add geocoding metadata to it.
      Parameters:
      geo - geocoding object
      node - JsonObject representing the serialized JSON for an Xlayer or other annotation.
    • parseGeocoding

      public static void parseGeocoding(org.opensextant.data.Place geo, jodd.json.JsonObject node)
      Given a JSON object, parse fields relevant to the geocoding and populate that JSON data TODO: implement Parsing reverse geocoding structures related_place_name and nearest_places
      Parameters:
      geo - geocoding object
      node - JsonObject representing the serialized JSON for an Xlayer or other annotation.
    • toJSON

      public static jodd.json.JsonObject toJSON(List<org.opensextant.extraction.TextMatch> matches, org.opensextant.processing.Parameters jobParams)