API Documentation

Providers module

This module contains an RDFProvider, an implementation of the skosprovider.providers.VocabularyProvider interface that uses a rdflib.graph.Graph as input.

class skosprovider_rdf.providers.RDFProvider(metadata, graph, **kwargs)[source]

Should the provider only take concepts into account explicitly linked to the conceptscheme?

check_in_scheme = False

A simple vocabulary provider that use an rdflib.graph.Graph as input. The provider expects a RDF graph with elements that represent the SKOS concepts and collections.

Please be aware that this provider needs to load the entire graph in memory.

to_text(data)[source]

data of binary type or literal type that needs to be converted to text. :param data :return: text representation of the data

Utils module

This module contains utility functions for dealing with skos providers.

skosprovider_rdf.utils.rdf_c_dumper(provider, c)[source]

Dump one concept or collection from a provider to a format that can be passed to a skosprovider.providers.RDFProvider.

Parameters:
Return type:

rdflib.graph.Graph

skosprovider_rdf.utils.rdf_conceptscheme_dumper(provider)[source]

Dump all information of the conceptscheme of a provider to a format that can be passed to a skosprovider.providers.RDFProvider.

Parameters:provider (skosprovider.providers.VocabularyProvider) – The provider that wil be turned into an rdflib.graph.Graph.
Return type:rdflib.graph.Graph
skosprovider_rdf.utils.rdf_dumper(provider)[source]

Dump a provider to a format that can be passed to a skosprovider.providers.RDFProvider.

Parameters:provider (skosprovider.providers.VocabularyProvider) – The provider that wil be turned into an rdflib.graph.Graph.
Return type:rdflib.graph.Graph
skosprovider_rdf.utils.text_(s, encoding='latin-1', errors='strict')[source]

If s is an instance of bytes, return s.decode(encoding, errors), otherwise return s