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:47, 8 February 2019 by Lex (talk | contribs)
Jump to: navigation, search





Requirements[edit | edit source]

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

require 'dataspects'

repo = OntologyRepository.new()
repo.create_new_at_URL("/tmp/ontology_repository")
mediawiki = MediaWiki.new(
  url: "https://cookbook.findandlearn.net/w",
  user: "",
  password: "",
  log_in: :must_log_in
)
mediawiki.resources_from_ASK_QUERY("[[HasElasticConceptType::QueryType]]") do |mediawiki_page|
  repo.store_RESOURCE(mediawiki_page)
end