2

I am trying to use the OGC GeoSPARQL vocabulary in a Turtle file. Here is a fragment:

:spatialextent
 a geosparql:Geometry;
 geosparql:asGML "<gml:Polygon srsName="EPSG:28992"><gml:exterior><gml:LinearRing><gml:posList srsDimension="2">97372 487153 97372 580407 149636 580407 149636 487153 97372 487153</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon>"^^geosparql:gmlLiteral;
 .

This notation is rejected by the online RDF validator I use: http://www.rdfabout.com/demo/validator/, on account of the double quotes, e.g. "EPSG:28992". This can be resolved by changing the double quotes to single quotes. I think that will not invalidate the GML. But I'd rather keep the double quotes because that is the way the GML is generated.

In RDF/XML the solution would be to use a CDATA block, like this (Example from the GeoSPARQL document. Yes, it's WKT but the same principle applies):

<sf:Polygon rdf:about="http://example.org/ApplicationSchema#AExactGeom">
 <geo:asWKT rdf:datatype= "http://www.opengis.net/ont/geosparql#wktLiteral">
  <![CDATA[<http://www.opengis.net/def/crs/OGC/1.3/CRS84> Polygon((-83.6 34.1, -83.2 34.1, -83.2 34.5,-83.6 34.5, -83.6 34.1))]]>
 </geo:asWKT>
</sf:Polygon>

Is there a way to such a thing in turtle? Or are there other ways of handling a case like this?

Thanks in advance!

David Lotts
  • 550
  • 5
  • 10
user952460
  • 133
  • 1
  • 8

1 Answers1

2

Just escape the offending characters, replacing " with \":

:spatialextent
    a geosparql:Geometry;
    geosparql:asGML 
        "<gml:Polygon srsName=\"EPSG:28992\"><gml:exterior><gml:LinearRing><gml:posList srsDimension=\"2\">97372 487153 97372 580407 149636 580407 149636 487153 97372 487153</gml:posList></gml:LinearRing></gml:exterior></gml:Polygon>"^^geosparql:gmlLiteral;
.
user205512
  • 8,798
  • 29
  • 28