Neo4J CypherQL Builder #3
Replies: 3 comments
-
@ericstephan , looks like a great start. After our discussion last week, I was looking forward to seeing what the results would be for this new builder. Your idea to create it using the existing SQL builder as a basis seems to be a great fit. I especially like your approach to making small incremental updates to verify what is generated for each type of element in the internal profile definition. I've found that to be helpful as well rather than attempting to tackle it all. The Root/ComplexType is a perfect starting point. Quick practical question. What tooling/toolsets are you using to execute and test your XSLT transform? Others may benefit from an overview of what toolsets you've selected and how you're approaching your dev and test cycles. Thanks for posting your progress and keep us updated! |
Beta Was this translation helpful? Give feedback.
-
@tviegut - What I'm doing is pretty prototypical but here is my basic workflow: Here's what I used:
This description assumes a person knows how to create profiles in CIMTool including serializations such as SQL. In the directory: CIMTool\configuration\au.com.langdale.cimtoole\builders I copied the sql.xsl file to cypher.xsl. To edit the cypher.xsl XSL I downloaded a free trial XML Spy and did initial testing with the built in XSLT. What I didn't like about this approach was 1) the builder script needed parameters and I wasn't sure what CIMTool required and 2) the XSLT only provides a intermediate XML file for the results not a cypher compliant CREATE statement that I could test in Neo4J. By editing the cypher.xsl directly in the CIMTool builder subdirectory it gave me the ease of making updates and testing in CIMTool without having to restart the CIMTool session. Using CIMTool, it provided the means to save a cypher profile in a format that I could test directly in Neo4J Desktop. In the future I'll probably find an open source XSL editor, since CIMTool XSLT is doing most of the heavy lifting. |
Beta Was this translation helpful? Give feedback.
-
@tviegut - Just thinking about my classType I added, I'm wondering why the nodeId in the profile OWL file appears to carry the GUID and why the XML representation that XML Builder uses does not carry the GUID forward? Using a unique identifier would be helpful for schemaless database such as Neo4J where data types do not exist. |
Beta Was this translation helpful? Give feedback.
-
I'm prototyping Neo4J compliant profiles using CIMTool Builder. The prototype is based on the SQL builder:
In my first prototype I'm only altering the ComplexType|a:Root and a:Simple|a:Domain templates as shown below:
The altered builder generated the following code below. Please note that because Neo4J property graphs do not support schemas, CIMTool can be used to develop consistent graph patterns that can be used by applications. I added a ClassType handle so that queries could be used to develop relationships.
// A wire or combination of wires, with consistent electrical characteristics,
// building a single electrical system, used to carry alternating current
// between points in the power system.
// For symmetrical, transposed three phase lines, it is sufficient to use
// attributes of the line segment, which describe impedances and admittances
// for the entire length of the segment. Additionally impedances can be computed
// by using length and associated per length impedances.
// The BaseVoltage at the two ends of ACLineSegments in a Line shall have
// the same BaseVoltage.nominalVoltage. However, boundary lines may have slightly
// different BaseVoltage.nominalVoltages and variation is allowed. Larger
// voltage difference in general requires use of an equivalent branch.
CREATE ( ACLineSegment
{mRID : "",
classType : "ACLineSegment",
aliasName : "",
description : "",
length : "",
name : ""
});
// Impedance and admittance parameters per unit length for n-wire unbalanced
// lines, in matrix form.
CREATE ( PerLengthPhaseImpedance
{mRID : "",
classType : "PerLengthPhaseImpedance",
conductorCount : ""
});
Beta Was this translation helpful? Give feedback.
All reactions