ThingIn supports the following Geo primitives for storing and querying :
Points
Polygons
Linestrings
MultiPoints
MultiPolygons
MultiLinestrings
Other primitives are not supported and will lead to an error/be rejected upoon indexing/querying.
ThingIn uses dedicated geo fields that share the namespace http://www.opengis.net/gml/
.
Geo fields are declared in the ThingIn metamodel ontology here
The complete list of fields is the following:
http://www.opengis.net/gml/pos
http://www.opengis.net/gml/pos/Polygon
http://www.opengis.net/gml/pos/Linestring
http://www.opengis.net/gml/pos/multiPoint
http://www.opengis.net/gml/pos/multiPolygon
http://www.opengis.net/gml/pos/multiLinestring
http://www.opengis.net/gml/pos/geopose
ThingIn also supports the following fields from the OGC geosparql standard:
http://www.opengis.net/ont/geosparql#asWKT
http://www.opengis.net/ont/geosparql#asGeoJSON
Additionnally, ThingIn use the following fields for indoor location (refer to the Other projections below for details):
http://orange-labs.fr/fog/ont/object-location.owl#locationPayload
http://orange-labs.fr/fog/ont/building.owl#localProjectedGeometry
Geospatial data management is based on the following standards: GeoJSON, NGSI-LD, OGC GeoPose, OGC WKT.
For querying, ThingIn defines several Geospatial operators (e.g. $geoWithin
, $distance
...). The full list operators and how to use them is described in the complete ThingIn query guide in the geo section.
Point exemple in JSON
[
{
"_iri" : "http://www.example.com/geojsonpoints/1",
"_classes" : ["http://purl.oclc.org/NET/ssnx/ssn#Device"],
"http://www.opengis.net/gml/pos" : {
"type": "Point",
"coordinates": [
-1.4702380494671632, 48.545218585
]
}
}
]
Polygon exemple in JSON
[
{
"_iri" : "http://www.example.com/geojsonsingletestspostman/singlepolygonex",
"_classes" : ["http://purl.oclc.org/NET/ssnx/ssn#Device"],
"http://www.opengis.net/gml/pos/polygon" : {
"type": "Polygon",
"coordinates": [
[
[102.0, 2.0],
[103.0, 2.0],
[103.0, 3.0],
[102.0, 3.0],
[102.0, 2.0]
]
]
}
}
]
GeometryCollection example in JSON
[
{
"_iri" : "http://www.example.com/geosparqlgeojson/geocollectionex",
"_classes" : ["http://purl.oclc.org/NET/ssnx/ssn#Device"],
"_labels": ["Vehicle"],
"http://www.opengis.net/ont/geosparql#asGeoJSON" : {
"type": "GeometryCollection",
"geometries": [
{
"type": "Polygon",
"coordinates": [
[
[102.0, 2.0],
[103.0, 2.0],
[103.0, 3.0],
[102.0, 3.0],
[102.0, 2.0]
]
]
},
{
"type": "Point",
"coordinates": [
102.0,
2.0
]
}
]
}
}
]
MultiPolygon/MultiLineString/MultiPoint Example in JSON
[
{
"_iri" : "http://www.example.com/geojsonmultitestspostman/multipolygonex",
"_classes" : ["http://purl.oclc.org/NET/ssnx/ssn#Device"],
"http://www.opengis.net/gml/pos/multiPolygon" : {
"type": "MultiPolygon",
"coordinates": [
[
[
[102.0, 2.0],
[103.0, 2.0],
[103.0, 3.0],
[102.0, 3.0],
[102.0, 2.0]
]
],
[
[
[100.0, 0.0],
[101.0, 0.0],
[101.0, 1.0],
[100.0, 1.0],
[100.0, 0.0]
],
[
[100.2, 0.2],
[100.2, 0.8],
[100.8, 0.8],
[100.8, 0.2],
[100.2, 0.2]
]
]
]
}
},
{
"_iri": "http://www.example.com/geojsonmultitestspostman/multilinestringex",
"_classes": [
"http://purl.oclc.org/NET/ssnx/ssn#Device"
],
"http://www.opengis.net/gml/pos/multiLinestring": {
"type": "MultiLineString",
"coordinates": [
[
[
100.0,
0.0
],
[
101.0,
1.0
]
],
[
[
102.0,
2.0
],
[
103.0,
3.0
]
]
]
}
},
{
"_iri" : "http://www.example.com/geojsonmultitestspostman/multipointexAllNotIn",
"_classes" : ["http://purl.oclc.org/NET/ssnx/ssn#Device"],
"http://www.opengis.net/gml/pos/multiPoint" : {
"type": "MultiPoint",
"coordinates": [
[110.0, 8.0],
[104.0, 4.0]
]
}
}
]
Using the AsGeoJSON generic field:
[
{
"_iri" : "http://www.example.com/geosparqlgeojson/singlepolygonex",
"_classes" : ["http://purl.oclc.org/NET/ssnx/ssn#Device"],
"http://www.opengis.net/ont/geosparql#asGeoJSON" : {
"type": "Polygon",
"coordinates": [
[
[102.0, 2.0],
[103.0, 2.0],
[103.0, 3.0],
[102.0, 3.0],
[102.0, 2.0]
]
]
}
}
]
Using the AsWKT generic field:
[
{
"_iri" : "http://www.example.com/geosparqlgeojson/WKTvalid",
"_classes" : ["http://purl.oclc.org/NET/ssnx/ssn#Device"],
"http://www.opengis.net/ont/geosparql#asWKT" : "POLYGON ((-1.656487992167294 48.13228564984487,-1.655901160911369 48.1322975763691,-1.655612888937673 48.132302576144056,-1.655584431115057 48.13230306743954,-1.655357382707621 48.13230698711024,-1.655127593947627 48.132310953255654,-1.65499901227696 48.13231277776495,-1.654747020393441 48.13231635224493,-1.654426369120708 48.13232156900213,-1.65419958658813 48.132325257570436,-1.654109402207202 48.13232674392193,-1.653941279727201 48.13232943449821,-1.65387727831915 48.13233045874264,-1.653500991673835 48.13233712184984,-1.653413258045143 48.13233844003047,-1.653047456530393 48.13234393502008,-1.652616882892012 48.132349028359876,-1.652302857190617 48.13235274216895,-1.65219737923772 48.13235398955246,-1.652040525743177 48.13235623240531,-1.652031440693677 48.13225556481871,-1.652034260416904 48.13216749095112,-1.652022332290554 48.131820785234126,-1.652019885153629 48.131749640686564,-1.652007394195009 48.13138655404583,-1.652054051445725 48.13046577362013,-1.652092371922883 48.129524027409715,-1.652102766658808 48.12930531970807,-1.652100157967832 48.12889063266031,-1.652095363477787 48.12873527958165,-1.652069981500506 48.12860174468913,-1.65206042373263 48.12839676863186,-1.652058456227546 48.12817208139792,-1.652060028127017 48.12793463805806,-1.652059855610809 48.12776653192743,-1.65202089797711 48.12740080223082,-1.652391770715659 48.127249050381685,-1.654696634272774 48.1260090248277,-1.655087299012127 48.12579245875014,-1.655394521369016 48.12563107940283,-1.655647497903013 48.12551136122741,-1.655806451418253 48.12543842893578,-1.656693906766353 48.12507487688939,-1.657030318635844 48.1249178974965,-1.657633969403017 48.12462637985442,-1.657955645370152 48.12447170627534,-1.658048094958785 48.12442543212431,-1.658131132607848 48.12438521575367,-1.658842441535739 48.12404013307053,-1.658946378793119 48.12397951648469,-1.659618005711701 48.123524574953535,-1.659982415743143 48.12326958784834,-1.661257972186606 48.12251498002277,-1.661748991191531 48.122273236754076,-1.662340402271697 48.12198984709796,-1.662658362221943 48.1218375623597,-1.662726277900814 48.121787953636,-1.663565799868884 48.122370060093,-1.664074060043935 48.12271771328413,-1.664577881405443 48.12307572652729,-1.664955694444373 48.12333504648533,-1.66557988111916 48.123779721622306,-1.665847664151516 48.123968371801986,-1.667114260895566 48.12486064739777,-1.666746433089863 48.125150487607954,-1.666112000217933 48.125595132876676,-1.665953376112146 48.12576375953953,-1.665759177365523 48.126021142110744,-1.66543761547919 48.1265234634689,-1.665011518274481 48.12719140382446,-1.664864651282578 48.12742758194089,-1.664237345613475 48.12842088419879,-1.664195345969566 48.12848095720348,-1.664145490363711 48.12855226601302,-1.663893075771877 48.12886495510921,-1.663697574382537 48.12910713640272,-1.663634964332569 48.12919468919059,-1.663416568371625 48.129504492881765,-1.663304493984375 48.129663474005646,-1.663128369425709 48.12995840770492,-1.662916866567808 48.13031258094507,-1.662816636621425 48.13048041897027,-1.662744968433463 48.13059293545416,-1.662729342652277 48.130623870622436,-1.662574755760847 48.130929906083615,-1.662565117301547 48.13094898656353,-1.662403814783091 48.13119700073891,-1.662299931100461 48.13135672802866,-1.662095168000935 48.13167155967703,-1.661862289432283 48.132029614274714,-1.661731468743644 48.132025892845384,-1.661680327104876 48.13202658590377,-1.661457163836315 48.13202961143851,-1.660364385655543 48.13204441915916,-1.659280893849587 48.132059090834304,-1.659138569209064 48.132061521709225,-1.659120804209621 48.13206183308013,-1.658624796656237 48.13207052648565,-1.657945449122931 48.13208235924262,-1.657677067552307 48.13208755898108,-1.657305456681358 48.13209475711723,-1.656800952340713 48.13210879112275,-1.656753344167392 48.1321299424808,-1.656683510614108 48.132212812111526,-1.656676195587089 48.132220984368395,-1.656647573838568 48.132253200624504,-1.656615460679217 48.132273111929024,-1.656600109655024 48.13227642481689,-1.656555340071562 48.132288547029454,-1.656487992167294 48.13228564984487))"
}
]
WKT POINT and WKT POLYGON examples in RDF/TURTLE syntax
<http://www.example.com/TreesWKT/tree> a <http://purl.oclc.org/NET/ssnx/ssn#Device> .
<http://www.example.com/TreesWKT/tree> <http://www.opengis.net/ont/geosparql#asWKT> "POINT (-1.6591002 48.12774)"^^<http://www.opengis.net/ont/geosparql#wktLiteral> .
<http://www.example.com/TreesWKT/tree> <http://www.opengis.net/ont/geosparql#asWKT> "POLYGON ((-1.656487992167294 48.13228564984487,-1.655901160911369 48.1322975763691,-1.655612888937673 48.132302576144056,-1.655584431115057 48.13230306743954,-1.655357382707621 48.13230698711024,-1.655127593947627 48.132310953255654,-1.65499901227696 48.13231277776495,-1.654747020393441 48.13231635224493,-1.654426369120708 48.13232156900213,-1.65419958658813 48.132325257570436,-1.654109402207202 48.13232674392193,-1.653941279727201 48.13232943449821,-1.65387727831915 48.13233045874264,-1.653500991673835 48.13233712184984,-1.653413258045143 48.13233844003047,-1.653047456530393 48.13234393502008,-1.652616882892012 48.132349028359876,-1.652302857190617 48.13235274216895,-1.65219737923772 48.13235398955246,-1.652040525743177 48.13235623240531,-1.652031440693677 48.13225556481871,-1.652034260416904 48.13216749095112,-1.652022332290554 48.131820785234126,-1.652019885153629 48.131749640686564,-1.652007394195009 48.13138655404583,-1.652054051445725 48.13046577362013,-1.652092371922883 48.129524027409715,-1.652102766658808 48.12930531970807,-1.652100157967832 48.12889063266031,-1.652095363477787 48.12873527958165,-1.652069981500506 48.12860174468913,-1.65206042373263 48.12839676863186,-1.652058456227546 48.12817208139792,-1.652060028127017 48.12793463805806,-1.652059855610809 48.12776653192743,-1.65202089797711 48.12740080223082,-1.652391770715659 48.127249050381685,-1.654696634272774 48.1260090248277,-1.655087299012127 48.12579245875014,-1.655394521369016 48.12563107940283,-1.655647497903013 48.12551136122741,-1.655806451418253 48.12543842893578,-1.656693906766353 48.12507487688939,-1.657030318635844 48.1249178974965,-1.657633969403017 48.12462637985442,-1.657955645370152 48.12447170627534,-1.658048094958785 48.12442543212431,-1.658131132607848 48.12438521575367,-1.658842441535739 48.12404013307053,-1.658946378793119 48.12397951648469,-1.659618005711701 48.123524574953535,-1.659982415743143 48.12326958784834,-1.661257972186606 48.12251498002277,-1.661748991191531 48.122273236754076,-1.662340402271697 48.12198984709796,-1.662658362221943 48.1218375623597,-1.662726277900814 48.121787953636,-1.663565799868884 48.122370060093,-1.664074060043935 48.12271771328413,-1.664577881405443 48.12307572652729,-1.664955694444373 48.12333504648533,-1.66557988111916 48.123779721622306,-1.665847664151516 48.123968371801986,-1.667114260895566 48.12486064739777,-1.666746433089863 48.125150487607954,-1.666112000217933 48.125595132876676,-1.665953376112146 48.12576375953953,-1.665759177365523 48.126021142110744,-1.66543761547919 48.1265234634689,-1.665011518274481 48.12719140382446,-1.664864651282578 48.12742758194089,-1.664237345613475 48.12842088419879,-1.664195345969566 48.12848095720348,-1.664145490363711 48.12855226601302,-1.663893075771877 48.12886495510921,-1.663697574382537 48.12910713640272,-1.663634964332569 48.12919468919059,-1.663416568371625 48.129504492881765,-1.663304493984375 48.129663474005646,-1.663128369425709 48.12995840770492,-1.662916866567808 48.13031258094507,-1.662816636621425 48.13048041897027,-1.662744968433463 48.13059293545416,-1.662729342652277 48.130623870622436,-1.662574755760847 48.130929906083615,-1.662565117301547 48.13094898656353,-1.662403814783091 48.13119700073891,-1.662299931100461 48.13135672802866,-1.662095168000935 48.13167155967703,-1.661862289432283 48.132029614274714,-1.661731468743644 48.132025892845384,-1.661680327104876 48.13202658590377,-1.661457163836315 48.13202961143851,-1.660364385655543 48.13204441915916,-1.659280893849587 48.132059090834304,-1.659138569209064 48.132061521709225,-1.659120804209621 48.13206183308013,-1.658624796656237 48.13207052648565,-1.657945449122931 48.13208235924262,-1.657677067552307 48.13208755898108,-1.657305456681358 48.13209475711723,-1.656800952340713 48.13210879112275,-1.656753344167392 48.1321299424808,-1.656683510614108 48.132212812111526,-1.656676195587089 48.132220984368395,-1.656647573838568 48.132253200624504,-1.656615460679217 48.132273111929024,-1.656600109655024 48.13227642481689,-1.656555340071562 48.132288547029454,-1.656487992167294 48.13228564984487))"^^<http://www.opengis.net/ont/geosparql#wktLiteral> .
ThingIn will always output the Geospatial data using the
http://www.opengis.net/ont/geosparql#asGeoJSON
when spatial data is available regrouping all spatial primitives in a geometry collection.
Additionnally, each primitive will be outputted using its dedicated field.
Geofencing is enabled by default in ThingIn. The default behavior is to output the fencing information in the dedicated field http://elite.polito.it/ontologies/dogont.owl#isIn
, i.e. each primitive which is enclosed in another will induce this property to be added between the two corresponding enclosing/enclosed Twins.
Basic payload structure:
{
"http://www.opengis.net/gml/pos" : {
"$geoWithin" : {
"$geometry" : {
"type" : "Polygon",
"coordinates" : [[[120.0,8.0], [120.0,12.0], [130.0,12.0], [130.0,8.0]]]
}
}
}
}
Simplified payload with aliases example:
{
"query": [
{
"$alias":"Tree",
"$iri":"http://www.thingin.com/rennes/polygon/tree_17683"
},
{
"$domain": "http://www.thingin.com/rennes/polygon/",
"http://www.opengis.net/gml/pos/polygon": {
"$geoContains": {
"$alias":"Tree"
}
}
}
],
"view": {}
}
Additional payload examples are provided in the complete ThingIn query guide in the geo section.
On top of base GeoSpatial management, ThingIn can use the OGC GeoPose standard syntax to directly extract Geospatial information.
The following syntax is valid and allows to index the Geospatial data in lon
and lat
properties of the first sub JsonObject of the http://www.opengis.net/gml/pos/geopose
attribute(the other values are stored but not queryable directly):
[
{
"_iri" : "http://www.example.com/geopose/basicypr",
"_classes" : ["http://purl.oclc.org/NET/ssnx/ssn#Device"],
"http://www.opengis.net/gml/pos/geopose" : {
"position": {
"lat": 47.7,
"lon": -122.3,
"h": 11.5
},
"angles": {
"yaw": 5.514456741060452,
"pitch": -0.43610515937237904,
"roll": 0.0
}
}
}
]
ThingIn does not support 3D queries. However it is entirely capable of storing 3D and even displaying 3D data using Blobs as a storage backend. Please refer to the Blob and 3D Viewer references for this use case.
Alternatively, ThingIn is of course capable of running 2.5D (2D+floor) queries using a combination of Geospatial filters and property filtering.
Please refer to the conversion documentation