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

From Dataspects
C181015155810 /
Revision as of 14:55, 8 February 2019 by Lex (talk | contribs) (Example: extract pages from a MediaWiki)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search





Requirements[edit | edit source]

Example: extract pages from a MediaWiki[edit | edit source]

 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