Class RDF4JValueConverter
java.lang.Object
fr.inria.rules.integraal.storage.rdf4j.value.converter.RDF4JValueConverter
Converts RDF4J values into InteGraal terms.
-
Constructor Summary
ConstructorsConstructorDescriptionRDF4JValueConverter(fr.inria.rules.dlgpereader.builder.api.IBuilderEnvironment environment) Creates a converter backed by the supplied parsing environment.RDF4JValueConverter(TermFactory termFactory) Creates a converter backed by the supplied term factory. -
Method Summary
Modifier and TypeMethodDescriptionconvertToTerm(org.eclipse.rdf4j.model.Value rdf4j_value) Converts a RDF4J Value into a Term, if possible.static RDF4JValueConverterDeprecated.static RDF4JValueConvertergetOrCreateInstance(TermFactory factory) Returns a converter instance for the given term factory.
-
Constructor Details
-
RDF4JValueConverter
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.UsegetOrCreateInstance(TermFactory)to avoid relying on a singleton term factory. -
getOrCreateInstance
Returns a converter instance for the given term factory.- Parameters:
factory- the term factory- Returns:
- a converter instance
-
convertToTerm
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
-
getOrCreateInstance(TermFactory)to avoid relying on a singleton term factory.