Skip to content

Commit

Permalink
feat: extract only explicity rdf type in coordinate query
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkleiven committed Oct 14, 2024
1 parent d1fb91c commit 9e428eb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/cimsparql/sparql/coordinates.sparql
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 9e428eb

Please sign in to comment.