In [4]:
def setup_mods():
	global ingester, mods, rdflib, etree, requests, mods_xml
	import sys, rdflib, requests
	import xml.etree.ElementTree as etree
	sys.path.append("E:/2016/tiger-catalog/")
	import bibcat.ingesters.mods as mods
	result = requests.get("https://digitalcc.coloradocollege.edu/islandora/object/coccc%3A10981/datastream/MODS/view")
	mods_xml = etree.XML(result.text)
	ingester = mods.MODSIngester(mods_xml, custom=["cc-mods-bf.ttl"])
	ingester.base_url = "http://catalog.coloradocollege.edu/"
setup_mods()


---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-4-914b7e96706f> in <module>()
      9         ingester = mods.MODSIngester(mods_xml, custom=["cc-mods-bf.ttl"])
     10         ingester.base_url = "http://catalog.coloradocollege.edu/"
---> 11 setup_mods()

<ipython-input-4-914b7e96706f> in setup_mods()
      4         import xml.etree.ElementTree as etree
      5         sys.path.append("E:/2016/tiger-catalog/")
----> 6         import bibcat.ingesters.mods as mods
      7         result = requests.get("https://digitalcc.coloradocollege.edu/islandora/object/coccc%3A10981/datastream/MODS/view")
      8         mods_xml = etree.XML(result.text)

E:/2016/tiger-catalog\bibcat\ingesters\mods.py in <module>()
     16 
     17 from collections import OrderedDict
---> 18 from ingesters.ingester import Ingester, new_graph, NS_MGR
     19 from ingesters.sparql import *
     20 

ImportError: No module named 'ingesters'

Arthur J. Kew and Ida Rosalie Fursman

Digital CC

Digital CC Beta


In [3]:
ingester.transform()

In [4]:
print(ingester.graph.serialize(format='turtle').decode())


@prefix bc: <http://knowledgelinks.io/ns/bibcat/> .
@prefix bf: <http://id.loc.gov/ontologies/bibframe/> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix dcr: <http://knowledgelinks.io/ns/dc/> .
@prefix kdr: <http://knowledgelinks.io/ns/data-resources/> .
@prefix kds: <http://knowledgelinks.io/ns/data-structures/> .
@prefix loc: <http://id.loc.gov/> .
@prefix modsr: <http://knowledgelinks.io/ns/mods/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix pcdm: <http://pcdm.org/models#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix relators: <http://id.loc.gov/vocabulary/relators/> .
@prefix schema: <http://schema.org/> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<http://catalog.coloradocollege.edu/775c501e-58c4-11e6-850a-005056c00008> a bf:Item ;
    bf:generationProcess [ a bf:GenerationProcess ;
            bf:generationDate "2016-08-02T15:19:12.111157" ;
            rdf:value "Generated by BIBCAT version 1.0.1 from KnowledgeLinks.io"@en ] ;
    bf:heldBy <https://www.coloradocollege.edu/> ;
    bf:itemOf <http://catalog.coloradocollege.edu/76647bc8-58c4-11e6-9fdd-005056c00008> .

<http://catalog.coloradocollege.edu/76647bc8-58c4-11e6-9fdd-005056c00008> a bf:Instance ;
    bf:contributor [ a bf:Person ;
            schema:alternativeName "Finley, Judith Reid, 1936-" ],
        [ a bf:Person ;
            schema:alternativeName "Fursman, Ida Rosalie" ],
        [ a bf:Person ;
            schema:alternativeName "Ehrich, Louis R., 1849-1911" ],
        [ a bf:Person ;
            schema:alternativeName "Kew, Arthur J." ] ;
    bf:dissertation [ a bf:Dissertation ;
            bf:grantingInstitution [ a bf:Organization ] ] ;
    bf:generationProcess [ a bf:GenerationProcess ;
            bf:generationDate "2016-08-02T15:19:12.074664" ;
            rdf:value "Generated by BIBCAT version 1.0.1 from KnowledgeLinks.io"@en ] ;
    bf:genreFrom [ a bf:GenreForm ;
            rdf:value "letter",
                "picture" ] ;
    bf:instanceOf [ a bf:Work ;
            bf:originDate "1901" ] ;
    bf:note [ a bf:Note ;
            bf:noteType "admin"@en ;
            rdf:value "Documents originally digitized in JPEG format. JPEG document files were converted to PDF format in 2015." ],
        [ a bf:Note ;
            bf:noteType "admin"@en ;
            rdf:value "Title supplied by cataloger." ],
        [ a bf:Note ;
            bf:noteType "admin"@en ;
            rdf:value "Alternative Title derived from Colorado Springs Century Chest Collection, 1901, Ms 0349 finding aid, February 23, 2015." ],
        [ a bf:Note ;
            bf:noteType "admin"@en ;
            rdf:value "Transcription of letter by Judith Reid Finley." ] ;
    bf:summary [ a bf:Summary ;
            rdf:value """Historic documentation of life at the turn of the 19th century created by residents of Colorado Springs, Colorado in 1901 for the citizens of 2001. Under the direction of Louis R. Ehrich, a prominent 19th century businessman, the items were sealed in a chest which was stored in various buildings on the Colorado College campus until the official opening January 1, 2001 at the Charles Leaming Tutt Library.  Contents of Ms349, Fd 56, Arthur J. Kew and Ida Rosalie Fursman include: 1 2-page, handwritten letter, dated August 4, 1901, addressed “To the citizens of Colorado Springs in the Year 2001. Brethren, through ties of Home and Love.” Signed by Arthur J. Kew;  
1 10-page, handwritten manuscript titled “Colorado. An Ode written for The Quarto-Centennial Celebration” by Arthur J. Kew, dated July 1901; 1 7-page, handwritten manuscript, dated August 5, 1901, containing 5 sonnets written to Ida Rosalie Fursman by Arthur J. Kew; 1 3-page, handwritten manuscript dated August 3, 1901, titled “Land of our Home: Verses written to the music of ‘Home, Sweet Home’ to be sung at the Dedication of the         Century Chest” by Arthur J. Kew; 2 b&w photos “Arthur J. Kew” and “Ida Rosalie Fursman.”  
""" ] ;
    bf:title [ a bf:InstanceTitle ;
            bf:mainTitle "Arthur J. Kew and Ida Rosalie Fursman ",
                "Colorado Springs Century Chest Collection, 1901, Ms 0349, Folder 56, Arthur J. Kew and Ida Rosalie Fursman " ] ;
    relators:cre [ a bf:Person ;
            schema:alternativeName "Finley, Judith Reid, 1936-" ],
        [ a bf:Person ;
            schema:alternativeName "Ehrich, Louis R., 1849-1911" ],
        [ a bf:Person ;
            schema:alternativeName "Kew, Arthur J." ],
        [ a bf:Person ;
            schema:alternativeName "Fursman, Ida Rosalie" ] .



In [2]:
mods2_xml = etree.XML(requests.get("https://digitalcc.coloradocollege.edu/islandora/object/coccc%3A12584/datastream/MODS/view").text)


---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-2-9e121ef47f5e> in <module>()
----> 1 mods2_xml = etree.XML(requests.get("https://digitalcc.coloradocollege.edu/islandora/object/coccc%3A12584/datastream/MODS/view").text)

NameError: name 'etree' is not defined

In [ ]: