The surf.plugin.reader Module¶
-
class
surf.plugin.reader.RDFReader(*args, **kwargs)[source]¶ Bases:
surf.plugin.PluginSuper class for all surf Reader plugins.
-
close()¶ Close the plugin and free any resources it may hold
-
concept(resource)[source]¶ Return the concept URI of the following resource.
resource can be a string or a URIRef. :param resource: the given resource :type resource:
surf.resource.Resource
-
get(resource, attribute, direct)[source]¶ Return the value(s) of the corresponding attribute.
Parameters: - resource (
surf.resource.Resource) – the given resource - attribute (str) – the given attribute
- direct (bool) – whether the attribute is a direct or inverse edge / property. If False then the subject of the resource is considered the object of the query.
Returns: the value(s) of the corresponding attribute
Return type: list
- resource (
-
inference¶ Toggle logical inference on / off. The property has any effect only if such functionality is supported by the underlying
surf.store.Storestore
-
instances_by_attribute(resource, attributes, direct, context)[source]¶ Return all URIs that are instances of
resourceand have the specified attributes.If
directis False, than the subject of theresourceis considered the object of the query.
-
is_present(resource)[source]¶ Check whether the resource is present in the underlying
surf.store.StorestoreParameters: resource ( surf.resource.Resource) – the given resource
-
load(resource, direct)[source]¶ Fully load the resource from the underlying
surf.store.Storestore. This method returns all statements about the resource.If
directis False, then the subject of theresourceis considered the object of the queryParameters: - resource (
surf.resource.Resource) – the given resource - direct (bool) – whether the attribute is a direct or inverse edge / property. If False then the subject of the resource is considered the object of the query.
Returns: all statements about resource
Return type: dict
- resource (
-