jpnelson@KL-ThinkPad-T470:~/2018$ python3 Python 3.6.4 (default, Feb 8 2018, 13:45:45) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>> exit() jpnelson@KL-ThinkPad-T470:~/2018$ clear jpnelson@KL-ThinkPad-T470:~/2018$ python3 Python 3.6.4 (default, Feb 8 2018, 13:45:45) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>> exit() jpnelson@KL-ThinkPad-T470:~/2018$ python3 -m venv test-py3 jpnelson@KL-ThinkPad-T470:~/2018$ ls alliance-bibcat grow-hub py3-env bibcat introduction-to-bibcat rdfframework bibcat-publisher intro-to-elastic test-py3 cc-scholarship-graph intro-to-mongodb tiger-catalog code4lib-2018 knowledgelinks.github.io tmp digital-cc marc2bibframe2 uikit dpla-service-hub melissa-arches year-in-aiki floyds-dreams-of-dylan openrefine-2.8 garage-workshop Plains2PeaksPilot jpnelson@KL-ThinkPad-T470:~/2018$ cd test-py3/ jpnelson@KL-ThinkPad-T470:~/2018/test-py3$ ls bin include lib lib64 pyvenv.cfg jpnelson@KL-ThinkPad-T470:~/2018/test-py3$ cd .. jpnelson@KL-ThinkPad-T470:~/2018$ source test-py3/bin/activate (test-py3) jpnelson@KL-ThinkPad-T470:~/2018$ pip install bibcat Collecting bibcat Downloading bibcat-2.0.5.tar.gz (62kB) 100% |████████████████████████████████| 71kB 503kB/s Collecting Flask (from bibcat) Using cached Flask-0.12.2-py2.py3-none-any.whl Collecting jsonpath_ng (from bibcat) Using cached jsonpath_ng-1.4.3-py2.py3-none-any.whl Collecting lxml (from bibcat) Using cached lxml-4.1.1-cp36-cp36m-manylinux1_x86_64.whl Collecting pymarc (from bibcat) Using cached pymarc-3.1.7.tar.gz Requirement already satisfied: rdflib in ./test-py3/lib/python3.6/site-packages (from bibcat) Collecting rdflib-jsonld (from bibcat) Using cached rdflib-jsonld-0.4.0.tar.gz Collecting requests (from bibcat) Using cached requests-2.18.4-py2.py3-none-any.whl Collecting itsdangerous>=0.21 (from Flask->bibcat) Using cached itsdangerous-0.24.tar.gz Collecting Jinja2>=2.4 (from Flask->bibcat) Using cached Jinja2-2.10-py2.py3-none-any.whl Collecting Werkzeug>=0.7 (from Flask->bibcat) Using cached Werkzeug-0.14.1-py2.py3-none-any.whl Collecting click>=2.0 (from Flask->bibcat) Using cached click-6.7-py2.py3-none-any.whl Collecting decorator (from jsonpath_ng->bibcat) Using cached decorator-4.2.1-py2.py3-none-any.whl Requirement already satisfied: six in ./test-py3/lib/python3.6/site-packages (from jsonpath_ng->bibcat) Collecting ply (from jsonpath_ng->bibcat) Using cached ply-3.10.tar.gz Requirement already satisfied: pyparsing in ./test-py3/lib/python3.6/site-packages (from rdflib->bibcat) Requirement already satisfied: isodate in ./test-py3/lib/python3.6/site-packages (from rdflib->bibcat) Collecting chardet<3.1.0,>=3.0.2 (from requests->bibcat) Using cached chardet-3.0.4-py2.py3-none-any.whl Collecting certifi>=2017.4.17 (from requests->bibcat) Using cached certifi-2018.1.18-py2.py3-none-any.whl Collecting idna<2.7,>=2.5 (from requests->bibcat) Using cached idna-2.6-py2.py3-none-any.whl Collecting urllib3<1.23,>=1.21.1 (from requests->bibcat) Using cached urllib3-1.22-py2.py3-none-any.whl Collecting MarkupSafe>=0.23 (from Jinja2>=2.4->Flask->bibcat) Using cached MarkupSafe-1.0.tar.gz Installing collected packages: itsdangerous, MarkupSafe, Jinja2, Werkzeug, click, Flask, decorator, ply, jsonpath-ng, lxml, pymarc, rdflib-jsonld, chardet, certifi, idna, urllib3, requests, bibcat Running setup.py install for itsdangerous ... done Running setup.py install for MarkupSafe ... done Running setup.py install for ply ... done Running setup.py install for pymarc ... done Running setup.py install for rdflib-jsonld ... done Running setup.py install for bibcat ... done Successfully installed Flask-0.12.2 Jinja2-2.10 MarkupSafe-1.0 Werkzeug-0.14.1 bibcat-2.0.5 certifi-2018.1.18 chardet-3.0.4 click-6.7 decorator-4.2.1 idna-2.6 itsdangerous-0.24 jsonpath-ng-1.4.3 lxml-4.1.1 ply-3.10 pymarc-3.1.7 rdflib-jsonld-0.4.0 requests-2.18.4 urllib3-1.22 (test-py3) jpnelson@KL-ThinkPad-T470:~/2018$ python Python 3.6.4 (default, Feb 8 2018, 13:45:45) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import bibcat INFO:rdflib:RDFLib Version: 4.2.2 >>> bibcat.__version__ '2.0.5' >>> import rdflib >>> graph1 = rdflib.Graph() >>> graph1 )> >>> BF = rdflib.Namespace("http://id.loc.gov/ontologies/bibframe/") >>> len(graph1) 0 >>> graph1.namespace_manager.bind("bf", BF) >>> first_iri = rdflib.URIRef("http://example.com/1234") >>> graph1.add((first_iri, rdflib.RDF.type, BF.Item)) >>> len(graph1) 1 >>> print(graph1.serialize(format='turtle').decode()) @prefix bf: . @prefix rdf: . @prefix rdfs: . @prefix xml: . @prefix xsd: . a bf:Item . >>> bibcat._is_valid_iri("http://example.com/12345") Traceback (most recent call last): File "", line 1, in AttributeError: module 'bibcat' has no attribute '_is_valid_iri' >>> bibcat._is_valid_uri("http://example.com/2345") True >>> bibcat._is_valid_uri("http://example.com/123445 ") False >>> bibcat.slugify("A very good morning to all of us") 'a-very-good-morning-to-all-of-us' >>> bibcat.wikify("A Very Good morning") 'A_Very_Good_morning' >>> exit() (test-py3) jpnelson@KL-ThinkPad-T470:~/2018$ ls alliance-bibcat grow-hub py3-env bibcat introduction-to-bibcat rdfframework bibcat-publisher intro-to-elastic test-py3 cc-scholarship-graph intro-to-mongodb tiger-catalog code4lib-2018 knowledgelinks.github.io tmp digital-cc marc2bibframe2 uikit dpla-service-hub melissa-arches year-in-aiki floyds-dreams-of-dylan openrefine-2.8 garage-workshop Plains2PeaksPilot (test-py3) jpnelson@KL-ThinkPad-T470:~/2018$ git clone https://github.com/lcnetdev/marc2bibframe2.git fatal: destination path 'marc2bibframe2' already exists and is not an empty directory. (test-py3) jpnelson@KL-ThinkPad-T470:~/2018$ cd tmp (test-py3) jpnelson@KL-ThinkPad-T470:~/2018/tmp$ ls eskean openrefine-linux-2.8.tar.gz rdfw_base eskean_100.tar.gz Python-3.6.4 title.py full-record-load.mrc Python-3.6.4.tar.xz tutt-marc-full-01-08-18.out (test-py3) jpnelson@KL-ThinkPad-T470:~/2018/tmp$ git clone https://github.com/lcnetdev/marc2bibframe2.git Cloning into 'marc2bibframe2'... remote: Counting objects: 3404, done. remote: Total 3404 (delta 0), reused 0 (delta 0), pack-reused 3404 Receiving objects: 100% (3404/3404), 1.73 MiB | 1.35 MiB/s, done. Resolving deltas: 100% (2528/2528), done. Checking connectivity... done. (test-py3) jpnelson@KL-ThinkPad-T470:~/2018/tmp$ ls eskean openrefine-linux-2.8.tar.gz title.py eskean_100.tar.gz Python-3.6.4 tutt-marc-full-01-08-18.out full-record-load.mrc Python-3.6.4.tar.xz marc2bibframe2 rdfw_base (test-py3) jpnelson@KL-ThinkPad-T470:~/2018/tmp$ cd marc2bibframe2/ (test-py3) jpnelson@KL-ThinkPad-T470:~/2018/tmp/marc2bibframe2$ ls dataset IDMETA marc2bibframe2.spec NEWS record-conv.xml xsl deploy LICENSE.md metaproxy README.md test (test-py3) jpnelson@KL-ThinkPad-T470:~/2018/tmp/marc2bibframe2$ cd ../../ (test-py3) jpnelson@KL-ThinkPad-T470:~/2018$ cd marc2bibframe2/ (test-py3) jpnelson@KL-ThinkPad-T470:~/2018/marc2bibframe2$ cd .. (test-py3) jpnelson@KL-ThinkPad-T470:~/2018$ python Python 3.6.4 (default, Feb 8 2018, 13:45:45) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import pymarc >>> marc_reader = pymarc.MARCReader(open("/home/jpnelson/Downloads/pride-and-prejudice.mrc", "rb"), to_unicode=True) >>> first_rec = next(marc_reader) >>> first_rec >>> print(first_rec) =LDR 03165cgm 2200721Ia 45 0 =001 48075651 =003 OCoLC =005 20041012112205.0 =007 vd\\v\\\ =008 011003s2001\\\\enk300\g\\\\\\\\\\vleng\d =020 \\$a0767038266 : =020 \\$a0767038274 (v. 1) =020 \\$a0767038282 (v. 2) =028 42$aAAE-70255--AAE-72056$bA & E Home Video =035 \\$a.b1629290x$btvdvd$cc =040 \\$aIFJ$cIFJ$dOCLCQ$dRLS$dOCLCQ$dIHI$dOCLCQ$dFVC$dOCLCQ =043 \\$ae-uk-en =049 \\$aCOCA =090 \\$aPN1997$b.P761 2001 =090 \\$aPN1997$b.P761 2001 =245 00$aJane Austen's Pride and prejudice$h[videorecording] /$ca co-production of BBC Television and BBC Worldwide Americas, Inc. in association with A & E Network ; screenplay by Andrew Davies ; directed by Simon Langton ; produced by Sue Birtwistle. =246 30$aPride and prejudice. =250 \\$aSpecial ed. =260 \\$a[London?] :$bBritish Broadcasting Corp.,$c2001. =300 \\$a2 videodiscs (300 min.) :$bsd., col. ;$c4 3/4 in. +$e1 booklet. =538 \\$aDVD; Dolby, digital, stereo. =511 1\$aColin Firth, Jennifer Ehle, Alison Steadman, Benjamin Whitrow, Susannah Harker, Crispin Bonham-Carter, Anna Chancellor, Julia Sawalha, David Bamber, David Bark-Jones. =508 \\$aPhotography, John Kenway ; film editor, Peter Coulson ; music, Carl Davis. =500 \\$aOriginally produced for 1995 miniseries television broadcast. =500 \\$aBased on the novel by Jane Austen. =500 \\$aFilm format: anamorphic widescreen (2.35:1) =500 \\$aBooklet (7 p.) includes list of chapters, and cast and crew reminiscences. =521 8\$aNot rated. =520 \\$aThe story of lively and rebellious Elizabeth, one of five unmarried daughters living in the countryside of 19th century England, in a world where an advantageous marriage is a woman's sole occupation. =500 \\$aSpecial features: vol. 1: biographies ; vol. 2: featurette (The making of Pride and prejudice) =600 10$aAusten, Jane,$d1775-1817$vFilm adaptations. =650 \0$aYoung women$zEngland$vDrama. =650 \0$aCourtship$zEngland$vDrama. =650 \0$aTelevision adaptations. =650 \0$aTelevision mini-series. =651 \0$aEngland$xSocial life and customs$y19th century$vDrama. =655 \7$aLove stories. =690 \\$aFeature films$vDVD. =690 \\$aLiterature$vDVD. =700 1\$aFirth, Colin,$d1960- =700 1\$aEhle, Jennifer,$d1969- =700 1\$aSteadman, Alison,$d1946- =700 1\$aWhitrow, Benjamin. =700 1\$aHarker, Susannah. =700 1\$aBonham-Carter, Crispin. =700 1\$aChancellor, Anna. =700 1\$aSawalha, Julia,$d1968- =700 1\$aBamber, David. =700 1\$aLangton, Simon. =700 1\$aAusten, Jane,$d1775-1817.$tPride and prejudice. =710 2\$aArts and Entertainment Network. =710 2\$aBritish Broadcasting Corporation. =710 2\$aA & E Home Video (Firm) =907 \\$a.b1629290x =902 \\$a130106 =999 \\$b2$c041012$dm$eg$fc$g0 =994 \\$atvdvd =945 \\$aPN1997$b.P761 2001$cv. 1$g1$i33027005139922$j0$ltvdvd$h0$o2$p$0.00$qn$r-$s-$t14$u31$v0$w0$x1$y.i1672253x$z050628 >>> print(first_rec) =LDR 03165cgm 2200721Ia 45 0 =001 48075651 =003 OCoLC =005 20041012112205.0 =007 vd\\v\\\ =008 011003s2001\\\\enk300\g\\\\\\\\\\vleng\d =020 \\$a0767038266 : =020 \\$a0767038274 (v. 1) =020 \\$a0767038282 (v. 2) =028 42$aAAE-70255--AAE-72056$bA & E Home Video =035 \\$a.b1629290x$btvdvd$cc =040 \\$aIFJ$cIFJ$dOCLCQ$dRLS$dOCLCQ$dIHI$dOCLCQ$dFVC$dOCLCQ =043 \\$ae-uk-en =049 \\$aCOCA =090 \\$aPN1997$b.P761 2001 =090 \\$aPN1997$b.P761 2001 =245 00$aJane Austen's Pride and prejudice$h[videorecording] /$ca co-production of BBC Television and BBC Worldwide Americas, Inc. in association with A & E Network ; screenplay by Andrew Davies ; directed by Simon Langton ; produced by Sue Birtwistle. =246 30$aPride and prejudice. =250 \\$aSpecial ed. =260 \\$a[London?] :$bBritish Broadcasting Corp.,$c2001. =300 \\$a2 videodiscs (300 min.) :$bsd., col. ;$c4 3/4 in. +$e1 booklet. =538 \\$aDVD; Dolby, digital, stereo. =511 1\$aColin Firth, Jennifer Ehle, Alison Steadman, Benjamin Whitrow, Susannah Harker, Crispin Bonham-Carter, Anna Chancellor, Julia Sawalha, David Bamber, David Bark-Jones. =508 \\$aPhotography, John Kenway ; film editor, Peter Coulson ; music, Carl Davis. =500 \\$aOriginally produced for 1995 miniseries television broadcast. =500 \\$aBased on the novel by Jane Austen. =500 \\$aFilm format: anamorphic widescreen (2.35:1) =500 \\$aBooklet (7 p.) includes list of chapters, and cast and crew reminiscences. =521 8\$aNot rated. =520 \\$aThe story of lively and rebellious Elizabeth, one of five unmarried daughters living in the countryside of 19th century England, in a world where an advantageous marriage is a woman's sole occupation. =500 \\$aSpecial features: vol. 1: biographies ; vol. 2: featurette (The making of Pride and prejudice) =600 10$aAusten, Jane,$d1775-1817$vFilm adaptations. =650 \0$aYoung women$zEngland$vDrama. =650 \0$aCourtship$zEngland$vDrama. =650 \0$aTelevision adaptations. =650 \0$aTelevision mini-series. =651 \0$aEngland$xSocial life and customs$y19th century$vDrama. =655 \7$aLove stories. =690 \\$aFeature films$vDVD. =690 \\$aLiterature$vDVD. =700 1\$aFirth, Colin,$d1960- =700 1\$aEhle, Jennifer,$d1969- =700 1\$aSteadman, Alison,$d1946- =700 1\$aWhitrow, Benjamin. =700 1\$aHarker, Susannah. =700 1\$aBonham-Carter, Crispin. =700 1\$aChancellor, Anna. =700 1\$aSawalha, Julia,$d1968- =700 1\$aBamber, David. =700 1\$aLangton, Simon. =700 1\$aAusten, Jane,$d1775-1817.$tPride and prejudice. =710 2\$aArts and Entertainment Network. =710 2\$aBritish Broadcasting Corporation. =710 2\$aA & E Home Video (Firm) =907 \\$a.b1629290x =902 \\$a130106 =999 \\$b2$c041012$dm$eg$fc$g0 =994 \\$atvdvd =945 \\$aPN1997$b.P761 2001$cv. 1$g1$i33027005139922$j0$ltvdvd$h0$o2$p$0.00$qn$r-$s-$t14$u31$v0$w0$x1$y.i1672253x$z050628 >>> first_rec >>> import lxml.etree >>> marc2bibframe2 = lxml.etree.XSLT(lxml.etree.parse("/home/jpnelson/2018/marc2bibframe2/xsl/marc2bibframe2.xsl") ... ) >>> marc2bibframe2 >>> raw_xml = pymarc.record_to_xml(first_rec, namespace=True) >>> raw_xml b'03165cgm 2200721Ia 45 048075651OCoLC20041012112205.0vd v 011003s2001 enk300 g vleng d0767038266 :0767038274 (v. 1)0767038282 (v. 2)AAE-70255--AAE-72056A & E Home Video.b1629290xtvdvdcIFJIFJOCLCQRLSOCLCQIHIOCLCQFVCOCLCQe-uk-enCOCAPN1997.P761 2001PN1997.P761 2001Jane Austen\'s Pride and prejudice[videorecording] /a co-production of BBC Television and BBC Worldwide Americas, Inc. in association with A & E Network ; screenplay by Andrew Davies ; directed by Simon Langton ; produced by Sue Birtwistle.Pride and prejudice.Special ed.[London?] :British Broadcasting Corp.,2001.2 videodiscs (300 min.) :sd., col. ;4 3/4 in. +1 booklet.DVD; Dolby, digital, stereo.Colin Firth, Jennifer Ehle, Alison Steadman, Benjamin Whitrow, Susannah Harker, Crispin Bonham-Carter, Anna Chancellor, Julia Sawalha, David Bamber, David Bark-Jones.Photography, John Kenway ; film editor, Peter Coulson ; music, Carl Davis.Originally produced for 1995 miniseries television broadcast.Based on the novel by Jane Austen.Film format: anamorphic widescreen (2.35:1)Booklet (7 p.) includes list of chapters, and cast and crew reminiscences.Not rated.The story of lively and rebellious Elizabeth, one of five unmarried daughters living in the countryside of 19th century England, in a world where an advantageous marriage is a woman\'s sole occupation.Special features: vol. 1: biographies ; vol. 2: featurette (The making of Pride and prejudice)Austen, Jane,1775-1817Film adaptations.Young womenEnglandDrama.CourtshipEnglandDrama.Television adaptations.Television mini-series.EnglandSocial life and customs19th centuryDrama.Love stories.Feature filmsDVD.LiteratureDVD.Firth, Colin,1960-Ehle, Jennifer,1969-Steadman, Alison,1946-Whitrow, Benjamin.Harker, Susannah.Bonham-Carter, Crispin.Chancellor, Anna.Sawalha, Julia,1968-Bamber, David.Langton, Simon.Austen, Jane,1775-1817.Pride and prejudice.Arts and Entertainment Network.British Broadcasting Corporation.A & E Home Video (Firm).b1629290x1301062041012mgc0tvdvdPN1997.P761 2001v. 11330270051399220tvdvd02$0.00n--1431001.i1672253x050628' >>> marc_xml = lxml.etree.XML(raw_xml) >>> marc_xml >>> bf_rdf_xml = marc2bibframe2(marc_xml) >>> bf_rdf_xml >>> bf_raw_xml = lxml.etree.to_string(bf_rdf_xml) Traceback (most recent call last): File "", line 1, in AttributeError: module 'lxml.etree' has no attribute 'to_string' >>> bf_raw_xml= lxml.etree.tostring(bf_rdf_xml) >>> bf_raw_xml b'DLC marc2bibframe2 v1.4.0-SNAPSHOT: 2018-02-13T11:07:39-05:00cuaacr48075651OCoLC2004-10-12T11:22:052001-10-03IFJIFJOCLCQRLSOCLCQIHIOCLCQFVCOCLCQgeneralvideorecording300Jane Austen\'s Pride and prejudiceJane Austen\'s Pride and prejudiceJane Austen\'s Pride and prejudiceJane Austen\'s Pride and prejudicevideorecordingCast: Colin Firth, Jennifer Ehle, Alison Steadman, Benjamin Whitrow, Susannah Harker, Crispin Bonham-Carter, Anna Chancellor, Julia Sawalha, David Bamber, David Bark-Jones.Photography, John Kenway ; film editor, Peter Coulson ; music, Carl Davis.The story of lively and rebellious Elizabeth, one of five unmarried daughters living in the countryside of 19th century England, in a world where an advantageous marriage is a woman\'s sole occupation.Austen, Jane, 1775-1817--Film adaptations.lcshAusten, Jane, 1775-181760010$aAusten, Jane,$d1775-1817$vFilm adaptations.Austen, Jane, 1775-1817Young women--England--Drama.Young women--England--Drama.Young womenEnglandDramalcshCourtship--England--Drama.Courtship--England--Drama.CourtshipEnglandDramalcshTelevision adaptations.Television adaptations.lcshTelevision mini-series.Television mini-series.lcshEngland--Social life and customs--19th century--Drama.England--Social life and customs--19th century--Drama.EnglandSocial life and customs19th centuryDramalcshLove stories.Love stories.Firth, Colin, 1960-7001 $aFirth, Colin,$d1960-Firth, Colin, 1960-Ehle, Jennifer, 1969-7001 $aEhle, Jennifer,$d1969-Ehle, Jennifer, 1969-Steadman, Alison, 1946-7001 $aSteadman, Alison,$d1946-Steadman, Alison, 1946-Whitrow, Benjamin.7001 $aWhitrow, Benjamin.Whitrow, Benjamin.Harker, Susannah.7001 $aHarker, Susannah.Harker, Susannah.Bonham-Carter, Crispin.7001 $aBonham-Carter, Crispin.Bonham-Carter, Crispin.Chancellor, Anna.7001 $aChancellor, Anna.Chancellor, Anna.Sawalha, Julia, 1968-7001 $aSawalha, Julia,$d1968-Sawalha, Julia, 1968-Bamber, David.7001 $aBamber, David.Bamber, David.Langton, Simon.7001 $aLangton, Simon.Langton, Simon.Austen, Jane, 1775-1817.7001 $aAusten, Jane,$d1775-1817.$tPride and prejudice.Austen, Jane, 1775-1817.Pride and prejudice.Pride and prejudice.7001 $aAusten, Jane,$d1775-1817.$tPride and prejudice.Pride and prejudice.Pride and prejudice.Pride and prejudiceArts and Entertainment Network.7102 $aArts and Entertainment Network.Arts and Entertainment Network.British Broadcasting Corporation.7102 $aBritish Broadcasting Corporation.British Broadcasting Corporation.A & E Home Video (Firm)7102 $aA & E Home Video (Firm)A & E Home Video (Firm)videodiscDVD2001techniquelive action07670382660767038274 (v. 1)0767038282 (v. 2)AAE-70255--AAE-72056A & E Home Video.b1629290xcJane Austen\'s Pride and prejudiceJane Austen\'s Pride and prejudiceJane Austen\'s Pride and prejudiceJane Austen\'s Pride and prejudicea co-production of BBC Television and BBC Worldwide Americas, Inc. in association with A & E Network ; screenplay by Andrew Davies ; directed by Simon Langton ; produced by Sue BirtwistlevideorecordingportionPride and prejudice.Pride and prejudice.Pride and prejudiceSpecial edLondon?British Broadcasting Corp.2001[London?] : British Broadcasting Corp., 2001.2 videodiscs (300 min.)Physical detailssd., col.Accompanying materials1 booklet.4 3/4 in.DVD; Dolby, digital, stereo.Originally produced for 1995 miniseries television broadcast.Based on the novel by Jane Austen.Film format: anamorphic widescreen (2.35:1)Booklet (7 p.) includes list of chapters, and cast and crew reminiscences.Not rated.Special features: vol. 1: biographies ; vol. 2: featurette (The making of Pride and prejudice)' >>> print >>> import rdflib INFO:rdflib:RDFLib Version: 4.2.2 >>> first_rec_graph = rdflib.Graph() >>> first_rec_graph.parse(data=bf_rdf_xml, format='xml') )> >>> len(first_rec_graph) 429 >>> print(first_rec_graph.serialize(format='turtle').decode()) @prefix bf: . @prefix bflc: . @prefix madsrdf: . @prefix rdf: . @prefix rdfs: . @prefix xml: . @prefix xsd: . a bf:Agent, bf:Person, madsrdf:ComplexSubject ; rdfs:label "Austen, Jane, 1775-1817" ; bflc:name00MarcKey "60010$aAusten, Jane,$d1775-1817$vFilm adaptations." ; bflc:name00MatchKey "Austen, Jane, 1775-1817" ; bf:source [ a bf:Source ; bf:code "lcsh" ] ; madsrdf:authoritativeLabel "Austen, Jane, 1775-1817--Film adaptations." ; madsrdf:isMemberofMADSScheme . a bf:Agent, bf:Person ; rdfs:label "Firth, Colin, 1960-" ; bflc:name00MarcKey "7001 $aFirth, Colin,$d1960-" ; bflc:name00MatchKey "Firth, Colin, 1960-" . a bf:Agent, bf:Person ; rdfs:label "Ehle, Jennifer, 1969-" ; bflc:name00MarcKey "7001 $aEhle, Jennifer,$d1969-" ; bflc:name00MatchKey "Ehle, Jennifer, 1969-" . a bf:Agent, bf:Person ; rdfs:label "Steadman, Alison, 1946-" ; bflc:name00MarcKey "7001 $aSteadman, Alison,$d1946-" ; bflc:name00MatchKey "Steadman, Alison, 1946-" . a bf:Agent, bf:Person ; rdfs:label "Whitrow, Benjamin." ; bflc:name00MarcKey "7001 $aWhitrow, Benjamin." ; bflc:name00MatchKey "Whitrow, Benjamin." . a bf:Agent, bf:Person ; rdfs:label "Harker, Susannah." ; bflc:name00MarcKey "7001 $aHarker, Susannah." ; bflc:name00MatchKey "Harker, Susannah." . a bf:Agent, bf:Person ; rdfs:label "Bonham-Carter, Crispin." ; bflc:name00MarcKey "7001 $aBonham-Carter, Crispin." ; bflc:name00MatchKey "Bonham-Carter, Crispin." . a bf:Agent, bf:Person ; rdfs:label "Chancellor, Anna." ; bflc:name00MarcKey "7001 $aChancellor, Anna." ; bflc:name00MatchKey "Chancellor, Anna." . a bf:Agent, bf:Person ; rdfs:label "Sawalha, Julia, 1968-" ; bflc:name00MarcKey "7001 $aSawalha, Julia,$d1968-" ; bflc:name00MatchKey "Sawalha, Julia, 1968-" . a bf:Agent, bf:Person ; rdfs:label "Bamber, David." ; bflc:name00MarcKey "7001 $aBamber, David." ; bflc:name00MatchKey "Bamber, David." . a bf:Agent, bf:Person ; rdfs:label "Langton, Simon." ; bflc:name00MarcKey "7001 $aLangton, Simon." ; bflc:name00MatchKey "Langton, Simon." . a bf:Agent, bf:Person ; rdfs:label "Austen, Jane, 1775-1817." ; bflc:name00MarcKey "7001 $aAusten, Jane,$d1775-1817.$tPride and prejudice." ; bflc:name00MatchKey "Austen, Jane, 1775-1817." . a bf:Agent, bf:Organization ; rdfs:label "Arts and Entertainment Network." ; bflc:name10MarcKey "7102 $aArts and Entertainment Network." ; bflc:name10MatchKey "Arts and Entertainment Network." . a bf:Agent, bf:Organization ; rdfs:label "British Broadcasting Corporation." ; bflc:name10MarcKey "7102 $aBritish Broadcasting Corporation." ; bflc:name10MatchKey "British Broadcasting Corporation." . a bf:Agent, bf:Organization ; rdfs:label "A & E Home Video (Firm)" ; bflc:name10MarcKey "7102 $aA & E Home Video (Firm)" ; bflc:name10MatchKey "A & E Home Video (Firm)" . a bf:GenreForm, madsrdf:GenreForm ; rdfs:label "Love stories." ; bf:source [ a bf:Source ; bf:code "" ] ; madsrdf:authoritativeLabel "Love stories." . a bf:Instance ; rdfs:label "Jane Austen's Pride and prejudice" ; bf:carrier ; bf:dimensions "4 3/4 in." ; bf:editionStatement "Special ed" ; bf:extent [ a bf:Extent ; rdfs:label "2 videodiscs (300 min.)" ] ; bf:genreForm [ a bf:GenreForm ; rdfs:label "videorecording" ] ; bf:identifiedBy [ a bf:Isbn ; rdf:value "0767038274 (v. 1)" ], [ a bf:Local ; bf:acquisitionTerms "c" ; rdf:value ".b1629290x" ], [ a bf:VideoRecordingNumber ; bf:source [ a bf:Source ; rdfs:label "A & E Home Video" ] ; rdf:value "AAE-70255--AAE-72056" ], [ a bf:Isbn ; rdf:value "0767038282 (v. 2)" ], [ a bf:Isbn ; rdf:value "0767038266" ] ; bf:instanceOf ; bf:intendedAudience [ a bf:IntendedAudience ; rdfs:label "Not rated." ] ; bf:issuance ; bf:media ; bf:note [ a bf:Note ; rdfs:label "Originally produced for 1995 miniseries television broadcast." ], [ a bf:Note ; rdfs:label "Based on the novel by Jane Austen." ], [ a bf:Note ; rdfs:label "sd., col." ; bf:noteType "Physical details" ], [ a bf:Note ; rdfs:label "1 booklet." ; bf:noteType "Accompanying materials" ], [ a bf:Note ; rdfs:label "Booklet (7 p.) includes list of chapters, and cast and crew reminiscences." ], [ a bf:Note ; rdfs:label "Special features: vol. 1: biographies ; vol. 2: featurette (The making of Pride and prejudice)" ], [ a bf:Note ; rdfs:label "Film format: anamorphic widescreen (2.35:1)" ], [ a bf:Note ; rdfs:label "live action" ; bf:noteType "technique" ] ; bf:provisionActivity [ a bf:ProvisionActivity, bf:Publication ; bf:date "2001"^^ ; bf:place ], [ a bf:ProvisionActivity, bf:Publication ; bf:agent [ a bf:Agent ; rdfs:label "British Broadcasting Corp." ] ; bf:date "2001" ; bf:place [ a bf:Place ; rdfs:label "London?" ] ] ; bf:provisionActivityStatement "[London?] : British Broadcasting Corp., 2001." ; bf:responsibilityStatement "a co-production of BBC Television and BBC Worldwide Americas, Inc. in association with A & E Network ; screenplay by Andrew Davies ; directed by Simon Langton ; produced by Sue Birtwistle" ; bf:systemRequirement [ a bf:SystemRequirement ; rdfs:label "DVD; Dolby, digital, stereo." ] ; bf:title [ a bf:Title ; rdfs:label "Jane Austen's Pride and prejudice" ; bflc:titleSortKey "Jane Austen's Pride and prejudice" ; bf:mainTitle "Jane Austen's Pride and prejudice" ], [ a bf:Title, bf:VariantTitle ; rdfs:label "Pride and prejudice." ; bflc:titleSortKey "Pride and prejudice." ; bf:mainTitle "Pride and prejudice" ; bf:variantType "portion" ] ; bf:videoCharacteristic [ a bf:VideoFormat ; rdfs:label "DVD" ] . a bf:Topic, madsrdf:ComplexSubject ; rdfs:label "Young women--England--Drama." ; bf:source [ a bf:Source ; bf:code "lcsh" ] ; madsrdf:authoritativeLabel "Young women--England--Drama." ; madsrdf:componentList ( [ a madsrdf:Topic ; madsrdf:authoritativeLabel "Young women" ] [ a madsrdf:Geographic ; madsrdf:authoritativeLabel "England" ] [ a madsrdf:GenreForm ; madsrdf:authoritativeLabel "Drama" ] ) ; madsrdf:isMemberofMADSScheme . a bf:Topic, madsrdf:ComplexSubject ; rdfs:label "Courtship--England--Drama." ; bf:source [ a bf:Source ; bf:code "lcsh" ] ; madsrdf:authoritativeLabel "Courtship--England--Drama." ; madsrdf:componentList ( [ a madsrdf:Topic ; madsrdf:authoritativeLabel "Courtship" ] [ a madsrdf:Geographic ; madsrdf:authoritativeLabel "England" ] [ a madsrdf:GenreForm ; madsrdf:authoritativeLabel "Drama" ] ) ; madsrdf:isMemberofMADSScheme . a bf:Topic, madsrdf:Topic ; rdfs:label "Television adaptations." ; bf:source [ a bf:Source ; bf:code "lcsh" ] ; madsrdf:authoritativeLabel "Television adaptations." ; madsrdf:isMemberofMADSScheme . a bf:Topic, madsrdf:Topic ; rdfs:label "Television mini-series." ; bf:source [ a bf:Source ; bf:code "lcsh" ] ; madsrdf:authoritativeLabel "Television mini-series." ; madsrdf:isMemberofMADSScheme . a bf:Place, madsrdf:ComplexSubject ; rdfs:label "England--Social life and customs--19th century--Drama." ; bf:source [ a bf:Source ; bf:code "lcsh" ] ; madsrdf:authoritativeLabel "England--Social life and customs--19th century--Drama." ; madsrdf:componentList ( [ a madsrdf:Geographic ; madsrdf:authoritativeLabel "England" ] [ a madsrdf:Topic ; madsrdf:authoritativeLabel "Social life and customs" ] [ a madsrdf:Temporal ; madsrdf:authoritativeLabel "19th century" ] [ a madsrdf:GenreForm ; madsrdf:authoritativeLabel "Drama" ] ) ; madsrdf:isMemberofMADSScheme . a bf:MovingImage, bf:Work ; rdfs:label "Jane Austen's Pride and prejudice" ; bf:adminMetadata [ a bf:AdminMetadata ; bflc:encodingLevel [ a bflc:EncodingLevel ; bf:code "u" ] ; bf:changeDate "2004-10-12T11:22:05"^^xsd:dateTime ; bf:creationDate "2001-10-03"^^xsd:date ; bf:descriptionConventions [ a bf:DescriptionConventions ; bf:code "aacr" ] ; bf:descriptionModifier [ a bf:Agent ; rdfs:label "FVC" ], [ a bf:Agent ; rdfs:label "IHI" ], [ a bf:Agent ; rdfs:label "OCLCQ" ], [ a bf:Agent ; rdfs:label "OCLCQ" ], [ a bf:Agent ; rdfs:label "OCLCQ" ], [ a bf:Agent ; rdfs:label "RLS" ], [ a bf:Agent ; rdfs:label "OCLCQ" ] ; bf:generationProcess [ a bf:GenerationProcess ; rdfs:label "DLC marc2bibframe2 v1.4.0-SNAPSHOT: 2018-02-13T11:07:39-05:00" ] ; bf:identifiedBy [ a bf:Local ; rdf:value "48075651" ] ; bf:source [ a bf:Source ; bf:code "OCoLC" ], [ a bf:Agent, bf:Source ; rdfs:label "IFJ" ], [ a bf:Agent, bf:Source ; rdfs:label "IFJ" ] ; bf:status [ a bf:Status ; bf:code "c" ] ] ; bf:contribution [ a bf:Contribution ; bf:agent ; bf:role ], [ a bf:Contribution ; bf:agent ; bf:role ], [ a bf:Contribution ; bf:agent ; bf:role ], [ a bf:Contribution ; bf:agent ; bf:role ], [ a bf:Contribution ; bf:agent ; bf:role ], [ a bf:Contribution ; bf:agent ; bf:role ], [ a bf:Contribution ; bf:agent ; bf:role ], [ a bf:Contribution ; bf:agent ; bf:role ], [ a bf:Contribution ; bf:agent ; bf:role ], [ a bf:Contribution ; bf:agent ; bf:role ], [ a bf:Contribution ; bf:agent ; bf:role ], [ a bf:Contribution ; bf:agent ; bf:role ], [ a bf:Contribution ; bf:agent ; bf:role ] ; bf:credits "Cast: Colin Firth, Jennifer Ehle, Alison Steadman, Benjamin Whitrow, Susannah Harker, Crispin Bonham-Carter, Anna Chancellor, Julia Sawalha, David Bamber, David Bark-Jones.", "Photography, John Kenway ; film editor, Peter Coulson ; music, Carl Davis." ; bf:duration "300"^^xsd:duration ; bf:genreForm [ a bf:GenreForm ; rdfs:label "videorecording" ], , , ; bf:geographicCoverage ; bf:hasInstance ; bf:intendedAudience ; bf:language ; bf:relatedTo ; bf:subject , , , , , ; bf:summary [ a bf:Summary ; rdfs:label "The story of lively and rebellious Elizabeth, one of five unmarried daughters living in the countryside of 19th century England, in a world where an advantageous marriage is a woman's sole occupation." ] ; bf:title [ a bf:Title ; rdfs:label "Jane Austen's Pride and prejudice" ; bflc:titleSortKey "Jane Austen's Pride and prejudice" ; bf:mainTitle "Jane Austen's Pride and prejudice" ] . a bf:Work ; rdfs:label "Pride and prejudice." ; bf:contribution [ a bf:Contribution ; bf:agent ; bf:role ] ; bf:title [ a bf:Title ; rdfs:label "Pride and prejudice." ; bflc:title00MarcKey "7001 $aAusten, Jane,$d1775-1817.$tPride and prejudice." ; bflc:title00MatchKey "Pride and prejudice." ; bflc:titleSortKey "Pride and prejudice." ; bf:mainTitle "Pride and prejudice" ] . a bf:GenreForm . a bf:Carrier ; rdfs:label "videodisc" . a bf:Place . a bf:GeographicCoverage . a bf:Issuance . a bf:Language . a bf:GenreForm ; rdfs:label "videorecording" . a bf:IntendedAudience ; rdfs:label "general" . a bf:Media . a bf:Role . >>> import bibcat.rml.processor as processor >>> processor >>> rml_processor = processor.SPARQLProcessor(triplestore=first_rec_graph, ... rml_rules=['loc-bf-to-lean-bf.ttl']) >>> rml_processor >>> rml_processor.output >>> rml_processor.run() >>> rml_processor.output )> >>> len(rml_processor.output) 348 >>> len(first_rec_graph) 429 >>> print(rml_processor.output.serialize(format='turtle').decode()) @prefix adms: . @prefix bc: . @prefix bf: . @prefix dcterms: . @prefix kds: . @prefix locn: . @prefix oslo: . @prefix ql: . @prefix rdf: . @prefix rdfs: . @prefix relators: . @prefix rml: . @prefix rr: . @prefix schema: . @prefix skos: . @prefix vcard: . @prefix xml: . @prefix xsd: . a bf:Instance ; rdfs:label "Jane Austen's Pride and prejudice" ; bf:carrier ; bf:dimensions "4 3/4 in." ; bf:editionStatement "Special ed" ; bf:identifiedBy [ a bf:Isbn ; rdf:value "0767038274 (v. 1)" ], [ a bf:Isbn ; rdf:value "0767038282 (v. 2)" ], [ a bf:Isbn ; rdf:value "0767038266" ] ; bf:instanceOf ; bf:issuance ; bf:note [ a bf:Note ; rdfs:label "Originally produced for 1995 miniseries television broadcast." ], [ a bf:Note ; rdfs:label "Based on the novel by Jane Austen." ], [ a bf:Note ; rdfs:label "sd., col." ; bf:noteType "Physical details" ], [ a bf:Note ; rdfs:label "1 booklet." ; bf:noteType "Accompanying materials" ], [ a bf:Note ; rdfs:label "Booklet (7 p.) includes list of chapters, and cast and crew reminiscences." ], [ a bf:Note ; rdfs:label "Special features: vol. 1: biographies ; vol. 2: featurette (The making of Pride and prejudice)" ], [ a bf:Note ; rdfs:label "Film format: anamorphic widescreen (2.35:1)" ], [ a bf:Note ; rdfs:label "live action" ; bf:noteType "technique" ] ; bf:provisionActivity [ a bf:ProvisionActivity, bf:Publication ; bf:date "2001"^^ ; bf:place ], [ a bf:ProvisionActivity, bf:Publication ; bf:date "2001" ; bf:place "London?" ] ; bf:provisionActivityStatement "[London?] : British Broadcasting Corp., 2001." ; bf:responsibilityStatement "a co-production of BBC Television and BBC Worldwide Americas, Inc. in association with A & E Network ; screenplay by Andrew Davies ; directed by Simon Langton ; produced by Sue Birtwistle" ; bf:title [ a bf:Title ; rdfs:label "Jane Austen's Pride and prejudice" ; bf:mainTitle "Jane Austen's Pride and prejudice" ], [ a bf:Title ; rdfs:label "Pride and prejudice." ; bf:mainTitle "Pride and prejudice" ] . a bf:Agent ; rdfs:label "Austen, Jane, 1775-1817" . a bf:Topic ; rdfs:label "Young women--England--Drama." . a bf:Topic ; rdfs:label "Courtship--England--Drama." . a bf:Topic ; rdfs:label "Television adaptations." . a bf:Topic ; rdfs:label "Television mini-series." . a bf:MovingImage, bf:Work ; bf:contribution [ a bf:Contribution ; bf:agent _:N8ceb769e2a4c410cb3526c15761e224c, , , , , , , , , , , , , , ; bf:role relators:ctb ], [ a bf:Contribution ; bf:agent _:N8ceb769e2a4c410cb3526c15761e224c, , , , , , , , , , , , , , ; bf:role relators:ctb ], [ a bf:Contribution ; bf:agent _:N8ceb769e2a4c410cb3526c15761e224c, , , , , , , , , , , , , , ; bf:role relators:ctb ], [ a bf:Contribution ; bf:agent _:N8ceb769e2a4c410cb3526c15761e224c, , , , , , , , , , , , , , ; bf:role relators:ctb ], [ a bf:Contribution ; bf:agent _:N8ceb769e2a4c410cb3526c15761e224c, , , , , , , , , , , , , , ; bf:role relators:ctb ], [ a bf:Contribution ; bf:agent _:N8ceb769e2a4c410cb3526c15761e224c, , , , , , , , , , , , , , ; bf:role relators:ctb ], [ a bf:Contribution ; bf:agent _:N8ceb769e2a4c410cb3526c15761e224c, , , , , , , , , , , , , , ; bf:role relators:ctb ], [ a bf:Contribution ; bf:agent _:N8ceb769e2a4c410cb3526c15761e224c, , , , , , , , , , , , , , ; bf:role relators:ctb ], [ a bf:Contribution ; bf:agent _:N8ceb769e2a4c410cb3526c15761e224c, , , , , , , , , , , , , , ; bf:role relators:ctb ], [ a bf:Contribution ; bf:agent _:N8ceb769e2a4c410cb3526c15761e224c, , , , , , , , , , , , , , ; bf:role relators:ctb ], [ a bf:Contribution ; bf:agent _:N8ceb769e2a4c410cb3526c15761e224c, , , , , , , , , , , , , , ; bf:role relators:ctb ], [ a bf:Contribution ; bf:agent _:N8ceb769e2a4c410cb3526c15761e224c, , , , , , , , , , , , , , ; bf:role relators:ctb ], [ a bf:Contribution ; bf:agent _:N8ceb769e2a4c410cb3526c15761e224c, , , , , , , , , , , , , , ; bf:role relators:ctb ] ; bf:subject , , , , ; bf:summary [ a bf:Summary ; rdfs:label "The story of lively and rebellious Elizabeth, one of five unmarried daughters living in the countryside of 19th century England, in a world where an advantageous marriage is a woman's sole occupation." ] . a bf:Agent ; rdfs:label "Firth, Colin, 1960-" . a bf:Agent ; rdfs:label "Ehle, Jennifer, 1969-" . a bf:Agent ; rdfs:label "Steadman, Alison, 1946-" . a bf:Agent ; rdfs:label "Whitrow, Benjamin." . a bf:Agent ; rdfs:label "Harker, Susannah." . a bf:Agent ; rdfs:label "Bonham-Carter, Crispin." . a bf:Agent ; rdfs:label "Chancellor, Anna." . a bf:Agent ; rdfs:label "Sawalha, Julia, 1968-" . a bf:Agent ; rdfs:label "Bamber, David." . a bf:Agent ; rdfs:label "Langton, Simon." . a bf:Agent ; rdfs:label "Austen, Jane, 1775-1817." . a bf:Agent ; rdfs:label "Arts and Entertainment Network." . a bf:Agent ; rdfs:label "British Broadcasting Corporation." . a bf:Agent ; rdfs:label "A & E Home Video (Firm)" . relators:ctb a bf:Role . _:N8ceb769e2a4c410cb3526c15761e224c a bf:Agent ; rdfs:label "British Broadcasting Corp." . >>>