From 9e428eb7fa391c44b8f7b4706f50d72c8fdb7f19 Mon Sep 17 00:00:00 2001 From: David Kleiven Date: Mon, 14 Oct 2024 13:22:42 +0200 Subject: [PATCH] feat: extract only explicity rdf type in coordinate query --- src/cimsparql/sparql/coordinates.sparql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cimsparql/sparql/coordinates.sparql b/src/cimsparql/sparql/coordinates.sparql index a6ed39ed..19398236 100644 --- a/src/cimsparql/sparql/coordinates.sparql +++ b/src/cimsparql/sparql/coordinates.sparql @@ -1,16 +1,16 @@ # Name: Coordinates PREFIX cim: <${cim}> -select ?mrid ?x ?y ?epsg ?rdf_type +select ?mrid ?x ?y ?epsg (str(?resource_type) as ?rdf_type) where { ?s cim:PositionPoint.Location ?location; cim:PositionPoint.sequenceNumber ?nr; cim:PositionPoint.xPosition ?x; cim:PositionPoint.yPosition ?y. - ?location cim:Location.PowerSystemResources ?_mrid; + ?location cim:Location.PowerSystemResources ?resource; cim:Location.CoordinateSystem/cim:CoordinateSystem.crsUrn ?co. - ?_mrid a ?_rdf_type; + values ?resource_type {cim:Substation cim:ACLineSegment} + ?resource a ?resource_type; cim:IdentifiedObject.mRID ?mrid. bind(strafter(?co, 'EPSG::') as ?epsg) bind(concat(str(?mrid), str(?nr)) as ?sequence) - bind(str(?_rdf_type) as ?rdf_type) } order by (?sequece)