How can I find an existing node and then link it to another node? - jaseci

Would something like this work?
Basically what I am trying to do is to link an edge to a node but in return linking the node to an existing node but I need to query the node to find it to link it.
here -[people_link(id="123")]-> node::person(name==w);

This should work in version 1.4 of Jaseci. Try somethign like
here +[people_link(id="123")]+> node::person(name==w);

Related

How to add maps to one simulator?

I am using one simulator and wanted to add my own maps. So I looked into this website https://mygeodata.cloud/ which can provide me with the wkt files of maps.
The problem is I am not able to get these to work, can someone provide some details on how to add a town's map with maybe bus routes etc to ONE Simulator?
The error I'm getting is "SimMap is not fully connected. Only 1057 out of 1113 map nodes can be reached from Nt2#(-1.15,52.95). E.g. Nt2#(-1.14,52.95) can't be reached"
The default roads.wtk files have linestrings like this
LINESTRING (2551683.6644129306 6674375.029443317, 2551528.069902012
6674337.650863852)
While my linestrings of Nottingham,England are this
LINESTRING (-1.1525824 52.9518235,-1.1524917 52.9517354,-1.1519975 >
52.9511418,-1.1517313 52.9508255)
It seems that your input map has around 50 nodes that can not be reached from other map nodes. The ONE Simulator needs to have the map fully connected (i.e., all nodes need to be reachable). Check out the map source (e.g., using OpenJUMP) and look for nodes or map segments that are not connected to each other and delete them or connect them with new line segments. The error message gives you a hint where to look at.
For an example on how to add bus routes, check out the Helsinki map and the tram/bus route files: https://github.com/akeranen/the-one/tree/master/data
that is because there is a broken node there should be a check again for the existing map input because some moves do not want any broken lines there can make messages from open strapmaps then edit using open jump

Grafana templates for Prometheus

I am trying to update the node-exporter-full Grafana dashboard with some of our internal labels as templates. We have labels for "pod" and "servertype" which can be used to get a subset of "nodes" to list at the top of the dashboard.
I can add "pod" like:
label_values(pod)
Then I can reference "pod" in the node query as follows:
label_values(node_boot_time{job="clients",pod="$pod"}, instance)
This works. If I want to add servertype in the middle how would I pull a list of "servertype" based on "pod" which is selected?
I already know the "node" can be filtered with:
label_values(node_boot_time{job="clients",pod="$pod"},servertype="$servertype", instance)
Answer was pretty simple once I reread the documentation. Using "up" function currently and it is working fine but there may be a better solution.
node_boot_time has been changed to node_boot_time_seconds
Refer to this link to get all the name changes since prometheus 0.16.0
https://github.com/prometheus/node_exporter/issues/830

Chef API: Adding runlists to a node

I am trying to figure out how to use the Chef API to add a runlist to a node, such that, when I go to the https://mychefserver/nodes/myapp01 node, I see the runlist under the Run List section.
But the Chef API doesn't appear to allow this. Am I wrong, if so, what's the endpoint and how do I call it?
Run lists aren't their own object, it is just part of the data in the Node object so you would use the normal GET /nodes/foo and PUT /nodes/foo. The run list is under the key run_list and should be an array of strings.

Getting distance between 2 markers

I would like to get the distance between 2 markers but not as a direct line, more as a real path like it goes in this plugin -
https://github.com/perliedman/leaflet-routing-machine
I didn't find anything about using this plugin in the directive: angular-leaflet-directive,
if someone can guide how to make it done, it would be very appreciated.
thanks!
I am not sure if you specifically want to use leaflet routing machine to get distances... but if you do, maybe this info can get you started:
Set up a route on your map based on this example by the leaflet routing machine author:
https://www.liedman.net/leaflet-routing-machine/tutorials/interaction/
If you look at that example, there is an array called routes. Each route has some basic statistics associated with it, generated by OSRM. You can pull them by calling for example:
routes[0].summary.totalDistance
or
routes[0].summary.totalTime
Then you can do whatever you want with them. If you dig through the code on GitHub you can see more about how the data are moved around within the plugin and why the array is arranged that way:
https://unpkg.com/leaflet-routing-machine#3.2.12/dist/leaflet-routing-machine.js

neo4j spatial findGeometriesWithinDistance REST

Using neo4j 1.9 and neo4j spatial for 1.9.
Trying to get findGeometriesWithinDistance REST call working.
I can confirm that the install has worked and that the function exists BUT, using the http console I get a "Node 0 does not exist" error. The REST request I make is exactly as in the docs but instead of returning nodes I get this error.
What is going on that requires node 0 to exist and hence causes the error?
For info, the REST findGeometriesInBBox works fine.
On Further Investigation...
Using py2neo to interact with the DB. In particular, we make use of the GregorianCalendar functionality (see here). When removed from our logic the process of findGeometriesWithinDistance works fine.
Looking into it further, there are comments in the py2neo code that say #retain a handle to the root node (see the first code example here).
Does this "handle" do something with the node of index 0 so we can't use it?
Did you accidentally clean out your database?
I.e. remove node 0, which was the reference node that neo4j-spatial connected its root elements to (in 1.9)?