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 csv-to-jsonl.xqy
xquery version "3.1";
declare namespace xpf = "";
(: Converts a CSV into JSONL, i.e. one JSON object per line :)
let $csv := fetch:text("") => csv:parse(map { 'header': true() })
for $record in $csv/csv/record
let $key-values :=
for $entry in $record/*
CliffordAnderson / artists.json
Created Oct 27, 2019
Artist Networks from WIkidata
View artists.json
"artist": "",
"artistLabel": "František Podešva",
"influenced_by": "",
"influenced_byLabel": "Jan Preisler"
"artist": "",
"artistLabel": "Jonah Bokaer",
CliffordAnderson / ubahn.html
Created Oct 27, 2019
Sample neovis.js page
View ubahn.html
<!doctype html>
<title>Neovis.js Simple Example</title>
<style type="text/css">
html, body {
font: 16pt arial;
#viz {
CliffordAnderson / anderson-graph.xml
Created Oct 26, 2019
Clifford Anderson's Scholarly Graph from Atlas
View anderson-graph.xml
<graphml:graphml xmlns:graphml="" xmlns:xsi="" xmlns:grapml="" xsi:schemaLocation="">
<graphml:graph id="G" edgedefault="directed">
<graphml:node id="F5EFD5A5849581F4CC1B189C11BC7350" labels=":Author">
<graphml:data key="author">Anderson, Clifford Blake</graphml:data>
<graphml:node id="7123B0D8EC557EFFE510337C89E6EEBF" labels=":Author">
<graphml:data key="author">Anderson, Clifford Blake, 1970- ("Author of introduction, etc. ")</graphml:data>
<graphml:node id="3739280CA94B7DED2A6DA75A9F662CEE" labels=":Author">
<graphml:data key="author">Anderson, Clifford Blake, 1970- (Editor)</graphml:data>
CliffordAnderson /
Last active Oct 27, 2019
Graph Analysis for the Humanities

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


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>
View reports.xqy
let $data := <column name="Reporters">Williams, Brian|Maceda, Jim|Keith, Brian Williams,|Thompson, Anne</column>
let $contributor := $data[@name='Reporters']/text() => fn:tokenize("\|")
return $contributor
CliffordAnderson /
Last active Oct 11, 2019
Text Mining at Scale (XQuery Working Group) Natural Language Processing

Natural Language Processing

Today, we’ll be exploring patterns in a corpus of genuine and fake news collected in 2016 by Buzz Feed and scored for veracity by professional journalists. As you might imagine, the corpus contains very partisan perspectives; individual articles may contain disturbing language and viewpoints. In the initial code example below, you will need to have downloaded the data set and have created a database called articles.

We’ll begin our investigation of natural language processing by using Aylien, which bill itself as a “News Intelligence Platform,” to classify these articles, analyze their topics, identify the people, places, things they discuss, and to discern the sentiment or tone of the articles. If you would like to follow along, please sign up for a free API key.

View hashtag.xqy
let $appid := "###"
let $key := "###"
let $endpoint := ""
let $service := "hashtags"
let $text := fn:encode-for-uri("Are you serious? Do you think anyone cares about that crazy plan? Get back to Arizona!")
let $request :=
<http:request method="get" href="{$endpoint || $service || '?text=' || $text}">
<http:header name="Accept" value="text/xml"/>
<http:header name="X-AYLIEN-TextAPI-Application-Key" value="{$key}"/>
<http:header name="X-AYLIEN-TextAPI-Application-ID" value="{$appid}"/>
You can’t perform that action at this time.