Giter VIP home page Giter VIP logo

linked_archives_wikibase's Introduction

Linked Archives Wikibase Code Repository

Translating the Ontology Data into JSON

Relevant Files

  • LinkedArchives.owl: ontology file with items from the three special collections
  • all_owl.txt: all elements and properties exported from LinkedArchives.owl in Protege
  • config.py: setting global variables for how to read the ontology import
  • ontology_to_json.py: the python code that reads in all_owl.txt, looks up the items on Wikibase, and converts the data into JSON
  • people.json: the JSON output for the "person" entities

How to Run Conversion Script with Pywikibot

** Currently, the conversion only runs on "Person" objects **

Python 3.8 is required to run Pywikibot. It will also require a file called user-config.py (git ignored) to run. A basic version of this file is as follows:

mylang = 'wikidata'
family = 'wikidata'
usernames['wikidata']['wikidata'] = 'YourUsername'

console_encoding = 'utf-8'

This script be run via an IDE (such as Pycharm) or the command line.

Command Line Instructions

Open a terminal in the project folder. Execute the following commands to run ontology_to_json.py.

pip install setuptools
pip install pywikibot
python ontology_to_json.py

See the pywikibot documentation for more information on using pywikibot.

Please note that due to the number of entities and the time it takes to look each up in Wikidata, this script may take several hours to run.

Importing the JSON Data to Wikibase

Relevant Files

  • json_import.py: extracts Q values for import, (to come) imports items and properties
  • qs.csv: the Q numbers for existing wikidata entries that we want to import into our instance of wikibase

Other Documentation

linked_archives_wikibase's People

Contributors

klpolley avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.