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]

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.extract_language(lang)[source]

Turn a language in our domain model into a IANA tag.

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=u'latin-1', errors=u'strict')[source]

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