Creates a semantic configuration object for RDF/SPARQL operations with comprehensive IRI handling.

This helper function generates a complete GlobalSemanticConfig with sensible defaults, handling IRI conversions, entity creation, and JSON-LD context configuration.

// Basic usage with just a base IRI
const config = createSemanticConfig({
baseIRI: 'https://example.com/'
});
// With custom prefixes
const config = createSemanticConfig({
baseIRI: 'https://example.com/',
prefixes: {
'foaf': 'http://xmlns.com/foaf/0.1/',
'schema': 'http://schema.org/'
}
});
// With strict validation
const config = createSemanticConfig({
baseIRI: 'https://example.com/',
prefixes: { 'foaf': 'http://xmlns.com/foaf/0.1/' },
rejectUnknownPrefixes: true,
rejectUnknownIRIs: true
});
  • Parameters

    • options: CreateSemanticConfigOptions

      Configuration options for the semantic setup

      • baseIRI

        The base IRI for the application (e.g., 'https://example.com/')

      • defaultPrefix

        The default IRI that will be used for non prefixed properties and types (defaults to baseIRI if not specified)

      • prefixes

        A mapping of prefix names to their corresponding IRIs (e.g., { 'foaf': 'http://xmlns.com/foaf/0.1/' })

      • rejectUnknownPrefixes

        If true, throws an error when encountering an unknown prefix during field-to-IRI conversion (defaults to false)

      • rejectUnknownIRIs

        If true, throws an error when encountering an IRI that doesn't match any known prefix during IRI-to-field conversion (defaults to false)

      • override

        Optional partial GlobalSemanticConfig to override specific properties of the generated configuration

    Returns GlobalSemanticConfig

    A complete GlobalSemanticConfig object with IRI conversion functions, JSON-LD context, and query building options