Building Bibliographic RDF Applications and Microservices

Creating a Knowledge Graph

What do we mean when we say "Knowledge Graph"?

One or more RDF graphs that represent an institution's "facts" or information modeled as relationships and entities as IRI

Manually with a Text Editor

@prefix rdf: <> .
@prefix rdfs: <> .
@prefix schema: <> .

<> a schema:EducationEvent ;
    schema:endDate "2017-03-11T26:59:99" ;
    schema:superEvent <> ;
    schema:startDate "2017-03-11T20:00:00" . 

Programmatically with Python & rdflib

  1. (p3-env)> python
  2. Run Python in interactive mode:
    >> import rdflib
    >> SCHEMA = rdflib.Namespace("")
    >> preconference = rdflib.ConjunctiveGraph()
    >> preconference_iri = rdflib.URIRef("")
    >> code4lib_2017 = rdflib.URIRef("")
    >> preconference.add((preconference_iri,
    >> preconference.add((preconference_iri,
    >> prefconference.add((prefconference_iri,

Colorado College Example

Colorado College Logo

Base Knowledge Graph

RDF Applications and microservices use the base knowledge graph composed of colorado-college.ttl , cc-people.ttl, and cc-2016-2017.ttl all managed using Git and Github as part of the ongoing TIGER Catalog project.

Colorado College Knowledge Graph

Used in …

Colorado College

Colorado College ETD

Blazegraph Triplestore, Fedora 3.8, RDF Framework

This application allows seniors at Colorado College to self-submit their thesis along with any accompanying datasets, video, or audio to Colorado College's Fedora-based institutional repository.

Source Code Repository Live Application
  • Associate Theses with departments and people from CC's Knowledge Graph
  • Adds additional triples to configure RDF application in etd-2016-2017.ttl Turtle file
  • Stores associated IRIs of People, Institution, Departments in MODS metadata XML that is saved with the thesis datastreams in Colorado College's legacy Fedora 3.8 repository

Loading Colorado College's Knowledge Graph with Python

  1. (p3-env)> python
  2. Run Python in interactive mode:
    >>> import requests
    >>> TRIPLESTORE_URL = 'http://localhost:9999/blazegraph/sparql'
    >>> def setup_etd_knowledgegraph():
      	 cc_path = 'E:/2017/tiger-catalog/custom/'
     	 etd_path = "E:/2017/ccetd/custom/etd-2016-2017.ttl"
    	 for name in ["colorado-college.ttl",
    		 with open("{}/{}".format(cc_path, name), "rb") as fo:
    				  headers={"Content-Type": "text/turtle"})
    	 with open(etd_path, 'rb') as fo:,
    			  headers={"Content-Type": "text/turtle"})
    >>> setup_etd_knowledgegraph()