Skip to content

SPARQL Mapping

SPARQL_Mapping

Bases: Sequence[_Entry]

SPARQL mapping.

context property

The current KIF context.

CheckDecimal

Bases: CheckLiteral

Checks decimal argument.

CheckInt

Bases: CheckLiteral

Checks int argument.

CheckLiteral

Bases: CheckStr

Checks literal argument.

CheckStr

Bases: EntryCallbackArgProcessor

Checks str argument.

CheckURI

Bases: CheckStr

Check URI argument.

Done

Bases: Signal

The "done" signal.

EntryCallback

Bases: Protocol

The type of entry callbacks.

EntryCallbackArgProcessor

Entry callback-arg processor.

EntryCallbackArgProcessorAlias

Bases: Protocol

The type of callback-arg processor aliases.

EntryCallbackArgProcessorChain

Bases: EntryCallbackArgProcessor

Entry callback-arg processor chain.

ResultBuilder

Result builder for SPARQL mapping.

Parameters:

push(binding)

Pushes SPARQL binding into result builder.

Parameters:

  • binding (SPARQL_ResultsBinding) –

    SPARQL binding.

Returns:

  • Iterator[Theta]

    An iterator of thetas.

Signal

Bases: BaseException

Base class for entry signals.

Skip

Bases: Signal

The "skip" signal.

build_query(compiler, query, projection=None, distinct=None, limit=None, offset=None)

Constructs a filter query.

Parameters:

  • compiler (SPARQL_FilterCompiler) –

    SPARQL compiler.

  • query (Query) –

    Query.

  • projection (Projection | None, default: None ) –

    Projection mask.

  • distinct (bool | None, default: None ) –

    Whether to enable the distinct modifier.

  • limit (int | None, default: None ) –

    Limit.

  • offset (int | None, default: None ) –

    Offset.

Returns:

  • Query

    Filter query.

build_results(compiler)

Constructs a compilation result builder.

Parameters:

Returns:

frame_popped(compiler, frame)

Called the current compilation frame is popped.

Returns:

  • Frame

    The popped frame.

frame_pushed(compiler, frame)

Called before a new compilation frame is pushed.

Returns:

  • Frame

    The frame to be pushed.

get_context()

Gets the KIF context of SPARQL mapping.

Returns:

postamble(compiler)

Called after compilation ends.

Parameters:

preamble(compiler, sources)

Called before compilation starts.

Parameters:

  • compiler (SPARQL_FilterCompiler) –

    SPARQL compiler.

  • sources (Iterable[EntryPattern]) –

    Source patterns.

Returns:

  • Iterable[EntryPattern]

    Source patterns.

preamble_entry(compiler, entry)

Called before entry compilation starts.

Parameters:

  • entry (Entry) –

    Entry.

Returns:

  • Entry

    Entry.

register(patterns, preprocess=None, postprocess=None, defaults=None, priority=None, qualifiers=None, references=None, rank=None) classmethod

Decorator used to register a new entry into mapping.

Parameters:

  • patterns (Iterable[EntryTPattern]) –

    Statements, statement templates, or statement variables.

  • preprocess (EntryCallbackArgProcessorMap | None, default: None ) –

    Callback-arg pre-processor map.

  • postprocess (EntryCallbackArgProcessorMap | None, default: None ) –

    Callback-arg post-processor map.

  • defaults (EntryCallbackArgDefaultMap | None, default: None ) –

    Callback-arg default map.

  • priority (int | None, default: None ) –

    Priority.

  • qualifiers (TQualifierRecord | None, default: None ) –

    Qualifiers to be added to statement patterns.

  • references (TReferenceRecordSet | None, default: None ) –

    References to be added to statement patterns.

  • rank (TRank | None, default: None ) –

    Rank to be added to statement patterns.

Returns:

  • Callable[..., Any]

    The wrapped callback.