GeoSPARQL functions and spatial reference systems (SRS) The 2019 Stack Overflow Developer Survey Results Are InGoogle maps spatial reference systemSQL 2008 Spatial ordering of objectsspatial referenceMigrating Oracle geometry rows from geodetic to cartesianst_within function of GeoSPARQL on VirtuosoDoes RDF4J Support GeoSPARQL?How to use geof:distance function from GeoSPARQLGeoSPARQL or stSPARQL to get length of line objectGraphDB GeoSPARQL projection supportGraphDB & GeoSPARQL

The difference between dialogue marks

What is the accessibility of a package's `Private` context variables?

Is an up-to-date browser secure on an out-of-date OS?

For what reasons would an animal species NOT cross a *horizontal* land bridge?

Is bread bad for ducks?

How can I autofill dates in Excel excluding Sunday?

Do these rules for Critical Successes and Critical Failures seem Fair?

How come people say “Would of”?

Deal with toxic manager when you can't quit

What does Linus Torvalds mean when he says that Git "never ever" tracks a file?

Can a flute soloist sit?

Can we generate random numbers using irrational numbers like π and e?

What did it mean to "align" a radio?

Right tool to dig six foot holes?

Button changing it's text & action. Good or terrible?

Why isn't airport relocation done gradually?

Origin of "cooter" meaning "vagina"

Is flight data recorder erased after every flight?

What is the most effective way of iterating a std::vector and why?

Multiply Two Integer Polynomials

One word riddle: Vowel in the middle

Pokemon Turn Based battle (Python)

Does the shape of a die affect the probability of a number being rolled?

Aging parents with no investments



GeoSPARQL functions and spatial reference systems (SRS)



The 2019 Stack Overflow Developer Survey Results Are InGoogle maps spatial reference systemSQL 2008 Spatial ordering of objectsspatial referenceMigrating Oracle geometry rows from geodetic to cartesianst_within function of GeoSPARQL on VirtuosoDoes RDF4J Support GeoSPARQL?How to use geof:distance function from GeoSPARQLGeoSPARQL or stSPARQL to get length of line objectGraphDB GeoSPARQL projection supportGraphDB & GeoSPARQL



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I am trying to represent in an ontology a few geometric objects (polygon, lines, points, etc.) and calculate their spatial/topological relations, through the adoption of GeoSPARQL relevant functions (sfTouches, sfEquals, sfContains, etc.). I am using GraphDB, with the GeoSPARQL plugin enabled.



I have seen that in the WKT representation of the geometric object, GeoSPARQL uses the concept of a default spatial reference system (i.e. the <http://www.opengis.net/def/crs/OGC/1.3/CRS84> URI which corresponds to the WGS84 coordinate reference system (CRS)). However, in my use case, the coordinates of the geometrical objects actually correspond to values in a 2D Cartesian coordinate system.



I found in the EPSG Geodetic Parameter Registry the proper CRS for representing Cartesian coordinates and I attached the proper URI in the WKT representation, but the GeoSPARQL functions do not return any result or error.



My question is the following: "Do the GeoSPARQL functions operate properly when representing spatial objects in any other type of CRS, apart from the default one?".



Thank you in advance.










share|improve this question




























    0















    I am trying to represent in an ontology a few geometric objects (polygon, lines, points, etc.) and calculate their spatial/topological relations, through the adoption of GeoSPARQL relevant functions (sfTouches, sfEquals, sfContains, etc.). I am using GraphDB, with the GeoSPARQL plugin enabled.



    I have seen that in the WKT representation of the geometric object, GeoSPARQL uses the concept of a default spatial reference system (i.e. the <http://www.opengis.net/def/crs/OGC/1.3/CRS84> URI which corresponds to the WGS84 coordinate reference system (CRS)). However, in my use case, the coordinates of the geometrical objects actually correspond to values in a 2D Cartesian coordinate system.



    I found in the EPSG Geodetic Parameter Registry the proper CRS for representing Cartesian coordinates and I attached the proper URI in the WKT representation, but the GeoSPARQL functions do not return any result or error.



    My question is the following: "Do the GeoSPARQL functions operate properly when representing spatial objects in any other type of CRS, apart from the default one?".



    Thank you in advance.










    share|improve this question
























      0












      0








      0








      I am trying to represent in an ontology a few geometric objects (polygon, lines, points, etc.) and calculate their spatial/topological relations, through the adoption of GeoSPARQL relevant functions (sfTouches, sfEquals, sfContains, etc.). I am using GraphDB, with the GeoSPARQL plugin enabled.



      I have seen that in the WKT representation of the geometric object, GeoSPARQL uses the concept of a default spatial reference system (i.e. the <http://www.opengis.net/def/crs/OGC/1.3/CRS84> URI which corresponds to the WGS84 coordinate reference system (CRS)). However, in my use case, the coordinates of the geometrical objects actually correspond to values in a 2D Cartesian coordinate system.



      I found in the EPSG Geodetic Parameter Registry the proper CRS for representing Cartesian coordinates and I attached the proper URI in the WKT representation, but the GeoSPARQL functions do not return any result or error.



      My question is the following: "Do the GeoSPARQL functions operate properly when representing spatial objects in any other type of CRS, apart from the default one?".



      Thank you in advance.










      share|improve this question














      I am trying to represent in an ontology a few geometric objects (polygon, lines, points, etc.) and calculate their spatial/topological relations, through the adoption of GeoSPARQL relevant functions (sfTouches, sfEquals, sfContains, etc.). I am using GraphDB, with the GeoSPARQL plugin enabled.



      I have seen that in the WKT representation of the geometric object, GeoSPARQL uses the concept of a default spatial reference system (i.e. the <http://www.opengis.net/def/crs/OGC/1.3/CRS84> URI which corresponds to the WGS84 coordinate reference system (CRS)). However, in my use case, the coordinates of the geometrical objects actually correspond to values in a 2D Cartesian coordinate system.



      I found in the EPSG Geodetic Parameter Registry the proper CRS for representing Cartesian coordinates and I attached the proper URI in the WKT representation, but the GeoSPARQL functions do not return any result or error.



      My question is the following: "Do the GeoSPARQL functions operate properly when representing spatial objects in any other type of CRS, apart from the default one?".



      Thank you in advance.







      spatial graphdb geosparql






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 8 at 9:44









      mrigamriga

      1




      1






















          2 Answers
          2






          active

          oldest

          votes


















          1














          Currently GDB does not support alternative CRS in WKT literals but supports them in GML literals (issue GDB-3142). GML literals are slightly more complex but still easy enough to generate, let us know if you need help with that.



          However, I question your assertion that you have Cartesian coordinates. On one hand, any pair (lat,long) or (nothing,easting) is a Cartesian coordinate. On the other hand, since the Earth is not flat, any CRS or projection method is only an approximation, and many of them are tuned for specific localities.



          So please tell us which EPSG CRS you picked, and a bit about the locality of your data.






          share|improve this answer























          • Thank you @VladimirAlexiev for your reply! My aim is to infer spatial relations between objects detected by an object detection system. Objects are populated in an ontology, in a form of polygons, each point of which is projected in a X,Y Cartesian system. Axis have limits; x_min=0, x_max=1280, y_min=0, y_max=960. I've experimented with different CRSs: e.g. 4499 (opengis.net/def/cs/EPSG/0/4499), 4530, etc. However, none of the GeoSPARQL function (e.g. geof:sfTouches, geof:sfContains, etc.) return any result. So, is it really a GraphDB-CRS or a GeoSPARQL-CRS issue?

            – mriga
            Mar 13 at 13:04












          • If I understand correctly, your geometries are not fixed to a particular location on Earth. I checked CRS 4499, and if your coordinates are in meters, it should fill the bill. Given the previous answer: do you use GML literals to load your geometries in GDB? Can you share a turtle file with a couple of features, so we can test?

            – Vladimir Alexiev
            Mar 14 at 9:15











          • Sorry for the late response. Yes, you understand right. My geometries have nothing to do with geo references. Imagine them as polygons or points in a XY coordinate system (see my previous answer). Unfortunately, I only tried the WKT literal representations since I am not aware of how to initialise my data with GML literals. I will now include an example instantiation in a following comment. Thank you @Vladimir for your help and time.

            – mriga
            Mar 18 at 13:36











          • In the following triples I represent a polygon and a point within it. When running GeoSPARQL (e.g. function geof:sfContains, or geof:sfWithin) through GraphDB, it returns no results.

            – mriga
            Mar 18 at 13:50












          • ex:polygon_ABCD rdf:type ex:ExampleEntity ; geo:hasGeometry ex:geometry_polygon_ABCD ; . ex:geometry_polygon_ABCD rdf:type geo:Geometry ; rdf:type sf:Polygon ; geo:asWKT "<opengis.net/def/cs/EPSG/0/4499> Polygon((389.0 1052.0, 563.0 1052.0, 563.0 1280.0, 389.0 1280.0, 389.0 1052.0))"^^geo:wktLiteral ; . ex:point_E rdf:type ex:ExampleEntity ; geo:hasGeometry ex:geometry_point_E ; . ex:geometry_point_E rdf:type geo:Geometry ; rdf:type sf:Point ; geo:asWKT "<opengis.net/def/cs/EPSG/0/4499> Point(400.0 1100.0)"^^geo:wktLiteral ; .

            – mriga
            Mar 18 at 13:51


















          0














          Your example, slightly reformatted, and using normal turtle shortenings:



          ex:polygon_ABCD rdf:type ex:ExampleEntity ;
          geo:hasGeometry ex:geometry_polygon_ABCD .

          ex:geometry_polygon_ABCD a geo:Geometry, sf:Polygon ;
          geo:asWKT "<opengis.net/def/cs/EPSG/0/4499> Polygon((389.0 1052.0, 563.0 1052.0, 563.0 1280.0, 389.0 1280.0, 389.0 1052.0))"^^geo:wktLiteral .

          ex:point_E rdf:type ex:ExampleEntity ;
          geo:hasGeometry ex:geometry_point_E .

          ex:geometry_point_E a geo:Geometry, sf:Point ;
          geo:asWKT "<opengis.net/def/cs/EPSG/0/4499> Point(400.0 1100.0)"^^geo:wktLiteral ; .


          You must use a specific URL for the CRS and cannot omit http:, so the correct URL is http://www.opengis.net/def/crs/EPSG/0/4499.



          But you can see from the returned description that this CRS is applocable to "China - onshore and offshore between 120°E and 126°E". I'm not an expert in geo projections so I can't guarantee whether this CRS will satisfy your need "leave my coordinates alone, they are just meters". I'd look for a UK (OrdnanceSurvey) CRS with easting and northing coordinates.



          To learn how to format GML:



          • see the GeoSPARQL spec (OGC 11-052r4) p18, whchc gives an example about gml:Point.

          • then google for gml:Polygon. There are many links but one that gives examples is http://www.georss.org/gml.html

          Armed with this knowledge, we can reformat your example to GML:



          ex:polygon_ABCD rdf:type ex:ExampleEntity ;
          geo:hasGeometry ex:geometry_polygon_ABCD .

          ex:geometry_polygon_ABCD a geo:Geometry, sf:Polygon ;
          geo:asGML """
          <gml:Polygon xmlns:gml="http://www.opengis.net/gml" srsName="http://www.opengis.net/def/crs/EPSG/0/TODO">
          <gml:exterior>
          <gml:LinearRing>
          <gml:posList>
          389.0 1052.0, 563.0 1052.0, 563.0 1280.0, 389.0 1280.0, 389.0 1052.0
          </gml:posList>
          </gml:LinearRing>
          </gml:exterior>
          </gml:Polygon>
          """^^geo:gmlLiteral.

          ex:point_E rdf:type ex:ExampleEntity ;
          geo:hasGeometry ex:geometry_point_E .

          ex:geometry_point_E a geo:Geometry, sf:Point ;
          geo:asGML """
          <gml:Point xmlns:gml="http://www.opengis.net/gml" srsName="http://www.opengis.net/def/crs/EPSG/0/TODO">
          <gml:pos>
          400.0 1100.0
          </gml:pos>
          </gml:Point>
          """^^geo:gmlLiteral.


          • The """ (long quote) allows us to use " inside the literal without quoting

          • replace TODO with the better CRS you picked

          • the documentation http://graphdb.ontotext.com/documentation/master/enterprise/geosparql-support.html#geosparql-examples gives an example similar to yours but it cheats a bit because all coordinates are in the range (-90,+90) so it can just use WGS.

          • after you debug using geof: topology functions, turn on indexing and switch to geo: predicates, because the functions are slow (they check every geometry against every other) while the predicates use the special geo index

          Let me know how it goes!






          share|improve this answer

























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55060508%2fgeosparql-functions-and-spatial-reference-systems-srs%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            Currently GDB does not support alternative CRS in WKT literals but supports them in GML literals (issue GDB-3142). GML literals are slightly more complex but still easy enough to generate, let us know if you need help with that.



            However, I question your assertion that you have Cartesian coordinates. On one hand, any pair (lat,long) or (nothing,easting) is a Cartesian coordinate. On the other hand, since the Earth is not flat, any CRS or projection method is only an approximation, and many of them are tuned for specific localities.



            So please tell us which EPSG CRS you picked, and a bit about the locality of your data.






            share|improve this answer























            • Thank you @VladimirAlexiev for your reply! My aim is to infer spatial relations between objects detected by an object detection system. Objects are populated in an ontology, in a form of polygons, each point of which is projected in a X,Y Cartesian system. Axis have limits; x_min=0, x_max=1280, y_min=0, y_max=960. I've experimented with different CRSs: e.g. 4499 (opengis.net/def/cs/EPSG/0/4499), 4530, etc. However, none of the GeoSPARQL function (e.g. geof:sfTouches, geof:sfContains, etc.) return any result. So, is it really a GraphDB-CRS or a GeoSPARQL-CRS issue?

              – mriga
              Mar 13 at 13:04












            • If I understand correctly, your geometries are not fixed to a particular location on Earth. I checked CRS 4499, and if your coordinates are in meters, it should fill the bill. Given the previous answer: do you use GML literals to load your geometries in GDB? Can you share a turtle file with a couple of features, so we can test?

              – Vladimir Alexiev
              Mar 14 at 9:15











            • Sorry for the late response. Yes, you understand right. My geometries have nothing to do with geo references. Imagine them as polygons or points in a XY coordinate system (see my previous answer). Unfortunately, I only tried the WKT literal representations since I am not aware of how to initialise my data with GML literals. I will now include an example instantiation in a following comment. Thank you @Vladimir for your help and time.

              – mriga
              Mar 18 at 13:36











            • In the following triples I represent a polygon and a point within it. When running GeoSPARQL (e.g. function geof:sfContains, or geof:sfWithin) through GraphDB, it returns no results.

              – mriga
              Mar 18 at 13:50












            • ex:polygon_ABCD rdf:type ex:ExampleEntity ; geo:hasGeometry ex:geometry_polygon_ABCD ; . ex:geometry_polygon_ABCD rdf:type geo:Geometry ; rdf:type sf:Polygon ; geo:asWKT "<opengis.net/def/cs/EPSG/0/4499> Polygon((389.0 1052.0, 563.0 1052.0, 563.0 1280.0, 389.0 1280.0, 389.0 1052.0))"^^geo:wktLiteral ; . ex:point_E rdf:type ex:ExampleEntity ; geo:hasGeometry ex:geometry_point_E ; . ex:geometry_point_E rdf:type geo:Geometry ; rdf:type sf:Point ; geo:asWKT "<opengis.net/def/cs/EPSG/0/4499> Point(400.0 1100.0)"^^geo:wktLiteral ; .

              – mriga
              Mar 18 at 13:51















            1














            Currently GDB does not support alternative CRS in WKT literals but supports them in GML literals (issue GDB-3142). GML literals are slightly more complex but still easy enough to generate, let us know if you need help with that.



            However, I question your assertion that you have Cartesian coordinates. On one hand, any pair (lat,long) or (nothing,easting) is a Cartesian coordinate. On the other hand, since the Earth is not flat, any CRS or projection method is only an approximation, and many of them are tuned for specific localities.



            So please tell us which EPSG CRS you picked, and a bit about the locality of your data.






            share|improve this answer























            • Thank you @VladimirAlexiev for your reply! My aim is to infer spatial relations between objects detected by an object detection system. Objects are populated in an ontology, in a form of polygons, each point of which is projected in a X,Y Cartesian system. Axis have limits; x_min=0, x_max=1280, y_min=0, y_max=960. I've experimented with different CRSs: e.g. 4499 (opengis.net/def/cs/EPSG/0/4499), 4530, etc. However, none of the GeoSPARQL function (e.g. geof:sfTouches, geof:sfContains, etc.) return any result. So, is it really a GraphDB-CRS or a GeoSPARQL-CRS issue?

              – mriga
              Mar 13 at 13:04












            • If I understand correctly, your geometries are not fixed to a particular location on Earth. I checked CRS 4499, and if your coordinates are in meters, it should fill the bill. Given the previous answer: do you use GML literals to load your geometries in GDB? Can you share a turtle file with a couple of features, so we can test?

              – Vladimir Alexiev
              Mar 14 at 9:15











            • Sorry for the late response. Yes, you understand right. My geometries have nothing to do with geo references. Imagine them as polygons or points in a XY coordinate system (see my previous answer). Unfortunately, I only tried the WKT literal representations since I am not aware of how to initialise my data with GML literals. I will now include an example instantiation in a following comment. Thank you @Vladimir for your help and time.

              – mriga
              Mar 18 at 13:36











            • In the following triples I represent a polygon and a point within it. When running GeoSPARQL (e.g. function geof:sfContains, or geof:sfWithin) through GraphDB, it returns no results.

              – mriga
              Mar 18 at 13:50












            • ex:polygon_ABCD rdf:type ex:ExampleEntity ; geo:hasGeometry ex:geometry_polygon_ABCD ; . ex:geometry_polygon_ABCD rdf:type geo:Geometry ; rdf:type sf:Polygon ; geo:asWKT "<opengis.net/def/cs/EPSG/0/4499> Polygon((389.0 1052.0, 563.0 1052.0, 563.0 1280.0, 389.0 1280.0, 389.0 1052.0))"^^geo:wktLiteral ; . ex:point_E rdf:type ex:ExampleEntity ; geo:hasGeometry ex:geometry_point_E ; . ex:geometry_point_E rdf:type geo:Geometry ; rdf:type sf:Point ; geo:asWKT "<opengis.net/def/cs/EPSG/0/4499> Point(400.0 1100.0)"^^geo:wktLiteral ; .

              – mriga
              Mar 18 at 13:51













            1












            1








            1







            Currently GDB does not support alternative CRS in WKT literals but supports them in GML literals (issue GDB-3142). GML literals are slightly more complex but still easy enough to generate, let us know if you need help with that.



            However, I question your assertion that you have Cartesian coordinates. On one hand, any pair (lat,long) or (nothing,easting) is a Cartesian coordinate. On the other hand, since the Earth is not flat, any CRS or projection method is only an approximation, and many of them are tuned for specific localities.



            So please tell us which EPSG CRS you picked, and a bit about the locality of your data.






            share|improve this answer













            Currently GDB does not support alternative CRS in WKT literals but supports them in GML literals (issue GDB-3142). GML literals are slightly more complex but still easy enough to generate, let us know if you need help with that.



            However, I question your assertion that you have Cartesian coordinates. On one hand, any pair (lat,long) or (nothing,easting) is a Cartesian coordinate. On the other hand, since the Earth is not flat, any CRS or projection method is only an approximation, and many of them are tuned for specific localities.



            So please tell us which EPSG CRS you picked, and a bit about the locality of your data.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Mar 10 at 11:50









            Vladimir AlexievVladimir Alexiev

            1,29911123




            1,29911123












            • Thank you @VladimirAlexiev for your reply! My aim is to infer spatial relations between objects detected by an object detection system. Objects are populated in an ontology, in a form of polygons, each point of which is projected in a X,Y Cartesian system. Axis have limits; x_min=0, x_max=1280, y_min=0, y_max=960. I've experimented with different CRSs: e.g. 4499 (opengis.net/def/cs/EPSG/0/4499), 4530, etc. However, none of the GeoSPARQL function (e.g. geof:sfTouches, geof:sfContains, etc.) return any result. So, is it really a GraphDB-CRS or a GeoSPARQL-CRS issue?

              – mriga
              Mar 13 at 13:04












            • If I understand correctly, your geometries are not fixed to a particular location on Earth. I checked CRS 4499, and if your coordinates are in meters, it should fill the bill. Given the previous answer: do you use GML literals to load your geometries in GDB? Can you share a turtle file with a couple of features, so we can test?

              – Vladimir Alexiev
              Mar 14 at 9:15











            • Sorry for the late response. Yes, you understand right. My geometries have nothing to do with geo references. Imagine them as polygons or points in a XY coordinate system (see my previous answer). Unfortunately, I only tried the WKT literal representations since I am not aware of how to initialise my data with GML literals. I will now include an example instantiation in a following comment. Thank you @Vladimir for your help and time.

              – mriga
              Mar 18 at 13:36











            • In the following triples I represent a polygon and a point within it. When running GeoSPARQL (e.g. function geof:sfContains, or geof:sfWithin) through GraphDB, it returns no results.

              – mriga
              Mar 18 at 13:50












            • ex:polygon_ABCD rdf:type ex:ExampleEntity ; geo:hasGeometry ex:geometry_polygon_ABCD ; . ex:geometry_polygon_ABCD rdf:type geo:Geometry ; rdf:type sf:Polygon ; geo:asWKT "<opengis.net/def/cs/EPSG/0/4499> Polygon((389.0 1052.0, 563.0 1052.0, 563.0 1280.0, 389.0 1280.0, 389.0 1052.0))"^^geo:wktLiteral ; . ex:point_E rdf:type ex:ExampleEntity ; geo:hasGeometry ex:geometry_point_E ; . ex:geometry_point_E rdf:type geo:Geometry ; rdf:type sf:Point ; geo:asWKT "<opengis.net/def/cs/EPSG/0/4499> Point(400.0 1100.0)"^^geo:wktLiteral ; .

              – mriga
              Mar 18 at 13:51

















            • Thank you @VladimirAlexiev for your reply! My aim is to infer spatial relations between objects detected by an object detection system. Objects are populated in an ontology, in a form of polygons, each point of which is projected in a X,Y Cartesian system. Axis have limits; x_min=0, x_max=1280, y_min=0, y_max=960. I've experimented with different CRSs: e.g. 4499 (opengis.net/def/cs/EPSG/0/4499), 4530, etc. However, none of the GeoSPARQL function (e.g. geof:sfTouches, geof:sfContains, etc.) return any result. So, is it really a GraphDB-CRS or a GeoSPARQL-CRS issue?

              – mriga
              Mar 13 at 13:04












            • If I understand correctly, your geometries are not fixed to a particular location on Earth. I checked CRS 4499, and if your coordinates are in meters, it should fill the bill. Given the previous answer: do you use GML literals to load your geometries in GDB? Can you share a turtle file with a couple of features, so we can test?

              – Vladimir Alexiev
              Mar 14 at 9:15











            • Sorry for the late response. Yes, you understand right. My geometries have nothing to do with geo references. Imagine them as polygons or points in a XY coordinate system (see my previous answer). Unfortunately, I only tried the WKT literal representations since I am not aware of how to initialise my data with GML literals. I will now include an example instantiation in a following comment. Thank you @Vladimir for your help and time.

              – mriga
              Mar 18 at 13:36











            • In the following triples I represent a polygon and a point within it. When running GeoSPARQL (e.g. function geof:sfContains, or geof:sfWithin) through GraphDB, it returns no results.

              – mriga
              Mar 18 at 13:50












            • ex:polygon_ABCD rdf:type ex:ExampleEntity ; geo:hasGeometry ex:geometry_polygon_ABCD ; . ex:geometry_polygon_ABCD rdf:type geo:Geometry ; rdf:type sf:Polygon ; geo:asWKT "<opengis.net/def/cs/EPSG/0/4499> Polygon((389.0 1052.0, 563.0 1052.0, 563.0 1280.0, 389.0 1280.0, 389.0 1052.0))"^^geo:wktLiteral ; . ex:point_E rdf:type ex:ExampleEntity ; geo:hasGeometry ex:geometry_point_E ; . ex:geometry_point_E rdf:type geo:Geometry ; rdf:type sf:Point ; geo:asWKT "<opengis.net/def/cs/EPSG/0/4499> Point(400.0 1100.0)"^^geo:wktLiteral ; .

              – mriga
              Mar 18 at 13:51
















            Thank you @VladimirAlexiev for your reply! My aim is to infer spatial relations between objects detected by an object detection system. Objects are populated in an ontology, in a form of polygons, each point of which is projected in a X,Y Cartesian system. Axis have limits; x_min=0, x_max=1280, y_min=0, y_max=960. I've experimented with different CRSs: e.g. 4499 (opengis.net/def/cs/EPSG/0/4499), 4530, etc. However, none of the GeoSPARQL function (e.g. geof:sfTouches, geof:sfContains, etc.) return any result. So, is it really a GraphDB-CRS or a GeoSPARQL-CRS issue?

            – mriga
            Mar 13 at 13:04






            Thank you @VladimirAlexiev for your reply! My aim is to infer spatial relations between objects detected by an object detection system. Objects are populated in an ontology, in a form of polygons, each point of which is projected in a X,Y Cartesian system. Axis have limits; x_min=0, x_max=1280, y_min=0, y_max=960. I've experimented with different CRSs: e.g. 4499 (opengis.net/def/cs/EPSG/0/4499), 4530, etc. However, none of the GeoSPARQL function (e.g. geof:sfTouches, geof:sfContains, etc.) return any result. So, is it really a GraphDB-CRS or a GeoSPARQL-CRS issue?

            – mriga
            Mar 13 at 13:04














            If I understand correctly, your geometries are not fixed to a particular location on Earth. I checked CRS 4499, and if your coordinates are in meters, it should fill the bill. Given the previous answer: do you use GML literals to load your geometries in GDB? Can you share a turtle file with a couple of features, so we can test?

            – Vladimir Alexiev
            Mar 14 at 9:15





            If I understand correctly, your geometries are not fixed to a particular location on Earth. I checked CRS 4499, and if your coordinates are in meters, it should fill the bill. Given the previous answer: do you use GML literals to load your geometries in GDB? Can you share a turtle file with a couple of features, so we can test?

            – Vladimir Alexiev
            Mar 14 at 9:15













            Sorry for the late response. Yes, you understand right. My geometries have nothing to do with geo references. Imagine them as polygons or points in a XY coordinate system (see my previous answer). Unfortunately, I only tried the WKT literal representations since I am not aware of how to initialise my data with GML literals. I will now include an example instantiation in a following comment. Thank you @Vladimir for your help and time.

            – mriga
            Mar 18 at 13:36





            Sorry for the late response. Yes, you understand right. My geometries have nothing to do with geo references. Imagine them as polygons or points in a XY coordinate system (see my previous answer). Unfortunately, I only tried the WKT literal representations since I am not aware of how to initialise my data with GML literals. I will now include an example instantiation in a following comment. Thank you @Vladimir for your help and time.

            – mriga
            Mar 18 at 13:36













            In the following triples I represent a polygon and a point within it. When running GeoSPARQL (e.g. function geof:sfContains, or geof:sfWithin) through GraphDB, it returns no results.

            – mriga
            Mar 18 at 13:50






            In the following triples I represent a polygon and a point within it. When running GeoSPARQL (e.g. function geof:sfContains, or geof:sfWithin) through GraphDB, it returns no results.

            – mriga
            Mar 18 at 13:50














            ex:polygon_ABCD rdf:type ex:ExampleEntity ; geo:hasGeometry ex:geometry_polygon_ABCD ; . ex:geometry_polygon_ABCD rdf:type geo:Geometry ; rdf:type sf:Polygon ; geo:asWKT "<opengis.net/def/cs/EPSG/0/4499> Polygon((389.0 1052.0, 563.0 1052.0, 563.0 1280.0, 389.0 1280.0, 389.0 1052.0))"^^geo:wktLiteral ; . ex:point_E rdf:type ex:ExampleEntity ; geo:hasGeometry ex:geometry_point_E ; . ex:geometry_point_E rdf:type geo:Geometry ; rdf:type sf:Point ; geo:asWKT "<opengis.net/def/cs/EPSG/0/4499> Point(400.0 1100.0)"^^geo:wktLiteral ; .

            – mriga
            Mar 18 at 13:51





            ex:polygon_ABCD rdf:type ex:ExampleEntity ; geo:hasGeometry ex:geometry_polygon_ABCD ; . ex:geometry_polygon_ABCD rdf:type geo:Geometry ; rdf:type sf:Polygon ; geo:asWKT "<opengis.net/def/cs/EPSG/0/4499> Polygon((389.0 1052.0, 563.0 1052.0, 563.0 1280.0, 389.0 1280.0, 389.0 1052.0))"^^geo:wktLiteral ; . ex:point_E rdf:type ex:ExampleEntity ; geo:hasGeometry ex:geometry_point_E ; . ex:geometry_point_E rdf:type geo:Geometry ; rdf:type sf:Point ; geo:asWKT "<opengis.net/def/cs/EPSG/0/4499> Point(400.0 1100.0)"^^geo:wktLiteral ; .

            – mriga
            Mar 18 at 13:51













            0














            Your example, slightly reformatted, and using normal turtle shortenings:



            ex:polygon_ABCD rdf:type ex:ExampleEntity ;
            geo:hasGeometry ex:geometry_polygon_ABCD .

            ex:geometry_polygon_ABCD a geo:Geometry, sf:Polygon ;
            geo:asWKT "<opengis.net/def/cs/EPSG/0/4499> Polygon((389.0 1052.0, 563.0 1052.0, 563.0 1280.0, 389.0 1280.0, 389.0 1052.0))"^^geo:wktLiteral .

            ex:point_E rdf:type ex:ExampleEntity ;
            geo:hasGeometry ex:geometry_point_E .

            ex:geometry_point_E a geo:Geometry, sf:Point ;
            geo:asWKT "<opengis.net/def/cs/EPSG/0/4499> Point(400.0 1100.0)"^^geo:wktLiteral ; .


            You must use a specific URL for the CRS and cannot omit http:, so the correct URL is http://www.opengis.net/def/crs/EPSG/0/4499.



            But you can see from the returned description that this CRS is applocable to "China - onshore and offshore between 120°E and 126°E". I'm not an expert in geo projections so I can't guarantee whether this CRS will satisfy your need "leave my coordinates alone, they are just meters". I'd look for a UK (OrdnanceSurvey) CRS with easting and northing coordinates.



            To learn how to format GML:



            • see the GeoSPARQL spec (OGC 11-052r4) p18, whchc gives an example about gml:Point.

            • then google for gml:Polygon. There are many links but one that gives examples is http://www.georss.org/gml.html

            Armed with this knowledge, we can reformat your example to GML:



            ex:polygon_ABCD rdf:type ex:ExampleEntity ;
            geo:hasGeometry ex:geometry_polygon_ABCD .

            ex:geometry_polygon_ABCD a geo:Geometry, sf:Polygon ;
            geo:asGML """
            <gml:Polygon xmlns:gml="http://www.opengis.net/gml" srsName="http://www.opengis.net/def/crs/EPSG/0/TODO">
            <gml:exterior>
            <gml:LinearRing>
            <gml:posList>
            389.0 1052.0, 563.0 1052.0, 563.0 1280.0, 389.0 1280.0, 389.0 1052.0
            </gml:posList>
            </gml:LinearRing>
            </gml:exterior>
            </gml:Polygon>
            """^^geo:gmlLiteral.

            ex:point_E rdf:type ex:ExampleEntity ;
            geo:hasGeometry ex:geometry_point_E .

            ex:geometry_point_E a geo:Geometry, sf:Point ;
            geo:asGML """
            <gml:Point xmlns:gml="http://www.opengis.net/gml" srsName="http://www.opengis.net/def/crs/EPSG/0/TODO">
            <gml:pos>
            400.0 1100.0
            </gml:pos>
            </gml:Point>
            """^^geo:gmlLiteral.


            • The """ (long quote) allows us to use " inside the literal without quoting

            • replace TODO with the better CRS you picked

            • the documentation http://graphdb.ontotext.com/documentation/master/enterprise/geosparql-support.html#geosparql-examples gives an example similar to yours but it cheats a bit because all coordinates are in the range (-90,+90) so it can just use WGS.

            • after you debug using geof: topology functions, turn on indexing and switch to geo: predicates, because the functions are slow (they check every geometry against every other) while the predicates use the special geo index

            Let me know how it goes!






            share|improve this answer





























              0














              Your example, slightly reformatted, and using normal turtle shortenings:



              ex:polygon_ABCD rdf:type ex:ExampleEntity ;
              geo:hasGeometry ex:geometry_polygon_ABCD .

              ex:geometry_polygon_ABCD a geo:Geometry, sf:Polygon ;
              geo:asWKT "<opengis.net/def/cs/EPSG/0/4499> Polygon((389.0 1052.0, 563.0 1052.0, 563.0 1280.0, 389.0 1280.0, 389.0 1052.0))"^^geo:wktLiteral .

              ex:point_E rdf:type ex:ExampleEntity ;
              geo:hasGeometry ex:geometry_point_E .

              ex:geometry_point_E a geo:Geometry, sf:Point ;
              geo:asWKT "<opengis.net/def/cs/EPSG/0/4499> Point(400.0 1100.0)"^^geo:wktLiteral ; .


              You must use a specific URL for the CRS and cannot omit http:, so the correct URL is http://www.opengis.net/def/crs/EPSG/0/4499.



              But you can see from the returned description that this CRS is applocable to "China - onshore and offshore between 120°E and 126°E". I'm not an expert in geo projections so I can't guarantee whether this CRS will satisfy your need "leave my coordinates alone, they are just meters". I'd look for a UK (OrdnanceSurvey) CRS with easting and northing coordinates.



              To learn how to format GML:



              • see the GeoSPARQL spec (OGC 11-052r4) p18, whchc gives an example about gml:Point.

              • then google for gml:Polygon. There are many links but one that gives examples is http://www.georss.org/gml.html

              Armed with this knowledge, we can reformat your example to GML:



              ex:polygon_ABCD rdf:type ex:ExampleEntity ;
              geo:hasGeometry ex:geometry_polygon_ABCD .

              ex:geometry_polygon_ABCD a geo:Geometry, sf:Polygon ;
              geo:asGML """
              <gml:Polygon xmlns:gml="http://www.opengis.net/gml" srsName="http://www.opengis.net/def/crs/EPSG/0/TODO">
              <gml:exterior>
              <gml:LinearRing>
              <gml:posList>
              389.0 1052.0, 563.0 1052.0, 563.0 1280.0, 389.0 1280.0, 389.0 1052.0
              </gml:posList>
              </gml:LinearRing>
              </gml:exterior>
              </gml:Polygon>
              """^^geo:gmlLiteral.

              ex:point_E rdf:type ex:ExampleEntity ;
              geo:hasGeometry ex:geometry_point_E .

              ex:geometry_point_E a geo:Geometry, sf:Point ;
              geo:asGML """
              <gml:Point xmlns:gml="http://www.opengis.net/gml" srsName="http://www.opengis.net/def/crs/EPSG/0/TODO">
              <gml:pos>
              400.0 1100.0
              </gml:pos>
              </gml:Point>
              """^^geo:gmlLiteral.


              • The """ (long quote) allows us to use " inside the literal without quoting

              • replace TODO with the better CRS you picked

              • the documentation http://graphdb.ontotext.com/documentation/master/enterprise/geosparql-support.html#geosparql-examples gives an example similar to yours but it cheats a bit because all coordinates are in the range (-90,+90) so it can just use WGS.

              • after you debug using geof: topology functions, turn on indexing and switch to geo: predicates, because the functions are slow (they check every geometry against every other) while the predicates use the special geo index

              Let me know how it goes!






              share|improve this answer



























                0












                0








                0







                Your example, slightly reformatted, and using normal turtle shortenings:



                ex:polygon_ABCD rdf:type ex:ExampleEntity ;
                geo:hasGeometry ex:geometry_polygon_ABCD .

                ex:geometry_polygon_ABCD a geo:Geometry, sf:Polygon ;
                geo:asWKT "<opengis.net/def/cs/EPSG/0/4499> Polygon((389.0 1052.0, 563.0 1052.0, 563.0 1280.0, 389.0 1280.0, 389.0 1052.0))"^^geo:wktLiteral .

                ex:point_E rdf:type ex:ExampleEntity ;
                geo:hasGeometry ex:geometry_point_E .

                ex:geometry_point_E a geo:Geometry, sf:Point ;
                geo:asWKT "<opengis.net/def/cs/EPSG/0/4499> Point(400.0 1100.0)"^^geo:wktLiteral ; .


                You must use a specific URL for the CRS and cannot omit http:, so the correct URL is http://www.opengis.net/def/crs/EPSG/0/4499.



                But you can see from the returned description that this CRS is applocable to "China - onshore and offshore between 120°E and 126°E". I'm not an expert in geo projections so I can't guarantee whether this CRS will satisfy your need "leave my coordinates alone, they are just meters". I'd look for a UK (OrdnanceSurvey) CRS with easting and northing coordinates.



                To learn how to format GML:



                • see the GeoSPARQL spec (OGC 11-052r4) p18, whchc gives an example about gml:Point.

                • then google for gml:Polygon. There are many links but one that gives examples is http://www.georss.org/gml.html

                Armed with this knowledge, we can reformat your example to GML:



                ex:polygon_ABCD rdf:type ex:ExampleEntity ;
                geo:hasGeometry ex:geometry_polygon_ABCD .

                ex:geometry_polygon_ABCD a geo:Geometry, sf:Polygon ;
                geo:asGML """
                <gml:Polygon xmlns:gml="http://www.opengis.net/gml" srsName="http://www.opengis.net/def/crs/EPSG/0/TODO">
                <gml:exterior>
                <gml:LinearRing>
                <gml:posList>
                389.0 1052.0, 563.0 1052.0, 563.0 1280.0, 389.0 1280.0, 389.0 1052.0
                </gml:posList>
                </gml:LinearRing>
                </gml:exterior>
                </gml:Polygon>
                """^^geo:gmlLiteral.

                ex:point_E rdf:type ex:ExampleEntity ;
                geo:hasGeometry ex:geometry_point_E .

                ex:geometry_point_E a geo:Geometry, sf:Point ;
                geo:asGML """
                <gml:Point xmlns:gml="http://www.opengis.net/gml" srsName="http://www.opengis.net/def/crs/EPSG/0/TODO">
                <gml:pos>
                400.0 1100.0
                </gml:pos>
                </gml:Point>
                """^^geo:gmlLiteral.


                • The """ (long quote) allows us to use " inside the literal without quoting

                • replace TODO with the better CRS you picked

                • the documentation http://graphdb.ontotext.com/documentation/master/enterprise/geosparql-support.html#geosparql-examples gives an example similar to yours but it cheats a bit because all coordinates are in the range (-90,+90) so it can just use WGS.

                • after you debug using geof: topology functions, turn on indexing and switch to geo: predicates, because the functions are slow (they check every geometry against every other) while the predicates use the special geo index

                Let me know how it goes!






                share|improve this answer















                Your example, slightly reformatted, and using normal turtle shortenings:



                ex:polygon_ABCD rdf:type ex:ExampleEntity ;
                geo:hasGeometry ex:geometry_polygon_ABCD .

                ex:geometry_polygon_ABCD a geo:Geometry, sf:Polygon ;
                geo:asWKT "<opengis.net/def/cs/EPSG/0/4499> Polygon((389.0 1052.0, 563.0 1052.0, 563.0 1280.0, 389.0 1280.0, 389.0 1052.0))"^^geo:wktLiteral .

                ex:point_E rdf:type ex:ExampleEntity ;
                geo:hasGeometry ex:geometry_point_E .

                ex:geometry_point_E a geo:Geometry, sf:Point ;
                geo:asWKT "<opengis.net/def/cs/EPSG/0/4499> Point(400.0 1100.0)"^^geo:wktLiteral ; .


                You must use a specific URL for the CRS and cannot omit http:, so the correct URL is http://www.opengis.net/def/crs/EPSG/0/4499.



                But you can see from the returned description that this CRS is applocable to "China - onshore and offshore between 120°E and 126°E". I'm not an expert in geo projections so I can't guarantee whether this CRS will satisfy your need "leave my coordinates alone, they are just meters". I'd look for a UK (OrdnanceSurvey) CRS with easting and northing coordinates.



                To learn how to format GML:



                • see the GeoSPARQL spec (OGC 11-052r4) p18, whchc gives an example about gml:Point.

                • then google for gml:Polygon. There are many links but one that gives examples is http://www.georss.org/gml.html

                Armed with this knowledge, we can reformat your example to GML:



                ex:polygon_ABCD rdf:type ex:ExampleEntity ;
                geo:hasGeometry ex:geometry_polygon_ABCD .

                ex:geometry_polygon_ABCD a geo:Geometry, sf:Polygon ;
                geo:asGML """
                <gml:Polygon xmlns:gml="http://www.opengis.net/gml" srsName="http://www.opengis.net/def/crs/EPSG/0/TODO">
                <gml:exterior>
                <gml:LinearRing>
                <gml:posList>
                389.0 1052.0, 563.0 1052.0, 563.0 1280.0, 389.0 1280.0, 389.0 1052.0
                </gml:posList>
                </gml:LinearRing>
                </gml:exterior>
                </gml:Polygon>
                """^^geo:gmlLiteral.

                ex:point_E rdf:type ex:ExampleEntity ;
                geo:hasGeometry ex:geometry_point_E .

                ex:geometry_point_E a geo:Geometry, sf:Point ;
                geo:asGML """
                <gml:Point xmlns:gml="http://www.opengis.net/gml" srsName="http://www.opengis.net/def/crs/EPSG/0/TODO">
                <gml:pos>
                400.0 1100.0
                </gml:pos>
                </gml:Point>
                """^^geo:gmlLiteral.


                • The """ (long quote) allows us to use " inside the literal without quoting

                • replace TODO with the better CRS you picked

                • the documentation http://graphdb.ontotext.com/documentation/master/enterprise/geosparql-support.html#geosparql-examples gives an example similar to yours but it cheats a bit because all coordinates are in the range (-90,+90) so it can just use WGS.

                • after you debug using geof: topology functions, turn on indexing and switch to geo: predicates, because the functions are slow (they check every geometry against every other) while the predicates use the special geo index

                Let me know how it goes!







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Mar 20 at 13:08

























                answered Mar 20 at 13:02









                Vladimir AlexievVladimir Alexiev

                1,29911123




                1,29911123



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55060508%2fgeosparql-functions-and-spatial-reference-systems-srs%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

                    Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

                    Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved