The surf.plugin.query_reader Module

class surf.plugin.query_reader.RDFQueryReader(*args, **kwargs)[source]

Bases: surf.plugin.reader.RDFReader

Super class for SuRF Reader plugins that wrap queryable stores.

close()

Close the plugin and free any resources it may hold.

concept(resource)

Return the concept URI of the following resource.

resource can be a string or a URIRef.

convert(query_result, *keys)[source]

Convert the results from the query to a multilevel dictionary.

This method is used by the surf.resource.Resource class.

enable_logging(enable=True)

Enables or disable logging for the current plugin.

execute(query)[source]

Execute a query of type surf.query.Query.

get(resource, attribute, direct)

Return the value(s) of the corresponding attribute.

If direct is False then the subject of the resource is considered the object of the query.

instances_by_attribute(resource, attributes, direct, context)

Return all URIs that are instances of resource and have the specified attributes.

If direct is False, than the subject of the resource is considered the object of the query.

is_enable_logging()

True if logging is enabled.

is_present(resource)

Return True if the resource is present in the store.

load(resource, direct)

Fully load the resource from the store.

This method returns all statements about the resource.

If direct is False, then the subject of the resource is considered the object of the query

surf.plugin.query_reader.query_Ask(subject, context)[source]

Construct surf.query.Query of type ASK.

surf.plugin.query_reader.query_Concept(subject)[source]

Construct surf.query.Query with ?c as the unknown.

surf.plugin.query_reader.query_P_S(c, p, direct, context)[source]

Construct surf.query.Query with ?s and ?c as unknowns.

surf.plugin.query_reader.query_S(s, direct, context)[source]

Construct surf.query.Query with ?p, ?v and ?c as unknowns.

surf.plugin.query_reader.query_SP(s, p, direct, context)[source]

Construct surf.query.Query with ?v and ?c as unknowns.

Previous topic

The surf.plugin.reader Module

Next topic

The surf.plugin.writer Module

This Page