Skip to content

Instantly share code, notes, and snippets.

View maharg101's full-sized avatar

Graham Lenton maharg101

  • UK
View GitHub Profile
# neo4jrestclient is really nice to work with BUT at the time of writing:
# - build is currently failing against Neo4J 2.1.5
# see https://github.com/versae/neo4j-rest-client
# - the order_by functionality is not working (this is one of the tests that fails..)
from neo4jrestclient.client import GraphDatabase
from neo4jrestclient.query import Q
from neo4jrestclient.constants import DESC, ASC
gdb = GraphDatabase("http://neo4j:hackme@localhost:7474/db/data/")
@maharg101
maharg101 / hello_hermit.py
Last active September 14, 2021 03:02
python / HermiT
import os
os.environ['CLASSPATH'] = '.:HermiT.jar'
from jnius import autoclass
owl_manager = autoclass('org.semanticweb.owlapi.apibinding.OWLManager')
ontology_manager = owl_manager.createOWLOntologyManager()
iri = autoclass('org.semanticweb.owlapi.model.IRI')
owl_ontology = ontology_manager.loadOntologyFromOntologyDocument(iri.create("http://protege.stanford.edu/ontologies/pizza/pizza.owl"))
ReasonerFactory = autoclass('org.semanticweb.HermiT.Reasoner$ReasonerFactory')
owl_reasoner = ReasonerFactory().createReasoner(owl_ontology)
owl_reasoner.isConsistent()

Keybase proof

I hereby claim:

  • I am maharg101 on github.
  • I am maharg101 (https://keybase.io/maharg101) on keybase.
  • I have a public key whose fingerprint is BB55 059C F270 BC0C 4213 7FB8 2F30 80A2 36EB E10E

To claim this, I am signing this object:

@maharg101
maharg101 / appears to cache results from first execution
Created March 22, 2013 10:41
elasticsearch date arithmetic behaviour oddity
{
"sort": [
{
"publication_time": {
"order": "desc"
}
}
],
"from": 0,
"size": 3,