Ullah, Izhar
2017-03-10 01:03:30 UTC
Hi all,
I have a question related to SPARQL query which is a bit complex one. I would appreciate if someone could help me out. I have developed an ontology in Protege in which I have imported the GeoSPARQL Ontology. I have 15 Sensing Nodes with their corresponding Point(longitude latitude) geometries given below:
Table 1: Showing results from 1 to 15 of 15. Query took 0.127 s.
node
geo
gwkt
1
enviot:A0_SoilSensingNode<http://localhost:7200/resource/enviot/A0_SoilSensingNode>
enviot:A0_Geometry<http://localhost:7200/resource/enviot/A0_Geometry>
"POINT(-3.783065 53.202158)"^^<http://www.opengis.net/ont/geosparql#wktLiteral>
2
enviot:A1_SoilSensingNode<http://localhost:7200/resource/enviot/A1_SoilSensingNode>
enviot:A1_Geometry<http://localhost:7200/resource/enviot/A1_Geometry>
"POINT(-3.782898 53.201828)"^^<http://www.opengis.net/ont/geosparql#wktLiteral>
3
enviot:A2_SoilSensingNode<http://localhost:7200/resource/enviot/A2_SoilSensingNode>
enviot:A2_Geometry<http://localhost:7200/resource/enviot/A2_Geometry>
"POINT(-3.783092 53.202007)"^^<http://www.opengis.net/ont/geosparql#wktLiteral>
4
enviot:A3_SoilSensingNode<http://localhost:7200/resource/enviot/A3_SoilSensingNode>
enviot:A3_Geometry<http://localhost:7200/resource/enviot/A3_Geometry>
"POINT(-3.781964 53.201765)"^^<http://www.opengis.net/ont/geosparql#wktLiteral>
5
enviot:A5_SoilSensingNode<http://localhost:7200/resource/enviot/A5_SoilSensingNode>
enviot:A5_Geometry<http://localhost:7200/resource/enviot/A5_Geometry>
"POINT(-3.783055 53.202777)"^^<http://www.opengis.net/ont/geosparql#wktLiteral>
6
enviot:A6_SoilSensingNode<http://localhost:7200/resource/enviot/A6_SoilSensingNode>
enviot:A6_Geometry<http://localhost:7200/resource/enviot/A6_Geometry>
"POINT(-3.782222 53.202777)"^^<http://www.opengis.net/ont/geosparql#wktLiteral>
7
enviot:A7_SoilSensingNode<http://localhost:7200/resource/enviot/A7_SoilSensingNode>
enviot:A7_Geometry<http://localhost:7200/resource/enviot/A7_Geometry>
"POINT(-3.781111 53.202777)"^^<http://www.opengis.net/ont/geosparql#wktLiteral>
8
enviot:A8_SoilSensingNode<http://localhost:7200/resource/enviot/A8_SoilSensingNode>
enviot:A8_Geometry<http://localhost:7200/resource/enviot/A8_Geometry>
"POINT(-3.780833 53.203055)"^^<http://www.opengis.net/ont/geosparql#wktLiteral>
9
enviot:A9_SoilSensingNode<http://localhost:7200/resource/enviot/A9_SoilSensingNode>
enviot:A9_Geometry<http://localhost:7200/resource/enviot/A9_Geometry>
"POINT(-3.780833 53.202222)"^^<http://www.opengis.net/ont/geosparql#wktLiteral>
10
enviot:AA_SoilSensingNode<http://localhost:7200/resource/enviot/AA_SoilSensingNode>
enviot:AA_Geometry<http://localhost:7200/resource/enviot/AA_Geometry>
"POINT(-3.783063 53.202309)"^^<http://www.opengis.net/ont/geosparql#wktLiteral>
11
enviot:AB_SoilSensingNode<http://localhost:7200/resource/enviot/AB_SoilSensingNode>
enviot:AB_Geometry<http://localhost:7200/resource/enviot/AB_Geometry>
"POINT(-3.782638 53.202189)"^^<http://www.opengis.net/ont/geosparql#wktLiteral>
12
enviot:AC_SoilSensingNode<http://localhost:7200/resource/enviot/AC_SoilSensingNode>
enviot:AC_Geometry<http://localhost:7200/resource/enviot/AC_Geometry>
"POINT(-3.783003 53.202191)"^^<http://www.opengis.net/ont/geosparql#wktLiteral>
13
enviot:AD_SoilSensingNode<http://localhost:7200/resource/enviot/AD_SoilSensingNode>
enviot:AD_Geometry<http://localhost:7200/resource/enviot/AD_Geometry>
"POINT(-3.782518 53.201841)"^^<http://www.opengis.net/ont/geosparql#wktLiteral>
14
enviot:AE_SoilSensingNode<http://localhost:7200/resource/enviot/AE_SoilSensingNode>
enviot:AE_Geometry<http://localhost:7200/resource/enviot/AE_Geometry>
"POINT(-3.782024 53.202193)"^^<http://www.opengis.net/ont/geosparql#wktLiteral>
15
enviot:AF_SoilSensingNode<http://localhost:7200/resource/enviot/AF_SoilSensingNode>
enviot:AF_Geometry<http://localhost:7200/resource/enviot/AF_Geometry>
"POINT(-3.782877 53.201788)"^^<http://www.opengis.net/ont/geosparql#wktLiteral>
These sensing nodes are deployed in a field which is modelled in the GeoSPARQL ontologies as 'Field' which is the subClass of Feature. Further, 'Field' has got three sub-features which are modelled as sub-classes named Hilltop, Swale and Riverbank having their geometries like 'Line String', 'Polygon' and 'Line String' respectively along with their geometric coordinates given below:
Table 2: Showing results from 1 to 3 of 3. Query took 0.081 s.
feature
fgeo
fwkt
1
enviot:A_Hilltop<http://localhost:7200/resource/enviot/A_Hilltop>
enviot:A_HillTopLineGeometry<http://localhost:7200/resource/enviot/A_HillTopLineGeometry>
"LINESTRING(-3.780833 53.203055, -3.781111 53.202777, -3.780833 53.202222)"^^<http://www.opengis.net/ont/geosparql#wktLiteral>
2
enviot:A_Riverbank<http://localhost:7200/resource/enviot/A_Riverbank>
enviot:A_RiverbankLineGeometry<http://localhost:7200/resource/enviot/A_RiverbankLineGeometry>
"LINESTRING(-3.783055 53.202777, -3.783063 53.202309, -3.783065 53.202158, -3.783092 53.202007, -3.782898 53.201828)"^^<http://www.opengis.net/ont/geosparql#wktLiteral>
3
enviot:A_Swale<http://localhost:7200/resource/enviot/A_Swale>
enviot:A_SwalePolygonGeometry<http://localhost:7200/resource/enviot/A_SwalePolygonGeometry>
"POLYGON((-3.782222 53.202777, -3.782024 53.202193, -3.782638 53.202189, -3.783003 53.202191, -3.781964 53.201765, -3.782518 53.201841, -3.782877 53.201788, -3.782222 53.202777))"^^<http://www.opengis.net/ont/geosparql#wktLiteral>
I
NOTE: In the above table (Table 2), the column 'fwkt' has got exactly the same geometry values (Point(long lat) which are the geometry values of individual soil sensing nodes given in column named 'gwkt' in Table 1.
Now my question is:
Which geographic feature contains the maximum number of soil sensing nodes?
The query/answer should retrieve envoi:A_Swale which has 7 soil sensing nodes.
I would be really grateful if someone could give me any idea/solution how to retrieve this?
If you require any further information please let me know.
Many thanks in advance.
Best regards,
Izhar
I have a question related to SPARQL query which is a bit complex one. I would appreciate if someone could help me out. I have developed an ontology in Protege in which I have imported the GeoSPARQL Ontology. I have 15 Sensing Nodes with their corresponding Point(longitude latitude) geometries given below:
Table 1: Showing results from 1 to 15 of 15. Query took 0.127 s.
node
geo
gwkt
1
enviot:A0_SoilSensingNode<http://localhost:7200/resource/enviot/A0_SoilSensingNode>
enviot:A0_Geometry<http://localhost:7200/resource/enviot/A0_Geometry>
"POINT(-3.783065 53.202158)"^^<http://www.opengis.net/ont/geosparql#wktLiteral>
2
enviot:A1_SoilSensingNode<http://localhost:7200/resource/enviot/A1_SoilSensingNode>
enviot:A1_Geometry<http://localhost:7200/resource/enviot/A1_Geometry>
"POINT(-3.782898 53.201828)"^^<http://www.opengis.net/ont/geosparql#wktLiteral>
3
enviot:A2_SoilSensingNode<http://localhost:7200/resource/enviot/A2_SoilSensingNode>
enviot:A2_Geometry<http://localhost:7200/resource/enviot/A2_Geometry>
"POINT(-3.783092 53.202007)"^^<http://www.opengis.net/ont/geosparql#wktLiteral>
4
enviot:A3_SoilSensingNode<http://localhost:7200/resource/enviot/A3_SoilSensingNode>
enviot:A3_Geometry<http://localhost:7200/resource/enviot/A3_Geometry>
"POINT(-3.781964 53.201765)"^^<http://www.opengis.net/ont/geosparql#wktLiteral>
5
enviot:A5_SoilSensingNode<http://localhost:7200/resource/enviot/A5_SoilSensingNode>
enviot:A5_Geometry<http://localhost:7200/resource/enviot/A5_Geometry>
"POINT(-3.783055 53.202777)"^^<http://www.opengis.net/ont/geosparql#wktLiteral>
6
enviot:A6_SoilSensingNode<http://localhost:7200/resource/enviot/A6_SoilSensingNode>
enviot:A6_Geometry<http://localhost:7200/resource/enviot/A6_Geometry>
"POINT(-3.782222 53.202777)"^^<http://www.opengis.net/ont/geosparql#wktLiteral>
7
enviot:A7_SoilSensingNode<http://localhost:7200/resource/enviot/A7_SoilSensingNode>
enviot:A7_Geometry<http://localhost:7200/resource/enviot/A7_Geometry>
"POINT(-3.781111 53.202777)"^^<http://www.opengis.net/ont/geosparql#wktLiteral>
8
enviot:A8_SoilSensingNode<http://localhost:7200/resource/enviot/A8_SoilSensingNode>
enviot:A8_Geometry<http://localhost:7200/resource/enviot/A8_Geometry>
"POINT(-3.780833 53.203055)"^^<http://www.opengis.net/ont/geosparql#wktLiteral>
9
enviot:A9_SoilSensingNode<http://localhost:7200/resource/enviot/A9_SoilSensingNode>
enviot:A9_Geometry<http://localhost:7200/resource/enviot/A9_Geometry>
"POINT(-3.780833 53.202222)"^^<http://www.opengis.net/ont/geosparql#wktLiteral>
10
enviot:AA_SoilSensingNode<http://localhost:7200/resource/enviot/AA_SoilSensingNode>
enviot:AA_Geometry<http://localhost:7200/resource/enviot/AA_Geometry>
"POINT(-3.783063 53.202309)"^^<http://www.opengis.net/ont/geosparql#wktLiteral>
11
enviot:AB_SoilSensingNode<http://localhost:7200/resource/enviot/AB_SoilSensingNode>
enviot:AB_Geometry<http://localhost:7200/resource/enviot/AB_Geometry>
"POINT(-3.782638 53.202189)"^^<http://www.opengis.net/ont/geosparql#wktLiteral>
12
enviot:AC_SoilSensingNode<http://localhost:7200/resource/enviot/AC_SoilSensingNode>
enviot:AC_Geometry<http://localhost:7200/resource/enviot/AC_Geometry>
"POINT(-3.783003 53.202191)"^^<http://www.opengis.net/ont/geosparql#wktLiteral>
13
enviot:AD_SoilSensingNode<http://localhost:7200/resource/enviot/AD_SoilSensingNode>
enviot:AD_Geometry<http://localhost:7200/resource/enviot/AD_Geometry>
"POINT(-3.782518 53.201841)"^^<http://www.opengis.net/ont/geosparql#wktLiteral>
14
enviot:AE_SoilSensingNode<http://localhost:7200/resource/enviot/AE_SoilSensingNode>
enviot:AE_Geometry<http://localhost:7200/resource/enviot/AE_Geometry>
"POINT(-3.782024 53.202193)"^^<http://www.opengis.net/ont/geosparql#wktLiteral>
15
enviot:AF_SoilSensingNode<http://localhost:7200/resource/enviot/AF_SoilSensingNode>
enviot:AF_Geometry<http://localhost:7200/resource/enviot/AF_Geometry>
"POINT(-3.782877 53.201788)"^^<http://www.opengis.net/ont/geosparql#wktLiteral>
These sensing nodes are deployed in a field which is modelled in the GeoSPARQL ontologies as 'Field' which is the subClass of Feature. Further, 'Field' has got three sub-features which are modelled as sub-classes named Hilltop, Swale and Riverbank having their geometries like 'Line String', 'Polygon' and 'Line String' respectively along with their geometric coordinates given below:
Table 2: Showing results from 1 to 3 of 3. Query took 0.081 s.
feature
fgeo
fwkt
1
enviot:A_Hilltop<http://localhost:7200/resource/enviot/A_Hilltop>
enviot:A_HillTopLineGeometry<http://localhost:7200/resource/enviot/A_HillTopLineGeometry>
"LINESTRING(-3.780833 53.203055, -3.781111 53.202777, -3.780833 53.202222)"^^<http://www.opengis.net/ont/geosparql#wktLiteral>
2
enviot:A_Riverbank<http://localhost:7200/resource/enviot/A_Riverbank>
enviot:A_RiverbankLineGeometry<http://localhost:7200/resource/enviot/A_RiverbankLineGeometry>
"LINESTRING(-3.783055 53.202777, -3.783063 53.202309, -3.783065 53.202158, -3.783092 53.202007, -3.782898 53.201828)"^^<http://www.opengis.net/ont/geosparql#wktLiteral>
3
enviot:A_Swale<http://localhost:7200/resource/enviot/A_Swale>
enviot:A_SwalePolygonGeometry<http://localhost:7200/resource/enviot/A_SwalePolygonGeometry>
"POLYGON((-3.782222 53.202777, -3.782024 53.202193, -3.782638 53.202189, -3.783003 53.202191, -3.781964 53.201765, -3.782518 53.201841, -3.782877 53.201788, -3.782222 53.202777))"^^<http://www.opengis.net/ont/geosparql#wktLiteral>
I
NOTE: In the above table (Table 2), the column 'fwkt' has got exactly the same geometry values (Point(long lat) which are the geometry values of individual soil sensing nodes given in column named 'gwkt' in Table 1.
Now my question is:
Which geographic feature contains the maximum number of soil sensing nodes?
The query/answer should retrieve envoi:A_Swale which has 7 soil sensing nodes.
I would be really grateful if someone could give me any idea/solution how to retrieve this?
If you require any further information please let me know.
Many thanks in advance.
Best regards,
Izhar