Tracker.Endpoint

g GObject.Object GObject.Object Tracker.Endpoint Tracker.Endpoint GObject.Object->Tracker.Endpoint

Subclasses:

Tracker.EndpointDBus, Tracker.EndpointHttp

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

get_allowed_graphs ()

get_allowed_services ()

get_readonly ()

get_sparql_connection ()

set_allowed_graphs (graphs)

set_allowed_services (services)

set_readonly (readonly)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

allowed-graphs

[str]

r/w

allowed-services

[str]

r/w

readonly

bool

r/w

Readonly

sparql-connection

Tracker.SparqlConnection

r/w/co

Sparql connection

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Tracker.Endpoint(**kwargs)
Bases:

GObject.Object

Abstract:

Yes

Structure:

Tracker.EndpointClass

TrackerEndpoint is a helper object to make RDF triple stores represented by a [class`Tracker`.SparqlConnection] publicly available to other processes/hosts.

This is a base abstract object, see [class`Tracker`.EndpointDBus] to make RDF triple stores available to other processes in the same machine, and [class`Tracker`.EndpointHttp] to make it available to other hosts in the network.

When the RDF triple store represented by a [class`Tracker`.SparqlConnection] is made public this way, other peers may connect to the database using [ctor`Tracker`.SparqlConnection.bus_new] or [ctor`Tracker`.SparqlConnection.remote_new] to access this endpoint exclusively, or they may use the SERVICE <uri> { ... } SPARQL syntax from their own [class`Tracker`.SparqlConnection]s to expand their data set.

By default, and as long as the underlying [class`Tracker`.SparqlConnection] allows SPARQL updates and RDF graph changes, endpoints will allow updates and modifications to happen through them. Use [method`Tracker`.Endpoint.set_readonly] to change this behavior.

By default, endpoints allow access to every RDF graph in the triple store and further external SPARQL endpoints to the queries performed on it. Use [method`Tracker`.Endpoint.set_allowed_graphs] and [method`Tracker`.Endpoint.set_allowed_services] to change this behavior. Users do not typically need to do this for D-Bus endpoints, as these do already have a layer of protection with the Tracker portal. This is the mechanism used by the portal itself. This access control API may not interoperate with other SPARQL endpoint implementations than Tracker.

get_allowed_graphs()
Returns:

The list of allowed RDF graphs

Return type:

[str]

Returns the list of RDF graphs that the endpoint allows access for.

New in version 3.7.

get_allowed_services()
Returns:

The list of allowed services

Return type:

[str]

Returns the list of external SPARQL endpoints that are allowed to be accessed through this endpoint.

New in version 3.7.

get_readonly()
Returns:

True if the endpoint is readonly

Return type:

bool

Returns whether the endpoint is readonly, thus SPARQL update queries are disallowed.

New in version 3.7.

get_sparql_connection()
Returns:

The proxied SPARQL connection

Return type:

Tracker.SparqlConnection

Returns the [class`Tracker`.SparqlConnection] that this endpoint proxies to a wider audience.

set_allowed_graphs(graphs)
Parameters:

graphs (str) – List of allowed graphs, or None to allow all graphs

Sets the list of RDF graphs that this endpoint will allow access for. Any explicit (e.g. GRAPH keyword) or implicit (e.g. through the default anonymous graph) access to RDF graphs unespecified in this list in SPARQL queries will be seen as if those graphs did not exist, or (equivalently) had an empty set. Changes to these graphs through SPARQL updates will also be disallowed.

If graphs is None, access will be allowed to every RDF graph stored in the endpoint, this is the default behavior. If you want to forbid access to all RDF graphs, use an empty list.

The empty string ("") is allowed as a special value, to allow access to the stock anonymous graph. All graph names are otherwise dependent on the endpoint and its contained data.

New in version 3.7.

set_allowed_services(services)
Parameters:

services (str) – List of allowed services, or None to allow all services

Sets the list of external SPARQL endpoints that this endpoint will allow access for. Access through the SERVICE SPARQL syntax will fail for services not specified in this list.

If services is None, access will be allowed to every external endpoint, this is the default behavior. If you want to forbid access to all external SPARQL endpoints, use an empty list.

This affects both remote SPARQL endpoints accessed through HTTP, and external SPARQL endpoints offered through D-Bus. For the latter, the following syntax is allowed to describe them as an URI:

DBUS_URI = 'dbus:' [ ('system' | 'session') ':' ]? dbus-name [ ':' object-path ]?

If the system/session part is omitted, it will default to the session bus. If the object path is omitted, the /org/freedesktop/Tracker3/Endpoint [class`Tracker`.EndpointDBus] default will be assumed.

New in version 3.7.

set_readonly(readonly)
Parameters:

readonly (bool) – Whether the endpoint will be readonly

Sets whether the endpoint will be readonly. Readonly endpoints will not allow SPARQL update queries. The underlying [class`Tracker`.SparqlConnection] may be readonly of its own, this method does not change its behavior in any way.

New in version 3.7.

Property Details

Tracker.Endpoint.props.allowed_graphs
Name:

allowed-graphs

Type:

[str]

Default Value:

[]

Flags:

READABLE, WRITABLE

RDF graphs that are allowed to be accessed through queries to this endpoint. See Tracker.Endpoint.set_allowed_graphs().

New in version 3.7.

Tracker.Endpoint.props.allowed_services
Name:

allowed-services

Type:

[str]

Default Value:

[]

Flags:

READABLE, WRITABLE

External SPARQL endpoints that are allowed to be accessed through queries to this endpint. See Tracker.Endpoint.set_allowed_services().

New in version 3.7.

Tracker.Endpoint.props.readonly
Name:

readonly

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Whether the endpoint allows SPARQL updates or not. See Tracker.Endpoint.set_readonly().

New in version 3.7.

Tracker.Endpoint.props.sparql_connection
Name:

sparql-connection

Type:

Tracker.SparqlConnection

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The [class`Tracker`.SparqlConnection] being proxied by this endpoint.