Beispiel #1
0
def index(request):
    template = 'KBMS/index.html'

    #querying the graph to get the info
    uri = "bolt://35.161.86.89:7687"
    driver = GraphDatabase.driver(uri, auth=("admin", "AIRocks@17"))
    with driver.session() as session:
        node_object = session.run('MATCH (n) RETURN count(*)')
        rel_object = session.run('MATCH ()-[r]->() RETURN count(*)')

    node_count = node_object.values()[0][0]
    rel_count = rel_object.values()[0][0]

    print('Hereeeee', node_count, rel_count)
    context = {
        'nodes_n': node_count,
        'rels_n': rel_count,
        'rules_n': '0',
        'ontology_n': '5',
    }
    return render(request, template, context)
Beispiel #2
0
import requests
import time
from neo4jrestclient.client import GraphDatabase
from py2neo import Graph, authenticate, Node, Relationship
import csv
import os
from neo4j.v1 import GraphDatabase

#db = GraphDatabase("http://*****:*****@OcouranByte99"))

#authenticate("0.0.0.0:7473", "neo4j", "@OcouranByte99")
#authenticate("67.205.151.165:7687", "neo4j", "@OcouranByte99")
#authenticate("67.205.151.165:7687/db/data", "neo4j", "@OcouranByte99")
#graph = Graph('http://Neo4j:@[email protected]:7687/db/data/')

# set up authentication parameters
#authenticate("67.205.151.165:7474", "neo4j", "@OcouranByte99")
# connect to authenticated graph database
#graph = Graph("http://67.205.151.165:7474/db/data")

#graph = Graph('http://67.205.151.165:7474/db/data', user='******', password='******')

#Organisation's repos
#curl https://api.github.com/orgs/bitcoin/repos
Beispiel #3
0
    def __init__(self, uri, user, password):
        self.neo4_driver = GraphDatabase.driver(uri, auth=(user, password))
        self.neo_session = self.neo4_driver.session()
        # self.txn = Transaction(session=self.neo_session)

        self.exec_qry()
Beispiel #4
0
from flask import Flask, jsonify, request, Blueprint, render_template
from neo4jrestclient import client
from neo4jrestclient.client import GraphDatabase
from neo4jrestclient.constants import RAW
from neo4jrestclient.client import Node
from urlparse import urlparse
import re, json
from neo4j import GraphDatabase

uri = "bolt://*****:*****@app.route('/multi/<int:num>', methods=['GET'])
def get_multiply10(num):
    return jsonify({'result': num * 10})


@app.route('/people/', methods=['GET'])