This file contains 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
for node in querySquenceObject[1:]: | |
n = node.pop() | |
[...] | |
self = n.get('self') | |
print self | |
# RESPONSE IN THE CMD LINE FROM THE ABOVE PRINT STATEMENT | |
http://localhost:7475/db/data/node/1 |
This file contains 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
for node in querySquenceObject[1:]: | |
n = node.pop() | |
data = n.get('data') | |
name = data.get('name') | |
description = data.get('description') | |
self = n.get('self') | |
self = urlparse(self) | |
uid = doRegEX(self) |
This file contains 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
q = "START n=node(*) RETURN n" | |
params = {} | |
querySquenceObject = db.query(q, params=params, returns=RAW) |
This file contains 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
db = GraphDatabase("http://localhost:7475/db/data") | |
nodes = getNodes(db) | |
rels = getRels(db) |
This file contains 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
from flask import Flask, Response, json, jsonify, request, Blueprint, render_template | |
app = Flask(__name__) | |
@app.route('/_api/hydraGraph') | |
def api_response(): |
This file contains 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
# Make sure to include or you will block the thread! | |
db.shutdown() |
This file contains 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
# Might add some logic to count / print no of nodes/rels added :-) | |
number_of_nodes = len(db.nodes) | |
number_of_relationships = len(db.relationships) | |
print "Number of nodes created" | |
print number_of_nodes | |
print "Number of relationships created" | |
print number_of_relationships |
This file contains 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
# dataProcessing | |
dataProcessing.relationships.create('includes', graphDB) | |
dataProcessing.relationships.create('includes', dataMining) | |
dataProcessing.relationships.create('includes', dataAnalysis) | |
dataProcessing.relationships.create('includes', nlp) | |
dataProcessing.relationships.create('includes', rdf) |
This file contains 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
#Primary Relationship | |
coolgarifTech.relationships.create('implements_solutions_in', dataStorage) | |
coolgarifTech.relationships.create('implements_solutions_in', dataProcessing) | |
coolgarifTech.relationships.create('implements_solutions_in', dataVisualisation) | |
coolgarifTech.relationships.create('implements_solutions_in', dataPublishing) |
This file contains 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
coolgarifTech = db.node(name = 'CoolgarifTech', description = 'Digital Agency focused on Data', established="Jan 2013", founders="Richie Barter & James Billot") | |
companyNameIndex['name']['CoolgarifTech'] = coolgarifTech | |
companyNameIndex['description']['Digital Agency focused on Data'] = coolgarifTech |