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
// JanusGraph Change Schema Bug - Fails | |
graph = JanusGraphFactory.build(). | |
set('storage.backend', 'inmemory'). | |
set('schema.default', 'none'). | |
set('schema.constraints', true).open() | |
mgmt = graph.openManagement() | |
// Define Vertex labels and Properties | |
Artist = mgmt.makeVertexLabel('Artist').make() |
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
// SymphonyGraph Initial Schema | |
mgmt = graph.openManagement() | |
// Define Vertex labels | |
Orchestra = mgmt.makeVertexLabel('Orchestra').make() | |
Artist = mgmt.makeVertexLabel('Artist').make() | |
Work = mgmt.makeVertexLabel('Work').make() | |
Concert = mgmt.makeVertexLabel('Concert').make() | |
// Define Edge labels - the relationships between Vertices |
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
# Use our line as a primer for generating new melodies | |
# from a trained TensorFlow (Magenta) model | |
bundle_file = '~/magenta_data/mag/basic_rnn.mag' | |
session.generate_melody_from_trained_model(trained_model_name='melody_rnn_generator', | |
bundle_file=bundle_file, | |
primer_line_name='bach_cello', | |
primer_len=11, | |
num_outputs=1, | |
qpm=80, | |
num_steps=150) |
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 rheingoldgraph.session import Session | |
# Connect to an existing Gremlin Server via Websocket | |
server_uri = 'ws://localhost:8182/gremlin' | |
session = Session(server_uri) | |
# Add an XML file to the graph | |
session.add_lines_from_xml(filename='scores/BachCelloSuiteDminPrelude.xml', | |
piece_name='bach_cello') |
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
// Create the musical line | |
l0 = g.addV('Line').property('name', 'bach_cello').next() | |
// Create notes | |
n0 = g.addV('Note').property('name', 'D3'). | |
property('length', 8). | |
property('dot', 0).next() | |
n1 = g.addV('Note').property('name', 'F3'). | |
property('length', 8). |
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
<note> | |
<pitch> | |
<step>D</step> | |
<octave>3</octave> | |
</pitch> | |
<duration>2</duration> | |
<voice>1</voice> | |
<type>eighth</type> | |
<stem>down</stem> | |
<beam number="1">begin</beam> |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |