def get_list_catalogs(): ''' get the list of catalogs in the the triple stores :return: ''' try: tsch = TripleStoreCRUDHelpers() list_uris_catalogs = tsch.get_list_resources_by_class( DCATAPOP_PUBLIC_GRAPH_NAME, CATALOG_CLASS_URI) list_catalogs = {} for uri_catalog in list_uris_catalogs: catalog = CatalogDcatApOp(uri_catalog) catalog.get_description_from_ts() list_catalogs[uri_catalog] = catalog return list_catalogs except BaseException as e: log.error("Can not get the list of catalogs")
def get_map_vocabulary(graph_name, vocabulary_class_uri=DEFAULT_VOCABULARY_CLASS): ''' get the list of catalogs in the the triple stores :return: ''' ts_host = config.get(MDR_HOST_NAME) ts_host_auth = config.get(MDR_HOST_NAME_AUTHENTICATED) try: tsch = TripleStoreCRUDHelpers(ts_host, ts_host_auth) list_uris_vocabulary = tsch.get_list_resources_by_class(graph_name, vocabulary_class_uri) map_vocabulary = {} for uri_vocabulary in list_uris_vocabulary: vocabulary = ConceptSchemeSchemaSkosWrapper(uri_vocabulary,graph_name) vocabulary.get_description_from_ts() map_vocabulary[uri_vocabulary] = vocabulary return map_vocabulary except BaseException as e: log.error("Can not get the list of vocabulary")