plugin
Plugin support for rdf.
There are a number of plugin points for rdf: parser, serializer, store, query processor, and query result. Plugins can be registered either through setuptools entry_points or by calling rdf.plugin.register directly.
If you have a package that uses a setuptools based setup.py you can add the
following to your setup:
entry_points = {
'rdf.plugins.parser': [
'nt = rdf.plugins.parsers.ntriples:NTParser',
],
'rdf.plugins.serializer': [
'nt = rdf.plugins.serializers.NTSerializer:NTSerializer',
],
}
See the setuptools dynamic discovery of services and plugins for moreinformation.
Classes:
-
PKGPlugin– -
Plugin– -
PluginException–
Functions:
-
get–Return the class for the specified (name, kind). Raises a
-
plugins–A generator of the plugins.
-
register–Register the plugin for (name, kind). The module_path and
Attributes:
-
PluginT–
__all__
module-attribute
rdflib_entry_points
module-attribute
rdflib_entry_points = {'rdf.plugins.store': Store, 'rdf.plugins.serializer': Serializer, 'rdf.plugins.parser': Parser, 'rdf.plugins.resultparser': ResultParser, 'rdf.plugins.resultserializer': ResultSerializer, 'rdf.plugins.queryprocessor': Processor, 'rdf.plugins.queryresult': Result, 'rdf.plugins.updateprocessor': UpdateProcessor}
result_parsers
module-attribute
result_parsers = {(name) for parser in (plugins(kind=ResultParser))}
PKGPlugin
PKGPlugin(name: str, kind: Type[PluginT], ep: EntryPoint)
Plugin
Plugin(name: str, kind: Type[PluginT], module_path: str, class_name: str)
Bases: Generic[PluginT]
Methods:
-
getClass–
Attributes:
-
class_name– -
kind– -
module_path– -
name–
Source code in rdflib/plugin.py
PluginException
get
Return the class for the specified (name, kind). Raises a PluginException if unable to do so.
Source code in rdflib/plugin.py
plugins
plugins(name: Optional[str] = ..., kind: None = ...) -> Iterator[Plugin]
plugins(name: Optional[str] = None, kind: Optional[Type[PluginT]] = None) -> Iterator[Plugin[PluginT]]
A generator of the plugins.
Pass in name and kind to filter… else leave None to match all.
Source code in rdflib/plugin.py
register
Register the plugin for (name, kind). The module_path and class_name should be the path to a plugin class.