Skip to content

Instantly share code, notes, and snippets.

Ed Summers edsu

Block or report user

Report or block edsu

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 coordination.ttl
@prefix rdf: <> .
@prefix rda: <> .
@prefix dct: <> .
@prefix lcsh: <> .
@prefix skos: <> .
@prefix ex: <> .
rda:titleProper "Charlotte Temple" ;
dct:subject [
View crawlable
#!/usr/bin/env python
import sys
import urlparse
import robotparser # yes it's part of the python core!
ua, url = sys.argv[0:2]
print "usage: crawlable googlebot"
from routes import Mapper
map = Mapper()
map.connect('book', '/book/{isbn}', controller='item', action='book')
map.connect('journal', '/journal/{issn}', controller='item', action='journal')
#!/usr/bin/env python
Extract some RDF from O'Reilly's not well-formed Book Catalog RDFa.
from rdflib.graph import ConjunctiveGraph
g = ConjunctiveGraph()
g.parse('', format='rdfa', lax=True)
#!/usr/bin/env python
from rdflib.graph import ConjunctiveGraph
g = ConjunctiveGraph()
g.parse("", format='rdfa', lax=True)
g.parse("", format='rdfa', lax=True)
for q in g.quads((None, None, None)):
print q
#!/usr/bin/env python
Look for odd ampersands in URIs in O'Reilly data and print out the
context URI (where the assertions came from).
Output looks something like:
ed@inkdroid:~/bzr/oreilly-crawler$ ./
<> a rdfg:Graph;rdflib:storage [a rdflib:Store;rdfs:label 'Sleepycat'].
<> a rdfg:Graph;rdflib:storage [a rdflib:Store;rdfs:label 'Sleepycat'].
View scottros.txt
# generated with
Adam from Twibes [twibes]
Felicity Barringer [felicitybarr]
George Frink [gwfrink3]
Dharmishta Rood [Dharmishta]
Adina Levin [alevin]
Keith Dawson [kdawson]
Ann Handley [MarketingProfs]
Michael Kinsley [michaelkinsley]
View rdflib_nosetests.txt
ed@rorty:~/Projects/rdflib$ python nosetests --tests rdflib.graph
running nosetests
running egg_info
unrecognized .svn/entries format; skipping .
writing rdflib.egg-info/PKG-INFO
error: rdflib.egg-info/PKG-INFO: Permission denied
View ez_setup_install.txt
ed@rorty:~$ sudo python
Processing setuptools-0.6c11-py2.6.egg
Copying setuptools-0.6c11-py2.6.egg to /usr/local/lib/python2.6/dist-packages
Removing setuptools 0.6c9 from easy-install.pth file
Adding setuptools 0.6c11 to easy-install.pth file
Installing easy_install script to /usr/local/bin
Installing easy_install-2.6 script to /usr/local/bin
Installed /usr/local/lib/python2.6/dist-packages/setuptools-0.6c11-py2.6.egg
View test_output
Failed example:
print triples_to_n3(cg2-cg1)
<> <> <> .
<> <> _:cb1634787881 .
_:cb1634787881 <> "B" .
<> <> <> .
<> <> _:cb8496374808470151721 .
_:cb8496374808470151721 <> "B" .
You can’t perform that action at this time.