Recipe "Extract/export/inject/import a set of pages from/into a SMW from/into a directory (git repository)"

From FindAndLearn::Cookbook
C181015155810
Jump to: navigation, search





Requirements

Example: extract pages from a MediaWiki

 1 require 'dataspects'
 2 
 3 repo = OntologyRepository.new()
 4 repo.create_new_at_URL("/tmp/ontology_repository")
 5 mediawiki = MediaWiki.new(
 6   url: "https://cookbook.findandlearn.net/w",
 7   user: "",
 8   password: "",
 9   log_in: :must_log_in
10 )
11 mediawiki.resources_from_ASK_QUERY("[[HasElasticConceptType::QueryType]]") do |mediawiki_page|
12   repo.store_RESOURCE(mediawiki_page)
13 end