Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions docker/rml-mapper/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ COPY demo.sh /app/demo.sh
RUN dos2unix /app/demo.sh
RUN chmod +x /app/demo.sh


# Run the rml mappings
ENTRYPOINT "/app/demo.sh"

4 changes: 2 additions & 2 deletions docker/rml-mapper/demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# This script is for use inside the docker container defined in the Dockerfile in this folder
# See README.md for instructions

cp /app/NOAKADEXPI/Blueprint/DISC_EXAMPLE-02/DISC_EXAMPLE-02-02.xml /app/local/www/public/
cp /app/NOAKADEXPI/Blueprint/DISC_EXAMPLE-02/DISC_EXAMPLE-02-02.xml /app/local/rml_mappings/pandid.xml
cp /app/local/pandid.xml /app/local/www/public/DISC_EXAMPLE-02-02.xml
cp /app/local/pandid.xml /app/local/rml_mappings/pandid.xml

# Create rdf
cd local/rml_mappings
Expand Down
8 changes: 4 additions & 4 deletions rml_mappings/imf/attributes-map.rml.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
rml:reference "@AttributeURI";
];
rr:objectMap [
rml:reference "@Value" ;
rr:termType rr:Literal
],
[
# rml:reference "@Value" ;
# rr:termType rr:Literal
# ],
# [
rml:reference "@ValueURI";
rr:termType rr:IRI
];
Expand Down
30 changes: 15 additions & 15 deletions www/src/components/diagram/ActuatingSystem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ import SvgElement from "./SvgElement.tsx";

// TODO - Remove when new graphical format implemented
export default function ActuatingSystem(props: ActuatingSystemProps) {
const actuatingSystemComponents = props.ActuatingSystemComponent.filter(
(component) => component.ComponentName,
);
const actuatingSystemComponents = Array.isArray(props.ActuatingSystemComponent)
? props.ActuatingSystemComponent.filter((component) => component.ComponentName)
: [];
return (
<>
{actuatingSystemComponents.map((component, index: number) => (
<SvgElement
key={index}
componentName={component.ComponentName!}
id={component.ID}
position={component.Position}
text={component.GenericAttributes}
/>
))}
</>
<>
{actuatingSystemComponents.map((component, index: number) => (
<SvgElement
key={index}
componentName={component.ComponentName!}
id={component.ID}
position={component.Position}
text={component.GenericAttributes}
/>
))}
</>
);
}
}
10 changes: 8 additions & 2 deletions www/src/components/diagram/CenterLine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ export default function CenterLine(props: CenterLineComponentProps) {
}
id={iri ? iri : props.id}
key={index + "_highlight"}
d={constructPath(centerline.Coordinate, height)}
d={Array.isArray(centerline.Coordinate)
? constructPath(centerline.Coordinate, height)
: ""
}
stroke={color ? color : "black"}
strokeWidth={5}
opacity={hasSelectedInternalNode ? 0.5 : 0}
Expand All @@ -68,7 +71,10 @@ export default function CenterLine(props: CenterLineComponentProps) {
}
<StyledPath
key={index}
d={constructPath(centerline.Coordinate, height)}
d={Array.isArray(centerline.Coordinate)
? constructPath(centerline.Coordinate, height)
: ""
}
$isDashed={props.isInformationFlow}
/>
</React.Fragment>
Expand Down
2 changes: 1 addition & 1 deletion www/src/components/diagram/piping/PipeSegment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default function PipeSegment(props: PipeSegmentProps) {
<SvgElement
id={props.PropertyBreak.ID}
componentName={props.PropertyBreak.ComponentName}
text={props.PropertyBreak.GenericAttributes[0]}
text={props.PropertyBreak.GenericAttributes?.[0] ?? props.PropertyBreak.ComponentName}
position={props.PropertyBreak.Position}
/>
{props.PropertyBreak.PolyLine && (
Expand Down
4 changes: 3 additions & 1 deletion www/src/utils/HelperFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,14 @@ export function iriFromPiping(segment: PipingNetworkSegmentProps) {
(!segment.PipingComponent || !segment.PropertyBreak)
) {
return `https://assetid.equinor.com/plantx#${segment.Connection.ToID}-node${segment.Connection.ToNode}-connector`;
} else if (segment.PipingComponent[1]) {
} else if (segment.PipingComponent && segment.PipingComponent[1]) {
return `https://assetid.equinor.com/plantx#${segment.PipingComponent[1].ID}-node2-connector`;
} else if (segment.Connection?.FromID) {
return `https://assetid.equinor.com/plantx#${segment.Connection.FromID}-node${segment.Connection.FromNode}-connector`;
} else if (segment.Connection?.ToID) {
return `https://assetid.equinor.com/plantx#${segment.Connection!.ToID}-node${segment.Connection!.ToNode}-connector`;
} else if (segment.PipingComponent?.ID) {
return `https://assetid.equinor.com/plantx#${segment.PipingComponent.ID}-node2-connector`;
} else {
console.error("Something went wrong with iri creation");
return ``;
Expand Down
2 changes: 1 addition & 1 deletion www/src/utils/SvgEdit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export function addTextToNode(
fill: "black",
});
const genericAttribute = extractGenericAttributes(genericAttributes);
textElement!.textContent = genericAttribute[0].Value;
textElement!.textContent = genericAttribute[0]?.Value || "Lacking value";
}

return element;
Expand Down