Changes for page kg-spatial-search
Last modified by oschmid on 2023/08/22 11:23
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -29,48 +29,12 @@ 29 29 Simply use the API endpoint at [[https:~~/~~/spatial.kg.ebrains.eu/api/>>https://spatial.kg.ebrains.eu/api/]] by running queries according to the following examples: 30 30 31 31 32 -=== Get started: Query by a "bounding box" (hyperrectangle) === 33 33 34 -{{code language="bash" layout="LINENUMBERS"}} 35 -curl -X 'POST' \ 36 - 'https://spatial.kg.ebrains.eu/spatial-search/cores/ebrains/spatial_objects' \ 37 - -H 'accept: application/json' \ 38 - -H 'Content-Type: application/json' \ 39 - -d '{ 40 - "filters": "inside(hyperrectangle{[50.0,146.0,227.0], [51.0, 149.0, 228.0], \"AMB-CCF_v3-RAS\"})" 41 -}' 42 -{{/code}} 43 43 44 - As youcan see,you'resendingaPOSTrequestto theendpointat**https:~/~/spatial.kg.ebrains.eu/spatial-search/cores/ebrains/spatial_objects**withapayloaddefiningageometry ofinterest. Inthis case, we'relookingfor all objects thatare **inside **a **hyperrectangle**definedbyitslowestandhighestointin thecoordinate systemofthecoordinatespace**AMB-CCF_v3-RAS**.This query willreturnyou anarrayof idsof theobjectsocatedwithinhegeometrywhich youthen can useto conveniently query theKGeitherthroughthe[[InstanceAPI>>https://core.kg.ebrains.eu/swagger-ui/index.html#/2%20Advanced/getInstancesByIds]]or the[[QueryAPI>>https://core.kg.ebrains.eu/swagger-ui/index.html#/1%20Basic/runDynamicQuery]] toaccess detailed metainformation.34 +Theoretically, all data which is anchored in their respective coordinate space can be registered in the KG Spatial Search. We currently provide ingestion pipelines for data annotated with the[[ locareJSON format>>https://github.com/blixilla/LocareJSON]]. Please note that complex, planar and volumetric geometries such as polyhedrons, spheres, etc. are translated into point clouds of a configurable density during the ingestion process to ensure better performance at query time for the cost for potential false-negatives in highly fine-granular queries. 45 45 46 46 47 -=== Query by hypersphere === 48 48 49 -Alongside the possibility to use hyperrectangles for querying the spatial search, you can also use hyperspheres: 50 - 51 -{{code language="javascript" layout="LINENUMBERS"}} 52 -{ 53 - "filters": "inside(hypersphere{[50.0,146.0,227.0], 2, \"AMB-CCF_v3-RAS\"})" 54 -} 55 -{{/code}} 56 - 57 -It is defined by the center of the sphere with its coordinates, the radius in coordinate units and the coordinate space of the given coordinates (in this case again AMB-CCF_v3-RAS) 58 - 59 - 60 - 61 -=== Advanced use: Union geometries for complex queries === 62 - 63 -To build arbitrarily complex geometries, it is possible to combine hyperrectangles and hyperspheres via (nested) unions: 64 - 65 -{{code language="javascript" layout="LINENUMBERS"}} 66 -{ 67 - "filters": "union(union(inside(hyperrectangle{[50.0,146.0,227.0], [51.0, 149.0, 228.0], \"AMB-CCF_v3-RAS\"}), inside(hyperrectangle{[120.0,146.0,227.0], [150.0, 180.0, 300.0], \"AMB-CCF_v3-RAS\"})),inside(hypersphere{[50.0,146.0,227.0], 2, \"AMB-CCF_v3-RAS\"}))" 68 -} 69 -{{/code}} 70 - 71 - 72 - 73 - 74 74 75 75 ))) 76 76