BIBFRAME 2.0 to DP.LA MAPv4

For the Plains2Peaks.org DP.LA regional service hub for Colorado and Wyoming, a RML rules map bf-to-map4.ttl takes BIBFRAME 2.0 RDF and processes to a new JSON-LD for ingestion into DP.LA using a ResourceSync feed and dump.

First, we will create an another instance of SPARQLProcessor and use a different RML map bf-to-map4.ttl. For the source RDF triples, we will use the previous topic's BIBFRAME RDF,


>>> bf2map_processor = processor.SPARQLProcessor(
    rml_rules=['bf-to-map4.ttl'],
    triplestore=dc_processor.output)

Now, we will use the item_iri and instance_iri to run the mapping from BIBFRAME to MAPv4


>>> bf2map_processor.run(
        instance_iri='https://www.denverlibrary.org/57154f74-c5cb-11e7-9f30-ac87a3129ce6',
        item_iri='http://cdm16079.contentdm.oclc.org:80/cdm/ref/collection/p15330coll22/id/68544')

To see the resulting MAPv4 RDF Graph, we will serialize as turtle:

 >>> print(bf2map_processor.output.serialize(format='turtle').decode())


@prefix bf: <http://id.loc.gov/ontologies/bibframe/> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix dpla: <http://dp.la/about/map/> .
@prefix edm: <http://www.europeana.eu/schemas/edm/> .
@prefix kds: <http://knowledgelinks.io/ns/data-structures/> .
@prefix locn: <http://www.w3.org/ns/locn#> .
@prefix ore: <http://www.openarchives.org/ore/terms/> .
@prefix oslo: <http://purl.org/oslo/ns/localgov#> .
@prefix ql: <http://semweb.mmlab.be/ns/ql#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix vcard: <http://www.w3.org/2006/vcard/ns#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<https://www.denverlibrary.org/57154f74-c5cb-11e7-9f30-ac87a3129ce6#Work> a ore:Aggregation ;
    edm:aggregatedCHO <https://www.denverlibrary.org/57154f74-c5cb-11e7-9f30-ac87a3129ce6> ;
    edm:dataProvider <https://www.denverlibrary.org/> ;
    edm:isShownAt <http://cdm16079.contentdm.oclc.org:80/cdm/ref/collection/p15330coll22/id/68544> .

<http://cdm16079.contentdm.oclc.org:80/cdm/ref/collection/p15330coll22/id/68544> a edm:WebResource .

<https://www.denverlibrary.org/57154f74-c5cb-11e7-9f30-ac87a3129ce6> a dpla:SourceResource ;
    dc:date "12/23/2010" ;
    dcterms:creator "N31e3e5a7f2cd40ed96fce3bfd50aa901" ;
    dcterms:description "Major John M. Burke, head and shoulders studio portrait, wearing hat, suit jacket and vest; Wild West promoter and Indian Agent."^^xsd:string ;
    dcterms:extent "1 copy photonegative ; 15 x 11 cm. (5 3/4 x 4 1/4 in.); 1 photonegative : glass ; 26 x 21 cm. (10 x 8 in.); 1 photoprint ; 24 x 18 cm. (9 1/4 x 7 in.)"^^xsd:string ;
    dcterms:identifier "34837596"^^xsd:string,
        "B-529"^^xsd:string ;
    dcterms:title "Major John Burke, bust"^^xsd:string .


Switching to a different output vocabulary is the focus on the next exercise.

Original contented Copyrighted © 2017 by Jeremy Nelson and KnowledgeLinks under Creative Commons License, Source code repository licensed under the Apache 2 and available on Github.