From dbfa51be33353dd52feb633165c3b64e550efb6b Mon Sep 17 00:00:00 2001 From: Markus Andre Pedersen <89122836+markus-ap@users.noreply.github.com> Date: Fri, 20 Dec 2024 09:14:19 +0100 Subject: [PATCH] Story/204309 graphical rdf (#56) [Pull requests practices for the SSI team](https://github.com/equinor/ssi-infrastructure/blob/main/docs/pr_practices.md) ## Aim of the PR This PR fixes [AB#204309](https://dev.azure.com/EquinorASA/bb9bd8cb-74f7-4ffa-b0cb-60eff0a0be58/_workitems/edit/204309) This PR aims to add examples regarding how the graphical format of DEXPI looks in RDF. ## Implementation Please provide an overview of how this change achieves the goal. ## Type of change - [ ] Bug fix - [ ] New feature - [ ] Breaking change - [ ] This change requires a documentation update - [X] Documentation If the changes impact any dependent services then provide details. ## Additional Changes Creation of separate JSON example for the frontend-spec put into the examples folder. --- examples/frontend.json | 48 +++++++++++++++++++++++++++++ examples/graphical.trig | 68 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 116 insertions(+) create mode 100644 examples/frontend.json create mode 100644 examples/graphical.trig diff --git a/examples/frontend.json b/examples/frontend.json new file mode 100644 index 0000000..2a0f25b --- /dev/null +++ b/examples/frontend.json @@ -0,0 +1,48 @@ +{ + "diagramName": "Test P&ID", + "extent": { + "min": { + "x": 100, + "y": 100 + }, + "max": { + "x": 200, + "y": 200 + } + }, + "symbols": [ + { + "id": "https://assetid.equinor.com/plantx#PressureVessel-1", + "position": { + "x": 390, + "y": 210, + "rotation": 0 + }, + "svg": "1 A" + } + ], + "lines": [ + { + "id": "https://assetid.equinor.com/plantx#GateValve-5-node2-connector", + "coordinates": [ + { + "x": 646, + "y": 188 + }, + { + "x": 646, + "y": 180 + }, + { + "x": 412, + "y": 180 + } + ], + "style": { + "stroke-dasharray": "none", + "stroke-width": "1,4", + "stroke": "rgb(255,255,255)" + } + } + ] + } \ No newline at end of file diff --git a/examples/graphical.trig b/examples/graphical.trig new file mode 100644 index 0000000..d8ca90f --- /dev/null +++ b/examples/graphical.trig @@ -0,0 +1,68 @@ +@prefix : . +@prefix css: . +@prefix graphic: . +@prefix document: . +@prefix symbol: . + +# This example is based on the examples in + +document:doc1234 a :PID ; + :visualisedAs graphic:doc1234 . + +document:PressureVessel-1 :visualisedAs graphic:PressureVessel-1 . +document:GateValve-5-node2-connector :visualisedAs graphic:GateValve-5-node2-connector . + + +graphic:doc1234 a :Diagram ; + :hasExtent [ + a :Extent ; + :minimumExtent [ :x 100 ; :y 100 ] ; + :maximumExtent [ :x 200 ; :y 200 ] + ] ; + :hasSymbol graphic:PressureVessel-1 ; + :hasLine graphic:GateValve-5-node2-connector . + + +graphic:PressureVessel-1 a :Symbol ; + :hasPosition [ + a :Position ; + :x 390 ; + :y 210 ; + :rotation 0 + ]; + :hasGraphics symbol:PT002A . + +graphic:GateValve-5-node2-connector a :Line ; + :hasCoordinates ( + [ + a :Position ; + :x 646 ; + :y 188 + ] + [ + a :Position ; + :x 646 ; + :y 180 + ] + [ + a :Position ; + :x 412 ; + :y 180 + ] + ); + :hasStyle [ + :hasStroke [ + a :Stroke ; + :dasharray "none"^^xsd:css ; + :width 1.4 ; + :color [ + a :Color ; + :type :rgb ; + :red 255 ; + :green 255 ; + :blue 255 + ] ; + :color "rgb(255,255,255)"^^css:funcdef-rgb + ] + ] ; + :hasStyle "stroke-dasharray:none; stroke:rgb(255,255,255); stroke-width:1.4"^^css:style .