Skip to content

Instantly share code, notes, and snippets.

Clifford Anderson CliffordAnderson

Block or report user

Report or block CliffordAnderson

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View spark-session-nlp.scala
val pbp = spark.read.format("csv").load("Desktop/pbp.csv")
pbp.show
pbp.printSchema
val bp = pbp.withColumnRenamed("_c0", "article").withColumnRenamed("_c1", "journal").withColumnRenamed("_c2", "volume").withColumnRenamed("_c3", "issue").withColumnRenamed("_c4", "date").withColumnRenamed("_c5", "pages").withColumnRenamed("_c6", "url").withColumnRenamed("_c7", "text")
bp.printSchema
View BP.xqy
xquery version "3.1";
let $docs := fn:collection("bpp-quarterly")
let $csv := element csv {
for $doc in $docs/Record
return
<record>
<title>{$doc/RecordTitle/text()}</title>
<publication>{$doc/Publication/Title/text()}</publication>
<volume>{$doc/Volume/text()}</volume>
View 2010-tv-news.md
View csv-to-jsonl.xqy
xquery version "3.1";
declare namespace xpf = "http://www.w3.org/2005/xpath-functions";
(: Converts a CSV into JSONL, i.e. one JSON object per line :)
let $csv := fetch:text("https://gist.githubusercontent.com/CliffordAnderson/588774dd0fa7d7bb616abd8da478fe76/raw/33395bdb6fce8d215464738f8681b66b130159e9/books.csv") => csv:parse(map { 'header': true() })
for $record in $csv/csv/record
let $key-values :=
for $entry in $record/*
return
@CliffordAnderson
CliffordAnderson / artists.json
Created Oct 27, 2019
Artist Networks from WIkidata
View artists.json
[
{
"artist": "http://www.wikidata.org/entity/Q30160536",
"artistLabel": "František Podešva",
"influenced_by": "http://www.wikidata.org/entity/Q2104325",
"influenced_byLabel": "Jan Preisler"
},
{
"artist": "http://www.wikidata.org/entity/Q63478",
"artistLabel": "Jonah Bokaer",
@CliffordAnderson
CliffordAnderson / ubahn.html
Created Oct 27, 2019
Sample neovis.js page
View ubahn.html
<!doctype html>
<html>
<head>
<title>Neovis.js Simple Example</title>
<style type="text/css">
html, body {
font: 16pt arial;
}
#viz {
@CliffordAnderson
CliffordAnderson / anderson-graph.xml
Created Oct 26, 2019
Clifford Anderson's Scholarly Graph from Atlas
View anderson-graph.xml
<graphml:graphml xmlns:graphml="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:grapml="http://graphml.graphdrawing.org/xmlns" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
<graphml:graph id="G" edgedefault="directed">
<graphml:node id="F5EFD5A5849581F4CC1B189C11BC7350" labels=":Author">
<graphml:data key="author">Anderson, Clifford Blake</graphml:data>
</graphml:node>
<graphml:node id="7123B0D8EC557EFFE510337C89E6EEBF" labels=":Author">
<graphml:data key="author">Anderson, Clifford Blake, 1970- ("Author of introduction, etc. ")</graphml:data>
</graphml:node>
<graphml:node id="3739280CA94B7DED2A6DA75A9F662CEE" labels=":Author">
<graphml:data key="author">Anderson, Clifford Blake, 1970- (Editor)</graphml:data>
@CliffordAnderson
CliffordAnderson / neo4j-workshop.md
Last active Oct 27, 2019
Graph Analysis for the Humanities
View neo4j-workshop.md

Graph Analysis for the Humanities

An introduction to using graphs to model and analyze data in the humanities

Berea College Workshop

Berea College Logo

A workshop at Bearea College on Wednesday, October 30th sponsored by The Mellon Partners for Humanities Education

Introduction to Neo4j

View graph_gist_artists.adoc

Artistic Influence

Introduction

This graph studies the relations of infuence between artists. The data comes from this query of Wikidata:

View basic-full-text-query.xqy
for $doc in fn:collection("bpp-quarterly")//FullText[.//text() contains text {"jury", "law"} any using stemming]
let $hits := ft:extract($doc[.//text() contains text {"jury", "law"} all using stemming])
let $count := fn:count($hits//mark)
let $record := fn:doc(fn:base-uri($doc))
order by $count descending
return <hit count="{$count}" url="{$record//URLDocView}" title="{$record//RecordTitle}">{$hits}</hit>
You can’t perform that action at this time.