Skip to content

Wikidata SPARQL Mapping

WikidataMapping

Bases: SPARQL_Mapping

Wikidata SPARQL mapping.

Parameters:

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

    Whether to target Blazegraph (use named subqueries).

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

    Whether to be strict (assume full Wikidata compatibility).

  • truthy (TDatatypeMask | None, default: None ) –

    Truthy mask to be used in the filter compilation phase.

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

    Whether to use the registered property schemas.

  • type (URI | Path | None, default: None ) –

    Expression for matching :class:TypeProperty.

  • subtype (URI | Path | None, default: None ) –

    Expression for matching from :class:SubtypeProperty.

options property

The Wikidata SPARQL mapping options.

wds property

The current wds variable.

CheckDatatype

Bases: EntryCallbackArgProcessor

Checks whether argument is a datatype value.

CheckIRI

Bases: CheckStr

Checks whether argument is a IRI content.

CheckItem

Bases: CheckURI

Checks whether argument is an item URI.

CheckLexeme

Bases: CheckURI

Checks whether argument is a lexeme URI.

CheckProperty

Bases: CheckURI

Checks whether argument is a property URI.

URI_Schema

Bases: TypedDict

Resolved property schema with URI values.

get_options()

Gets the Wikidata SPARQL mapping options.

Returns:

  • WikidataMappingOptions

    Wikidata SPARQL mapping options.

get_uri_schema(target)

Gets the resolved property URI schema of target.

If target cannot be coerced to URI, returns None.

If target has no property schema, returns None.

Parameters:

  • target (Any) –

    URI.

Returns:

  • URI_Schema | None

    Resolved URI schema or None.

get_wds()

Gets the current wds variable.

Returns:

  • T_WDS

    Query variable or blank note.