SimpleGraph-Core

From BITPlan Wiki
Revision as of 10:13, 17 October 2018 by Wf (talk | contribs) (→‎Example)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Basically SimpleGraph-core has the idea of Vertex and Edges being able to carry "payloads". Some of the payload data will be replicated as properties to be able to search for the payload and do something with it but the main thing is to have some kind of pointer/key that a certain SimpleGraph Module will be able work with to allow working with the API for the payload.

Going from a Vertex to a Payload (which is a JavaObject) is currently done with a property SimpleNode.SELF_LABEL see https://github.com/BITPlan/com.bitplan.simplegraph/blob/master/simplegraph-core/src/main/java/com/bitplan/simplegraph/core/SimpleNode.java

Object payLoad=v.property(SimpleNode.SELF_LABEL).value();

In some cases it might be necessary to find a Vertex for a Payload. Currently we use a work-around by putting the Java hashCode of a payload as a property "java.hashCode" into the corresponding Edge or Vertex. This way we can simply lookup the Java Object with

Vertex myVertex=g.V().has("java.hashCode",this.hashCode())

Example

Lets's assume we'd like to access some data about Gravitational Wave observations. A Source for general information on these events is WikiData where you can get a list of the events with a SPARQL query.

Each event is represented as a Vertex. The main info is the event name e.g. "GW150914" with that name you can lookup more detail on the event e.g. You'll find wikipedia articles for it or the source of linked opendata from the Ligo Observatory:

GW150914


Now you might be interested in some details that are not available via WikiData. https://www.gw-openscience.org/events/GW150914/ for instance has link to the orginal HDF5 datasets from the two detectors Hanford and Livingston:

To read the data you'd now have to download a HDFView software to find the starttime of the event as GPS Time 1126259446 UTC 2015-09-14T09:50:29.

Let's simplify this process by using three modules from the SimpleGraphProject

  1. SimpleGraph-WikiData to get the general event data from WikiData with the link to Linked Open Data URL
  2. SimpleGraph-HTML to extract the link to the original hdf5 files from the observatories
  3. SimpleGraph-HDF5 to get to the event details and the original measurement data

Sources