Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RML mappings NOAKA to IMF RDF #14

Merged
merged 43 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from 39 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
365f446
create some mappings for noaka
henriettelienrebnor Sep 11, 2024
b3ed739
update dlog
henriettelienrebnor Sep 11, 2024
8d9a2c3
remove connectedto
henriettelienrebnor Sep 11, 2024
05923ab
trying and testing
henriettelienrebnor Sep 12, 2024
09d1c49
testing and testing
henriettelienrebnor Sep 13, 2024
beb227f
testing and testing
henriettelienrebnor Sep 13, 2024
2857376
rename file
henriettelienrebnor Sep 16, 2024
d599df9
ting virker
henriettelienrebnor Sep 16, 2024
880289a
new mappings
henriettelienrebnor Sep 17, 2024
50a00fb
remove part of, create readme to keep track
henriettelienrebnor Sep 18, 2024
ad9f654
working on ittt
henriettelienrebnor Sep 18, 2024
d00958e
remove partOf from connector
henriettelienrebnor Sep 18, 2024
638ab8c
add hasterminal
henriettelienrebnor Sep 19, 2024
c0537b0
mapping to component level
henriettelienrebnor Sep 19, 2024
9b9052e
connect nozzle to first component
henriettelienrebnor Sep 20, 2024
2d7fe93
create sparql test for connecting last item to nozzle
henriettelienrebnor Sep 20, 2024
6a2c762
create connector from last nozzle
henriettelienrebnor Sep 20, 2024
0a74d25
sparql test ok, update tests as well some errors
henriettelienrebnor Sep 20, 2024
8c065fe
update input and output terminals, sparql test ok
henriettelienrebnor Sep 20, 2024
2d74472
pipetees now handled
henriettelienrebnor Sep 23, 2024
847f218
update sparql test
henriettelienrebnor Sep 23, 2024
69768cf
specify iterators
henriettelienrebnor Sep 23, 2024
7e0eb03
property break block map
henriettelienrebnor Sep 23, 2024
95ae97a
create input and output for propertybreak
henriettelienrebnor Sep 23, 2024
ba22905
working, but something is wrong
henriettelienrebnor Sep 23, 2024
8a91334
update terminals on propertybreaks and types
henriettelienrebnor Sep 23, 2024
3fd486f
boundary works
henriettelienrebnor Sep 23, 2024
6f93682
create new datalog file
henriettelienrebnor Sep 24, 2024
06fc9c1
fix PropertyBreak terminals
henriettelienrebnor Sep 24, 2024
b961d70
edit folder structure
henriettelienrebnor Sep 24, 2024
de1122b
file renameing
henriettelienrebnor Sep 24, 2024
e2ea321
delete mapping
henriettelienrebnor Sep 24, 2024
ca6af6b
rename and update dlog
henriettelienrebnor Sep 25, 2024
b201e24
clean up
henriettelienrebnor Sep 25, 2024
b44d955
update sparl test
henriettelienrebnor Sep 25, 2024
46a03b6
update documentation
henriettelienrebnor Sep 25, 2024
cf99392
continuing documentation
henriettelienrebnor Sep 26, 2024
70c9ffd
update doc
henriettelienrebnor Sep 26, 2024
d123f00
finish documentation
henriettelienrebnor Sep 26, 2024
834eb8c
Update rml_noaka/proteus_to_imf.md
henriettelienrebnor Sep 26, 2024
6237ae6
Update rml_noaka/proteus_to_imf.md
henriettelienrebnor Sep 26, 2024
8a4194a
Update rml_noaka/PipingNetworkSegmentConnectionTerminal.map.ttl
henriettelienrebnor Sep 26, 2024
f6c72f7
undo change
henriettelienrebnor Sep 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion datalog/interactive_boundary.datalog
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ data:insideBoundary [?new_node] :-
data:insideBoundary [?node],
imf:connectedTo [?node, ?new_node],
dexpi:PipingOrEquipment [?new_node],
NOT data:boundary [?node].
NOT data:boundary [?node].
10 changes: 10 additions & 0 deletions datalog/noaka_boundary.datalog
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
prefix data: <https://assetid.equinor.com/plantx/document/12345#>

data:insideBoundary [?new_node] :-
data:insideBoundary [?node] ,
imf:adjacentTo [?node, ?new_node] ,
NOT data:boundary [?node] .

data:insideBoundary [?new_node] :-
daghovland marked this conversation as resolved.
Show resolved Hide resolved
data:insideBoundary [?node],
imf:hasPart[?new_node, ?node] .
Binary file added doc/images/noaka_boundary.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/images/pipetee_result.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions rdfox/noaka.rdfox
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
boundaries.rdfox

import ../datalog/noaka_boundary.datalog
import +p "../rml_noaka/pandid.trig"
4 changes: 2 additions & 2 deletions rml/nozzlemap.rml..ttl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
@prefix asset: <https://assetid.equinor.com/plantx#> .
@prefix dbo: <http://dbpedia.org/ontology/> .
@prefix imf: <http://ns.imfid.org/imf#> .

@predix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

:NozzleMap a rr:TriplesMap;
rml:logicalSource [
Expand All @@ -25,7 +25,7 @@
rr:predicateObjectMap [
rr:predicate rdfs:label;
rr:objectMap [
rml:reference "Label/Text/@String"
henriettelienrebnor marked this conversation as resolved.
Show resolved Hide resolved
rml:reference "/GenericAttribute[@Name='ItemTagAssignmentClass']/@Value";
]
].

34 changes: 34 additions & 0 deletions rml_noaka/EquipmentBlock.map.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
@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#> .

:EquipmentBlockMap a rr:TriplesMap;
rml:logicalSource [
rml:source "pandid.xml";
rml:referenceFormulation ql:XPath;
rml:iterator "//Equipment"
];
rr:subjectMap [
rr:template "https://assetid.equinor.com/plantx#{@ID}";
rr:termType rr:IRI;
rr:class dexpi:Equipment, imf:Block;
];
rr:predicateObjectMap [
rr:predicate imf:hasTerminal;
rr:objectMap [
rr:template "https://assetid.equinor.com/plantx#{Nozzle/@ID}";
rr:termType rr:IRI;
]
],
[
rr:predicate rdfs:label;
rr:objectMap [
rml:reference "GenericAttributes/GenericAttribute[@Name='TagNameAssignmentClass']/@Value";
]
].
48 changes: 48 additions & 0 deletions rml_noaka/PipingComponentBlock.map.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
@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#> .

:PipingComponentBlockMap a rr:TriplesMap;
rml:logicalSource [
rml:source "pandid.xml";
rml:referenceFormulation ql:XPath;
rml:iterator "//PipingNetworkSegment/PipingComponent"
];
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:hasTerminal;
rr:objectMap [
rr:template "https://assetid.equinor.com/plantx#{concat(@ID, '_input')}";
rr:termType rr:IRI
]
] ;
rr:predicateObjectMap [
rr:predicate imf:hasTerminal;
rr:objectMap [
rr:template "https://assetid.equinor.com/plantx#{concat(@ID, '_output')}";
rr:termType rr:IRI
]
] ;
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"
]
] .
28 changes: 28 additions & 0 deletions rml_noaka/PipingComponentConnector.map.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
@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#> .

:PipingComponentConnectorMap a rr:TriplesMap;
rml:logicalSource [
rml:source "pandid.xml";
rml:referenceFormulation ql:XPath;
rml:iterator "//PipingNetworkSegment/PipingComponent"
];
rr:subjectMap [
rr:template "https://assetid.equinor.com/plantx#{concat(@ID, '_connector')}";
rr:termType rr:IRI;
rr:class imf:Connector;
] ;
rr:predicateObjectMap [
rr:predicate rdfs:label;
rr:objectMap[
rr:constant "connector";
rr:datatype xsd:string
]
] .
77 changes: 77 additions & 0 deletions rml_noaka/PipingComponentTerminal.map.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
@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#> .

:PipingComponentInputTerminal a rr:TriplesMap;
rml:logicalSource [
rml:source "pandid.xml";
rml:referenceFormulation ql:XPath;
rml:iterator "//PipingNetworkSegment/PipingComponent"
];
rr:subjectMap [
rr:template "https://assetid.equinor.com/plantx#{concat(@ID, '_input')}";
rr:termType rr:IRI;
rr:class imf:InputTerminal
];
# If there is no preceding-sibling, then it is the first component in the piping network segment.
# The first component is connected to the object that the piping network segment starts from.
rr:predicateObjectMap [
rr:predicate imf:hasConnector;
rr:objectMap [
rr:template """https://assetid.equinor.com/plantx#{
if(preceding-sibling::PipingComponent[1]/@ID) then
concat(preceding-sibling::PipingComponent[1]/@ID, '_connector')
else if(../Connection/@FromID) then
concat(../Connection/@FromID, '_connector')
else()
}""";
rr:termType rr:IRI;
]
] ;
rr:predicateObjectMap [
rr:predicate rdfs:label;
rr:objectMap [
rr:constant "input";
rr:datatype xsd:string
]
] .

:PipingComponentOutputTerminal a rr:TriplesMap;
rml:logicalSource [
rml:source "pandid.xml";
rml:referenceFormulation ql:XPath;
rml:iterator "//PipingComponent"
] ;
rr:subjectMap [
rr:template "https://assetid.equinor.com/plantx#{concat(@ID, '_output')}";
rr:termType rr:IRI;
rr:class imf:OutputTerminal
] ;
# If there is no following sibling, then it is the last component in the piping network segment.
# The last component is connected to the object that the piping network segment goes to.
rr:predicateObjectMap [
rr:predicate imf:hasConnector;
rr:objectMap [
rr:template """https://assetid.equinor.com/plantx#{
if(following-sibling::PipingComponent[1]/@ID or following-sibling::PropertyBreak/@ID) then
concat(@ID, '_connector')
else if(../Connection/@ToID) then
concat(../Connection/@ToID, '_connector')
else()
}""";
rr:termType rr:IRI;
]
] ;
rr:predicateObjectMap [
rr:predicate rdfs:label;
rr:objectMap [
rr:constant "output";
daghovland marked this conversation as resolved.
Show resolved Hide resolved
rr:datatype xsd:string
]
] .
109 changes: 109 additions & 0 deletions rml_noaka/PipingNetworkSegmentConnectionTerminal.map.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
@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#> .

:PipingComponentSegmentFromNozzleConnectorMap a rr:TriplesMap;
rml:logicalSource [
rml:source "pandid.xml";
rml:referenceFormulation ql:XPath;
rml:iterator "//PipingNetworkSegment/Connection[contains(@FromID, 'Nozzle')]"
henriettelienrebnor marked this conversation as resolved.
Show resolved Hide resolved
];
rr:subjectMap [
rr:template "https://assetid.equinor.com/plantx#{@FromID}";
rr:termType rr:IRI;
rr:class imf:Terminal, dexpi:Nozzle
] ;
#For connection between piping network segments
rr:predicateObjectMap [
rr:predicate imf:hasConnector;
rr:termType rr:IRI;
rr:objectMap[
rr:template "https://assetid.equinor.com/plantx#{../@ID}";
rr:termType rr:IRI
]
] ;
#For connection to the first component on piping network segment
rr:predicateObjectMap [
rr:predicate imf:hasConnector;
rr:termType rr:IRI;
rr:objectMap [
rr:template "https://assetid.equinor.com/plantx#{concat(@FromID, '_connector')}"
]
] .

:PipingComponentSegmentToNozzleConnectorMap a rr:TriplesMap;
rml:logicalSource [
rml:source "pandid.xml";
rml:referenceFormulation ql:XPath;
rml:iterator "//PipingNetworkSegment/Connection[contains(@ToID, 'Nozzle')]"
];
rr:subjectMap [
rr:template "https://assetid.equinor.com/plantx#{@ToID}";
rr:termType rr:IRI;
rr:class imf:Terminal, dexpi:Nozzle
] ;
#For connection between piping network segments
rr:predicateObjectMap [
rr:predicate imf:hasConnector;
rr:termType rr:IRI;
rr:objectMap[
rr:template "https://assetid.equinor.com/plantx#{../@ID}";
rr:termType rr:IRI
]
] ;
#For connection to the last component on piping network segment
rr:predicateObjectMap [
rr:predicate imf:hasConnector;
rr:termType rr:IRI;
rr:objectMap [
rr:template "https://assetid.equinor.com/plantx#{concat(@ToID, '_connector')}"
]
] .

:PipingComponentSegmentFromConnectorMap a rr:TriplesMap;
rml:logicalSource [
rml:source "pandid.xml";
rml:referenceFormulation ql:XPath;
rml:iterator "//PipingNetworkSegment/Connection[not (contains(@ToID, 'Nozzle'))]"
];
rr:subjectMap [
rr:template "https://assetid.equinor.com/plantx#{concat(@ToID, '_input')}";
rr:termType rr:IRI;
rr:class imf:Terminal
] ;
#For connection between piping network segments
rr:predicateObjectMap [
rr:predicate imf:hasConnector;
rr:termType rr:IRI;
rr:objectMap[
rr:template "https://assetid.equinor.com/plantx#{../@ID}";
rr:termType rr:IRI
]
] .

:PipingComponentToConnectorMap a rr:TriplesMap;
rml:logicalSource [
rml:source "pandid.xml";
rml:referenceFormulation ql:XPath;
rml:iterator "//PipingNetworkSegment/Connection[not (contains(@FromID, 'Nozzle'))]"
];
rr:subjectMap [
rr:template "https://assetid.equinor.com/plantx#{concat(@FromID, '_output')}";
rr:termType rr:IRI;
rr:class imf:Terminal
] ;
#For connection between piping network segments
rr:predicateObjectMap [
rr:predicate imf:hasConnector;
rr:termType rr:IRI;
rr:objectMap[
rr:template "https://assetid.equinor.com/plantx#{../@ID}";
rr:termType rr:IRI
]
] .
35 changes: 35 additions & 0 deletions rml_noaka/PipingNetworkSystemConnector.map.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@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#> .

:PipingNetworkSystemConnector a rr:TriplesMap;
rml:logicalSource [
rml:source "pandid.xml";
rml:referenceFormulation ql:XPath;
rml:iterator "//PipingNetworkSystem"
];
rr:subjectMap [
rr:template "https://assetid.equinor.com/plantx#{@ID}";
rr:termType rr:IRI;
rr:class imf:Connector, dexpi:PipingNetworkSystem
] ;
rr:predicateObjectMap [
rr:predicate imf:hasPart;
rr:termType rr:IRI;
rr:objectMap[
rr:template "https://assetid.equinor.com/plantx#{PipingNetworkSegment/@ID}";
rr:termType rr:IRI
]
] ;
rr:predicateObjectMap [
rr:predicate rdfs:label;
rr:objectMap[
rml:reference "GenericAttributes/GenericAttribute[@Name='LineDescriptionAssignmentClass']/@Value"
]
] .
Loading