Skip to content

Instantly share code, notes, and snippets.

@ncarboni
ncarboni / convert_geonames.py
Created May 26, 2020 10:16
Convert geonames RDF to usable format
# script modified from https://github.com/rhasan/sw/blob/master/genames/convert2ntriples.py
# This script will take genames rdf dump available here http://download.geonames.org/all-geonames-rdf.zip
# and convert each triples to N-Triple seralization.
# The dump has one rdf document per toponym on every line of the file.
# The produced N-Triples will be written in geonames.nt file. The final geonames.nt file is approximately 13.21GB
#!/usr/bin/python
import rdflib
fo = open("geonames.nt", "wb")
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix pcdm: <http://pcdm.org/models#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix acl: <http://www.w3.org/ns/auth/acl#> .
@prefix pcdmfmt: <http://pcdm.org/file-format-types#> .
@prefix pcdmuse: <http://pcdm.org/use#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix rel: <http://id.loc.gov/vocabulary/relators/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix fedoraconfig: <http://fedora.info/definitions/v4/config#> .
@cmharlow
cmharlow / README.md
Last active April 24, 2023 20:02
Proposed Metadata Starter Specs to add to metadata-docs/ for Hyrax Codebase

Hyrax Metadata Specifications & Documentation

Table of Contents

Goal(s) & Scope of metadata-docs/

This metadata-docs/ directory contains metadata technical documentation and specifications that don't fit in the existing codebase documentation methods, but require management, a review process, and versioning beyond what is captured in the GitHub wiki. In particular, when a Hyrax version is released, the metadata-docs/ travel with the codebase and indicate the current metadata specifications followed in that release. This documentation doesn't indicate recommendations for individual implementations of Hyrax (your metadata documentation will no doubt vary), but aims to clarify what metadata specifications exist in the core Hyrax codebase.

@msikma
msikma / rfc5646-language-tags.js
Created February 26, 2015 13:51
RFC 5646 Language Tags
// List of language tags according to RFC 5646.
// See <http://tools.ietf.org/html/rfc5646> for info on how to parse
// these language tags. Some duplicates have been removed.
var RFC5646_LANGUAGE_TAGS = {
'af': 'Afrikaans',
'af-ZA': 'Afrikaans (South Africa)',
'ar': 'Arabic',
'ar-AE': 'Arabic (U.A.E.)',
'ar-BH': 'Arabic (Bahrain)',
'ar-DZ': 'Arabic (Algeria)',