Skip to content

Commit

Permalink
Merge pull request #16 from equinor/aibel_dexpi_rml_mappings
Browse files Browse the repository at this point in the history
Tech debt: Fix hard coding checking if ID contains Nozzle
  • Loading branch information
daghovland authored Oct 7, 2024
2 parents 968b8c4 + 0c51b0e commit 0a40040
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ client/Boundaries/Dexpi2Svg/obj
client/Boundaries/Boundaries/bin
client/Boundaries/Boundaries/obj
client/Boundaries/TestBoundaries/obj
client/Boundaries/TestBoundaries/bin
client/Boundaries/TestBoundaries/bin
aibel_dexpi/*
aibel_dexpi.xml
3 changes: 1 addition & 2 deletions datalog/noaka_boundary.datalog
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ data:insideBoundary [?new_node] :-
data:insideBoundary [?node],
imf:hasPart[?new_node, ?node] .


data:boundary [?new_node] :-
data:boundary [?node],
imf:hasPart[?new_node, ?node] .
imf:hasPart[?new_node, ?node] .
35 changes: 17 additions & 18 deletions rml_noaka/PipingNetworkSegmentConnectionTerminal.map.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
rml:logicalSource [
rml:source "pandid.xml";
rml:referenceFormulation ql:XPath;
## TODO: Not hardcoded nozzle id part
rml:iterator "//PipingNetworkSegment/Connection[contains(@FromID, 'Nozzle')]"
rml:iterator "//PipingNetworkSegment"
];
rr:subjectMap [
rr:template "https://assetid.equinor.com/plantx#{@FromID}";
rr:template "https://assetid.equinor.com/plantx#{Connection[@FromID = //Equipment/Nozzle/@ID]/@FromID}";
rr:termType rr:IRI;
rr:class imf:Terminal, dexpi:Nozzle
] ;
Expand All @@ -25,7 +24,7 @@
rr:predicate imf:hasConnector;
rr:termType rr:IRI;
rr:objectMap[
rr:template "https://assetid.equinor.com/plantx#{../@ID}";
rr:template "https://assetid.equinor.com/plantx#{@ID}";
rr:termType rr:IRI
]
] ;
Expand All @@ -34,18 +33,18 @@
rr:predicate imf:hasConnector;
rr:termType rr:IRI;
rr:objectMap [
rr:template "https://assetid.equinor.com/plantx#{concat(@FromID, '_connector')}"
rr:template "https://assetid.equinor.com/plantx#{concat(Connection[@FromID = //Equipment/Nozzle/@ID]/@FromID, '_connector')}"
]
] .

:PipingComponentSegmentToNozzleConnectorMap a rr:TriplesMap;
rml:logicalSource [
rml:source "pandid.xml";
rml:referenceFormulation ql:XPath;
rml:iterator "//PipingNetworkSegment/Connection[contains(@ToID, 'Nozzle')]"
rml:iterator "//PipingNetworkSegment"
];
rr:subjectMap [
rr:template "https://assetid.equinor.com/plantx#{@ToID}";
rr:template "https://assetid.equinor.com/plantx#{Connection[@ToID = //Equipment/Nozzle/@ID]/@ToID}";
rr:termType rr:IRI;
rr:class imf:Terminal, dexpi:Nozzle
] ;
Expand All @@ -54,7 +53,7 @@
rr:predicate imf:hasConnector;
rr:termType rr:IRI;
rr:objectMap[
rr:template "https://assetid.equinor.com/plantx#{../@ID}";
rr:template "https://assetid.equinor.com/plantx#{@ID}";
rr:termType rr:IRI
]
] ;
Expand All @@ -63,18 +62,18 @@
rr:predicate imf:hasConnector;
rr:termType rr:IRI;
rr:objectMap [
rr:template "https://assetid.equinor.com/plantx#{concat(@ToID, '_connector')}"
rr:template "https://assetid.equinor.com/plantx#{concat(Connection[@ToID = //Equipment/Nozzle/@ID]/@ToID, '_connector')}"
]
] .

:PipingComponentSegmentFromConnectorMap a rr:TriplesMap;
:PipingComponentSegmentToConnectorMap a rr:TriplesMap;
rml:logicalSource [
rml:source "pandid.xml";
rml:referenceFormulation ql:XPath;
rml:iterator "//PipingNetworkSegment/Connection[not (contains(@ToID, 'Nozzle'))]"
rml:iterator "//PipingNetworkSegment"
];
rr:subjectMap [
rr:template "if(@ToID) then https://assetid.equinor.com/plantx#{concat(@ToID, '_input')}";
rr:template "https://assetid.equinor.com/plantx#{Connection[not(@ToID = //Equipment/Nozzle/@ID) and string-length(normalize-space(@ToID)) > 0]/concat(@ToID, '_input')}";
rr:termType rr:IRI;
rr:class imf:Terminal
] ;
Expand All @@ -83,19 +82,19 @@
rr:predicate imf:hasConnector;
rr:termType rr:IRI;
rr:objectMap[
rr:template "https://assetid.equinor.com/plantx#{../@ID}";
rr:template "https://assetid.equinor.com/plantx#{@ID}";
rr:termType rr:IRI
]
] .

:PipingComponentToConnectorMap a rr:TriplesMap;
:PipingComponentFromConnectorMap a rr:TriplesMap;
rml:logicalSource [
rml:source "pandid.xml";
rml:referenceFormulation ql:XPath;
rml:iterator "//PipingNetworkSegment/Connection[not (contains(@FromID, 'Nozzle'))]"
rml:iterator "//PipingNetworkSegment"
];
rr:subjectMap [
rr:template "if(@FromID) then https://assetid.equinor.com/plantx#{concat(@FromID, '_output')}";
rr:template "https://assetid.equinor.com/plantx#{Connection[not(@FromID = //Equipment/Nozzle/@FromID) and string-length(normalize-space(@FromID)) > 0]/concat(@FromID, '_output')}";
rr:termType rr:IRI;
rr:class imf:Terminal
] ;
Expand All @@ -104,7 +103,7 @@
rr:predicate imf:hasConnector;
rr:termType rr:IRI;
rr:objectMap[
rr:template "https://assetid.equinor.com/plantx#{../@ID}";
rr:template "https://assetid.equinor.com/plantx#{@ID}";
rr:termType rr:IRI
]
] .
] .

0 comments on commit 0a40040

Please sign in to comment.