Skip to content

Commit

Permalink
Merge pull request #20 from equinor/story/connector-pipe-problem
Browse files Browse the repository at this point in the history
Improving pipe tee terminals
  • Loading branch information
henriettelienrebnor authored Oct 10, 2024
2 parents b7ba6de + 8ba28ab commit 05c761b
Show file tree
Hide file tree
Showing 15 changed files with 10,085 additions and 358 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
rml:logicalSource [
rml:source "pandid.xml";
rml:referenceFormulation ql:XPath;
rml:iterator "//Equipment"
rml:iterator "PlantModel/Equipment"
];
rr:subjectMap [
rr:template "https://assetid.equinor.com/plantx#{@ID}";
Expand Down
78 changes: 78 additions & 0 deletions rml_noaka/PipingComponent.map.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
@prefix rml: <http://semweb.mmlab.be/ns/rml#> .
@prefix rr: <http://www.w3.org/ns/r2rml#> .
@prefix ql: <http://semweb.mmlab.be/ns/ql#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix : <http://example.org/rules/> .
@prefix schema: <http://schema.org/> .
@prefix dexpi: <https://rdf.equinor.com/dexpi#> .
@prefix asset: <https://assetid.equinor.com/plantx#> .
@prefix imf: <http://ns.imfid.org/imf#> .

:PipingComponentTerminalMap a rr:TriplesMap;
rml:logicalSource [
rml:source "pandid.xml";
rml:referenceFormulation ql:XPath;
rml:iterator "//PipingNetworkSegment/PipingComponent/ConnectionPoints/Node[@Type='process'] | //PipingNetworkSegment/PropertyBreak/ConnectionPoints/Node[@Type='process']"
];
rr:subjectMap [
rr:template "https://assetid.equinor.com/plantx#{concat(../../@ID, '-node', count(preceding-sibling::*))}";
rr:termType rr:IRI;
rr:class imf:Terminal
];

rr:predicateObjectMap [
rr:predicate imf:hasConnector;
rr:objectMap [
rr:template """https://assetid.equinor.com/plantx#{
if(count(preceding-sibling::*) = 1) then
if(../../preceding-sibling::PipingComponent) then
concat(../../preceding-sibling::PipingComponent[1]/@ID, '-node2-connector')
else if(../../../Connection/@FromID) then
concat(../../../Connection/@FromID, '-node', ../../../Connection/@FromNode, '-connector')
else()
else if(count(preceding-sibling::*) = 2) then
if(../../following-sibling::PipingComponent or following-sibling::PropertyBreak) then
concat(../../@ID , '-node2-connector')
else if(../../../Connection/@ToID) then
concat(../../../Connection/@ToID, '-node', ../../../Connection/@ToNode, '-connector')
else( concat(../../@ID , '-node2-connector') )
else()
}""";
rr:termType rr:IRI;
]
] .

:PipingComponentBlockMap a rr:TriplesMap;
rml:logicalSource [
rml:source "pandid.xml";
rml:referenceFormulation ql:XPath;
rml:iterator "//PipingNetworkSegment/PipingComponent | //PipingNetworkSegment/PropertyBreak"
];
rr:subjectMap [
rr:template "https://assetid.equinor.com/plantx#{@ID}";
rr:termType rr:IRI;
rr:class dexpi:PipingComponent, imf:Block
] ;
rr:predicateObjectMap [
rr:predicate imf:partOf;
rr:objectMap [
rr:template "https://assetid.equinor.com/plantx#{../@ID}";
rr:termType rr:IRI
]
] ;
rr:predicateObjectMap [
rr:predicate rdfs:label ;
rr:objectMap [
rml:reference "GenericAttributes/GenericAttribute[@Name='ItemTagAssignmentClass']/@Value"
]
] ;
rr:predicateObjectMap [
rr:predicate imf:hasTerminal;
rr:objectMap [
rr:parentTriplesMap :PipingComponentTerminalMap;
rr:joinCondition [
rr:child "@ID";
rr:parent "../../@ID";
];
];
] .
48 changes: 0 additions & 48 deletions rml_noaka/PipingComponentBlock.map.ttl

This file was deleted.

28 changes: 0 additions & 28 deletions rml_noaka/PipingComponentConnector.map.ttl

This file was deleted.

77 changes: 0 additions & 77 deletions rml_noaka/PipingComponentTerminal.map.ttl

This file was deleted.

75 changes: 75 additions & 0 deletions rml_noaka/PipingNetworkSegment.map.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
@prefix rml: <http://semweb.mmlab.be/ns/rml#> .
@prefix rr: <http://www.w3.org/ns/r2rml#> .
@prefix ql: <http://semweb.mmlab.be/ns/ql#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix : <http://example.org/rules/> .
@prefix schema: <http://schema.org/> .
@prefix dexpi: <https://rdf.equinor.com/dexpi#> .
@prefix asset: <https://assetid.equinor.com/plantx#> .
@prefix imf: <http://ns.imfid.org/imf#> .


:hasNetworkSegmentConnector
rr:predicate imf:hasConnector;
rr:termType rr:IRI;
rr:objectMap[
rr:template "https://assetid.equinor.com/plantx#{@ID}";
rr:termType rr:IRI
] .


:PipingComponentSegmentFromTerminalMap a rr:TriplesMap;
rml:logicalSource [
rml:source "pandid.xml";
rml:referenceFormulation ql:XPath;
rml:iterator "//PipingNetworkSystem/PipingNetworkSegment"
];
rr:subjectMap [
rr:template """https://assetid.equinor.com/plantx#{
if(Connection/@FromID) then
if ( Connection[@FromID = //Equipment/Nozzle/@ID] ) then
Connection/@FromID
else(concat(Connection/@FromID, '-node', Connection/@FromNode))
else ()
}""";
rr:termType rr:IRI;
rr:class imf:Terminal
] ;

rr:predicateObjectMap :hasNetworkSegmentConnector ;

rr:predicateObjectMap [
rr:predicate imf:hasConnector;
rr:termType rr:IRI;
rr:objectMap [
rr:template "https://assetid.equinor.com/plantx#{concat(Connection/@FromID, '-node' , Connection/@FromNode , '-connector')}"
]
] .

:PipingComponentSegmentToTerminalMap a rr:TriplesMap;
rml:logicalSource [
rml:source "pandid.xml";
rml:referenceFormulation ql:XPath;
rml:iterator "//PipingNetworkSegment"
];
rr:subjectMap [
rr:template """https://assetid.equinor.com/plantx#{
if(Connection/@ToID) then
if (Connection[@ToID = //Equipment/Nozzle/@ID]) then
Connection/@ToID
else ( concat ( Connection/@ToID, '-node', Connection/@ToNode))
else ()
}""";
rr:termType rr:IRI;
rr:class imf:Terminal
] ;

rr:predicateObjectMap :hasNetworkSegmentConnector ;¨

rr:predicateObjectMap [
rr:predicate imf:hasConnector;
rr:termType rr:IRI;
rr:objectMap [
rr:template "https://assetid.equinor.com/plantx#{concat(Connection/@ToID, '-node' , Connection/@ToNode , '-connector')}"
]
] .
Loading

0 comments on commit 05c761b

Please sign in to comment.