Class RDF4JValueConverter

java.lang.Object
fr.inria.rules.integraal.storage.rdf4j.value.converter.RDF4JValueConverter

public class RDF4JValueConverter extends Object
Converts RDF4J values into InteGraal terms.
  • Constructor Details

    • RDF4JValueConverter

      public RDF4JValueConverter(TermFactory termFactory)
      Creates a converter backed by the supplied term factory.
      Parameters:
      termFactory - the factory used to create InteGraal terms
    • RDF4JValueConverter

      public RDF4JValueConverter(fr.inria.rules.dlgpereader.builder.api.IBuilderEnvironment environment)
      Creates a converter backed by the supplied parsing environment.
  • Method Details

    • getDefaultInstance

      @Deprecated public static RDF4JValueConverter getDefaultInstance()
      Deprecated.
      Use getOrCreateInstance(TermFactory) to avoid relying on a singleton term factory.
    • getOrCreateInstance

      public static RDF4JValueConverter getOrCreateInstance(TermFactory factory)
      Returns a converter instance for the given term factory.
      Parameters:
      factory - the term factory
      Returns:
      a converter instance
    • convertToTerm

      public Term convertToTerm(org.eclipse.rdf4j.model.Value rdf4j_value)
      Converts a RDF4J Value into a Term, if possible.

      - If it's a literal with a recognized datatype, parse via XSD (so numeric, dateTime, boolean, etc. become typed). - If it's a literal with no datatype (or a language tag), default to xsd:string. - If it's an IRI, store it as a constant - If it's a blank node, store it as a variable

      Parameters:
      rdf4j_value - the RDF4J value to convert
      Returns:
      the converted InteGraal term