Last active
February 16, 2024 22:23
-
-
Save edsu/7d2d8fb2049075e76bfdf106b8805220 to your computer and use it in GitHub Desktop.
Get some usable JSON for a given LC name or subject authority string: e.g. `./lcauthority.py "Southampton (England)"`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"@context": { | |
"mads": "http://www.loc.gov/mads/rdf/v1#", | |
"@vocab": "http://www.w3.org/2004/02/skos/core#", | |
"skosxl": "http://www.w3.org/2008/05/skos-xl#", | |
"recordinfo": "http://id.loc.gov/ontologies/RecordInfo#", | |
"identifiers": "http://id.loc.gov/vocabulary/identifiers/", | |
"bflc": "http://id.loc.gov/ontologies/bflc/", | |
"iso6392": "http://id.loc.gov/vocabulary/iso639-2/", | |
"changeset": "http://purl.org/vocab/changeset/schema#" | |
}, | |
"@id": "http://id.loc.gov/authorities/names/n79072768", | |
"@type": [ | |
"mads:Geographic", | |
"mads:Authority", | |
"Concept" | |
], | |
"bflc:marcKey": "151 $aSouthampton (England)", | |
"identifiers:lccn": "n 79072768", | |
"identifiers:local": "(OCoLC)oca00305516", | |
"mads:adminMetadata": [ | |
{ | |
"@type": "recordinfo:RecordInfo", | |
"recordinfo:languageOfCataloging": { | |
"@id": "iso6392:eng" | |
}, | |
"recordinfo:recordChangeDate": { | |
"@type": "http://www.w3.org/2001/XMLSchema#dateTime", | |
"@value": "1979-08-16T00:00:00" | |
}, | |
"recordinfo:recordContentSource": { | |
"@id": "http://id.loc.gov/vocabulary/organizations/dlc" | |
}, | |
"recordinfo:recordStatus": { | |
"@type": "http://www.w3.org/2001/XMLSchema#string", | |
"@value": "new" | |
} | |
}, | |
{ | |
"@type": "recordinfo:RecordInfo", | |
"recordinfo:languageOfCataloging": { | |
"@id": "iso6392:eng" | |
}, | |
"recordinfo:recordChangeDate": { | |
"@type": "http://www.w3.org/2001/XMLSchema#dateTime", | |
"@value": "2014-04-25T17:12:06" | |
}, | |
"recordinfo:recordContentSource": { | |
"@id": "http://id.loc.gov/vocabulary/organizations/dlc" | |
}, | |
"recordinfo:recordStatus": { | |
"@type": "http://www.w3.org/2001/XMLSchema#string", | |
"@value": "revised" | |
} | |
} | |
], | |
"mads:authoritativeLabel": "Southampton (England)", | |
"mads:code": { | |
"@type": "http://id.loc.gov/datatypes/codes/gac", | |
"@value": "e-uk-en" | |
}, | |
"mads:editorialNote": "[Old catalog heading: Southampton, Eng.]", | |
"mads:elementList": { | |
"@list": [ | |
{ | |
"@type": "mads:GeographicElement", | |
"mads:elementValue": "Southampton (England)" | |
} | |
] | |
}, | |
"mads:hasCloseExternalAuthority": [ | |
{ | |
"@id": "https://id.worldcat.org/fast/1343677", | |
"@type": [ | |
"mads:Authority", | |
"Concept" | |
], | |
"mads:authoritativeLabel": "England Southampton Region", | |
"prefLabel": "England Southampton Region" | |
}, | |
{ | |
"@id": "https://id.worldcat.org/fast/1205666", | |
"@type": [ | |
"mads:Authority", | |
"Concept" | |
], | |
"mads:authoritativeLabel": "England Southampton", | |
"prefLabel": "England Southampton" | |
}, | |
{ | |
"@id": "http://data.bnf.fr/ark:/12148/cb11962315f", | |
"@type": [ | |
"mads:Authority", | |
"Concept" | |
], | |
"mads:authoritativeLabel": { | |
"@language": "fr", | |
"@value": "Southampton (GB)" | |
}, | |
"prefLabel": { | |
"@language": "fr", | |
"@value": "Southampton (GB)" | |
} | |
}, | |
{ | |
"@id": "http://www.wikidata.org/entity/Q79848", | |
"@type": [ | |
"mads:Authority", | |
"Concept" | |
], | |
"mads:authoritativeLabel": "Southampton", | |
"prefLabel": "Southampton" | |
}, | |
{ | |
"@id": "https://id.worldcat.org/fast/1343676", | |
"@type": [ | |
"mads:Authority", | |
"Concept" | |
], | |
"mads:authoritativeLabel": "England Southampton Metropolitan Area", | |
"prefLabel": "England Southampton Metropolitan Area" | |
} | |
], | |
"mads:hasEarlierEstablishedForm": { | |
"@type": [ | |
"mads:Geographic", | |
"mads:Variant" | |
], | |
"mads:elementList": { | |
"@list": [ | |
{ | |
"@type": "mads:GeographicElement", | |
"mads:elementValue": "Southampton (Hampshire)" | |
} | |
] | |
}, | |
"mads:variantLabel": "Southampton (Hampshire)" | |
}, | |
"mads:hasExactExternalAuthority": { | |
"@id": "http://viaf.org/viaf/sourceID/LC%7Cn++79072768#skos:Concept" | |
}, | |
"mads:hasSource": [ | |
{ | |
"@type": "mads:Source", | |
"mads:citationSource": "Adshead, S. D. The replanning of Southampton, 1942.", | |
"mads:citationStatus": "found" | |
}, | |
{ | |
"@type": "mads:Source", | |
"mads:citationNote": "(Southampton (England))", | |
"mads:citationSource": "BL hdg.", | |
"mads:citationStatus": "found" | |
}, | |
{ | |
"@type": "mads:Source", | |
"mads:citationNote": "t.p. (County Borough of Southampton)", | |
"mads:citationSource": "Annual report on school medical work ... 1923:", | |
"mads:citationStatus": "found" | |
}, | |
{ | |
"@type": "mads:Source", | |
"mads:citationNote": "(ppl; 50\u00b054\u02b900\u02baN 001\u00b024\u02b900\u02baW)", | |
"mads:citationSource": "GeoNames, algorithmically matched, 2009", | |
"mads:citationStatus": "found" | |
} | |
], | |
"mads:hasVariant": [ | |
{ | |
"@type": [ | |
"mads:Geographic", | |
"mads:Variant" | |
], | |
"mads:elementList": { | |
"@list": [ | |
{ | |
"@type": "mads:GeographicElement", | |
"mads:elementValue": "Southampton (Hampshire)" | |
} | |
] | |
}, | |
"mads:variantLabel": "Southampton (Hampshire)" | |
}, | |
{ | |
"@type": [ | |
"mads:Geographic", | |
"mads:Variant" | |
], | |
"mads:elementList": { | |
"@list": [ | |
{ | |
"@type": "mads:GeographicElement", | |
"mads:elementValue": "County Borough of Southampton" | |
} | |
] | |
}, | |
"mads:variantLabel": "County Borough of Southampton" | |
} | |
], | |
"mads:identifiesRWO": { | |
"@id": "http://id.loc.gov/rwo/agents/n79072768", | |
"@type": [ | |
"mads:RWO", | |
"http://www.loc.gov/standards/mads/rdf/v1#Geographic" | |
], | |
"bflc:subjectOf": [ | |
{ | |
"@id": "http://id.loc.gov/resources/works/7394958", | |
"@type": "http://id.loc.gov/ontologies/bibframe/Work", | |
"bflc:aap": "Adshead, S. D. replanning of Southampton: report of S.D. Adshead ... and H. T. Cook ... the the Council of the county borough of Southampton. With a section on buildings and monuments of historical and architectural value, by O. G. S. Crawford, F.S.A. February 1942" | |
}, | |
{ | |
"@id": "http://id.loc.gov/resources/works/9692091", | |
"@type": "http://id.loc.gov/ontologies/bibframe/Work", | |
"bflc:aap": "Southampton Civic Society. Civic Survey Committee. Southampton; a civic survey, being a report of the Civic Survey Committee of the Southampton Civic Society under the chairmanship of Brigadier E.M. Jack .." | |
} | |
], | |
"http://www.w3.org/2000/01/rdf-schema#label": "Southampton (England)" | |
}, | |
"mads:isMemberOfMADSCollection": [ | |
{ | |
"@id": "http://id.loc.gov/authorities/names/collection_NamesAuthorizedHeadings" | |
}, | |
{ | |
"@id": "http://id.loc.gov/authorities/names/collection_LCNAF" | |
} | |
], | |
"mads:isMemberOfMADSScheme": { | |
"@id": "http://id.loc.gov/authorities/names" | |
}, | |
"altLabel": [ | |
"Southampton (Hampshire)", | |
"County Borough of Southampton" | |
], | |
"changeNote": [ | |
{ | |
"@type": "changeset:ChangeSet", | |
"changeset:changeReason": { | |
"@type": "http://www.w3.org/2001/XMLSchema#string", | |
"@value": "new" | |
}, | |
"changeset:createdDate": { | |
"@type": "http://www.w3.org/2001/XMLSchema#dateTime", | |
"@value": "1979-08-16T00:00:00" | |
}, | |
"changeset:creatorName": { | |
"@id": "http://id.loc.gov/vocabulary/organizations/dlc" | |
}, | |
"changeset:subjectOfChange": { | |
"@id": "http://id.loc.gov/authorities/names/n79072768" | |
} | |
}, | |
{ | |
"@type": "changeset:ChangeSet", | |
"changeset:changeReason": { | |
"@type": "http://www.w3.org/2001/XMLSchema#string", | |
"@value": "revised" | |
}, | |
"changeset:createdDate": { | |
"@type": "http://www.w3.org/2001/XMLSchema#dateTime", | |
"@value": "2014-04-25T17:12:06" | |
}, | |
"changeset:creatorName": { | |
"@id": "http://id.loc.gov/vocabulary/organizations/dlc" | |
}, | |
"changeset:subjectOfChange": { | |
"@id": "http://id.loc.gov/authorities/names/n79072768" | |
} | |
} | |
], | |
"closeMatch": [ | |
{ | |
"@id": "https://id.worldcat.org/fast/1343677", | |
"@type": [ | |
"mads:Authority", | |
"Concept" | |
], | |
"mads:authoritativeLabel": "England Southampton Region", | |
"prefLabel": "England Southampton Region" | |
}, | |
{ | |
"@id": "https://id.worldcat.org/fast/1205666", | |
"@type": [ | |
"mads:Authority", | |
"Concept" | |
], | |
"mads:authoritativeLabel": "England Southampton", | |
"prefLabel": "England Southampton" | |
}, | |
{ | |
"@id": "http://data.bnf.fr/ark:/12148/cb11962315f", | |
"@type": [ | |
"mads:Authority", | |
"Concept" | |
], | |
"mads:authoritativeLabel": { | |
"@language": "fr", | |
"@value": "Southampton (GB)" | |
}, | |
"prefLabel": { | |
"@language": "fr", | |
"@value": "Southampton (GB)" | |
} | |
}, | |
{ | |
"@id": "http://www.wikidata.org/entity/Q79848", | |
"@type": [ | |
"mads:Authority", | |
"Concept" | |
], | |
"mads:authoritativeLabel": "Southampton", | |
"prefLabel": "Southampton" | |
}, | |
{ | |
"@id": "https://id.worldcat.org/fast/1343676", | |
"@type": [ | |
"mads:Authority", | |
"Concept" | |
], | |
"mads:authoritativeLabel": "England Southampton Metropolitan Area", | |
"prefLabel": "England Southampton Metropolitan Area" | |
} | |
], | |
"editorialNote": "[Old catalog heading: Southampton, Eng.]", | |
"exactMatch": { | |
"@id": "http://viaf.org/viaf/sourceID/LC%7Cn++79072768#skos:Concept" | |
}, | |
"inScheme": { | |
"@id": "http://id.loc.gov/authorities/names" | |
}, | |
"notation": { | |
"@type": "http://id.loc.gov/datatypes/codes/gac", | |
"@value": "e-uk-en" | |
}, | |
"prefLabel": "Southampton (England)", | |
"skosxl:altLabel": [ | |
{ | |
"@type": "skosxl:Label", | |
"skosxl:literalForm": "Southampton (Hampshire)" | |
}, | |
{ | |
"@type": "skosxl:Label", | |
"skosxl:literalForm": "County Borough of Southampton" | |
} | |
] | |
} |
Yeah, I noticed the compaction wasn't needed too. I updated the gist accordingly.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I solved the same problem without JSON-LD compaction using the code below.
I agree that LC should define a useful context and compact their data so we all don't have to do #%^@(&#%^ like this!
(some internal processing elided for ease)