This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Grab('com.github.albaker:GroovySparql:0.9.0') | |
import groovy.sparql.* | |
@Grab('commons-lang#commons-lang;2.4') | |
import org.apache.commons.lang.WordUtils | |
import groovy.json.StringEscapeUtils | |
// Tab separated file with ids and names to look up in Libris. | |
// Example line format: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Tools for Everyone</h1> | |
<p> | |
This session looks at two tools that help to manage public sector metadata: | |
</p> | |
<p> | |
Scribe: Peter K | |
</p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Tools for Everyone</h1> | |
<p> | |
This session looks at two tools that help to manage public sector metadata: | |
</p> | |
<p> | |
Scribe: Peter K | |
</p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PREFIX owl: <http://www.w3.org/2002/07/owl#> | |
PREFIX foaf: <http://xmlns.com/foaf/0.1/> | |
PREFIX rdfs: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | |
select DISTINCT ?name ?title ?book | |
WHERE { | |
?book <http://purl.org/dc/elements/1.1/creator> ?creator . | |
?creator <http://dbpedia.org/property/deathYear> "1945" . | |
?book <http://purl.org/dc/elements/1.1/title> ?title . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
import unicodecsv as csv | |
import networkx as nx | |
csvdata = csv.reader(open('query_result.csv', 'rb'), delimiter=',', encoding='utf-8') | |
next(csvdata) #skip headers | |
graph=nx.DiGraph(label="swepub") | |
for row in csvdata: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PREFIX owl: <http://www.w3.org/2002/07/owl#> | |
PREFIX foaf: <http://xmlns.com/foaf/0.1/> | |
PREFIX rdfs: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | |
select DISTINCT ?name ?title ?book | |
WHERE { | |
?book <http://purl.org/dc/elements/1.1/creator> ?creator . | |
?creator <http://dbpedia.org/property/deathYear> "1945" . | |
?book <http://purl.org/dc/elements/1.1/title> ?title . | |
?creator foaf:name ?name . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Your Stylesheet | |
* | |
* This stylesheet is loaded when Atom starts up and is reloaded automatically | |
* when it is changed. | |
* | |
* If you are unfamiliar with LESS, you can read more about it here: | |
* http://www.lesscss.org | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ext_ip="10.0.0.1" # Change this value to your vultr IP | |
server "default" { | |
listen on $ext_ip port 80 | |
} | |
types { | |
text/css css ; | |
text/html htm html ; | |
text/txt txt ; | |
image/gif gif ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import requests | |
from lxml import html | |
from lxml.builder import E | |
from lxml.etree import tostring | |
url = "https://data.kb.se/datasets/2014/10/suecia/" | |
template = "{{Kungliga biblioteket image|libris-id=%s|url=%s}}" | |
def getmeta(libris_id): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version='1.0' encoding='utf-8'?> | |
<metadata> | |
<records> | |
<record> | |
<source>https://data.kb.se/datasets/2014/10/suecia/14818031%2C1.tif/</source> | |
<title>Skoklosters slott och sockenkyrka</title> | |
<filename>Suecia antiqua (SELIBR 14818031)-1</filename> | |
<Commons_filename>Suecia antiqua (SELIBR 14818031)-1</Commons_filename> | |
<description>Skoklosters slott och sockenkyrka by Dahlbergh, Erik, 1625-1703.</description> | |
<permissions>{{Kungliga biblioteket image|libris-id=14818031}} |