File: README.GeoSPARQL.md

package info (click to toggle)
virtuoso-opensource 7.2.12%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 299,308 kB
  • sloc: ansic: 655,054; sql: 508,209; xml: 269,573; java: 84,064; javascript: 79,847; cpp: 37,662; sh: 32,429; cs: 25,702; php: 12,690; yacc: 11,666; lex: 7,933; makefile: 7,308; jsp: 4,523; awk: 1,719; perl: 1,013; ruby: 1,003; python: 326
file content (247 lines) | stat: -rw-r--r-- 11,291 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
# Virtuoso GeoSPARQL support

_Copyright (C) 2018-2024 OpenLink Software_

## Introduction
Release 7.2.6 marked the addition of GeoSPARQL function support to Virtuoso Open Source Edition,
with additional enhancements in subsequent versions.

Besides a number of enhancements to the core Virtuoso engine, OpenLink added three plugins that
extend Virtuoso's functionality:

* `proj4`
* `geos`
* `shapefileio`


## Requirements

The `proj4` and `geos` plugins can only be built against very specific versions of third party 
libraries, which may not be available on every OS distribution, so will probably need to be 
built by you prior to building Virtuoso.
```pre
Package         Version         From
-------         -------         ---------------------------
proj            4.9.3           https://proj4.org
geo             3.5.1           https://www.osgeo.org/geos/
```
The new plugins are automatically added to the build process if the third party libraries and 
header files are found when running the `configure` tool.

The following new options have been added:
```pre
$ ./configure --help
...
...
--enable-proj4(=DIR)    enable the proj4 plugin (default)
--disable-proj4         disable the proj4 plugin
--enable-geos(=DIR)     enable the geos plugin (default)
--disable-geos          disable the geos plugin
--enable-shapefileio(=DIR)
                        enable the shapefileio plugin (default)
--disable-shapefileio   disable the shapefileio plugin
...
```

OpenLink provides pre-built binary releases of Virtuoso Open Source edition for a number of platforms
including Linux, macOS, and Windows.


## New Plugins

### The `proj4` plugin

The `proj4` plugin adds an interface between the Virtuoso engine and the 
[__`PROJ`__ library](https://proj4.org) currently maintained by Frank Warmerdam et al.

This plugin adds support for transforming geospatial coordinates from one coordinate 
reference system (CRS) to another, including both cartographic projections and geodetic
transformations.

The `proj4` plugin currently requires __`v4.9.3`__ of the library, which can be 
[downloaded here](https://download.osgeo.org/proj/proj-4.9.3.tar.gz).

The `PROJ` library uses the following license:
```
All source, data files and other contents of the PROJ.4 package are
available under the following terms.  Note that the PROJ 4.3 and earlier
was "public domain" as is common with US government work, but apparently
this is not a well defined legal term in many countries.  I am placing
everything under the following MIT style license because I believe it is
effectively the same as public domain, allowing anyone to use the code as
they wish, including making proprietary derivatives.

Though I have put my own name as copyright holder, I don't mean to imply
I did the work.  Essentially all work was done by Gerald Evenden.

--------------

Copyright (c) 2000, Frank Warmerdam

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
```

### The `geos` plugin

The `geos` plugin adds an interface between the Virtuoso engine and the 
[__`GEOS`__ library](https://www.osgeo.org/projects/geos/) currently 
maintained by the Open Source Geospatial Foundation.

According to their website:

> `GEOS` (Geometry Engine - Open Source) is a C++ port of the Topology Suite (JTS). As such, it aims
> to contain the complete functionality of JTS in C++. This includes all the GIS Simple Features for
> SQL spatial predicate functions and spatial operators, as well as specific JTS enhanced topology
> functions.

This plugin adds support for GeoSPARQL functions to the Virtuoso engine.

The `geos` plugin currently requires __`v3.5.1`__ of the library which can be 
[downloaded here](http://download.osgeo.org/geos/geos-3.5.1.tar.bz2).

The GEOS library is licensed under the terms of the [GNU Lesser General Public License
v2.1](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html).


### The `shapefileio` plugin

The `shapefileio` plugin adds an interface between the Virtuoso engine and the 
[__`Shapefile`__ C Library](https://shapelib.maptools.org) currently maintained by 
Frank Warmerdam et al.

This plugin adds support for reading ESRI Shapefiles.

At this time, a version of this library is embedded in the Virtuoso codebase, so no external 
packages are required.

The `shapefile` library uses the following license:
```pre
LICENSE
The source for the Shapefile C Library is (c) 1998 Frank Warmerdam, and released under the following
conditions. The intent is that anyone can do anything with the code, but that I do not assume any
liability, nor express any warranty for this code.  As of Shapelib 1.2.6 the core portions of the
library are made available under two possible licenses. The licensee can choose to use the code
under either the Library GNU Public License (LGPL) described in COPYING or under the following MIT
style license. Any files in the Shapelib distribution without explicit copyright license terms (such
as this documentation, the Makefile and so forth) should be considered to have the following
licensing terms. Some auxilary portions of Shapelib, notably some of the components in the contrib
directory come under slightly different license restrictions. Check the source files that you are
actually using for conditions.

DEFAULT LICENSE TERMS
Copyright (c) 1999, Frank Warmerdam
This software is available under the following "MIT Style" license, or at the option of the
licensee under the LGPL (see COPYING). This option is discussed in more detail in shapelib.html.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute,
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES
OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

SHAPELIB MODIFICATIONS
I am pleased to receive bug fixes, and improvements for Shapelib. Unless the submissions indicate
otherwise I will assume that changes submitted to me remain under the the above "dual license"
terms. If changes are made to the library with the intention that those changes should be protected
by the LGPL then I should be informed upon submission. Note that I will not generally incorporate
changes into the core of Shapelib that are protected under the LGPL as this would effectively limit
the whole file and distribution to LGPL terms.

Opting for LGPL
For licensee's opting to use Shapelib under LGPL as opposed to the MIT Style license above, and
wishing to redistribute the software based on Shapelib, I would ask that all "dual license" modules
be updated to indicate that only the LGPL (and not the MIT Style license) applies. This action
represents opting for the LGPL, and thereafter LGPL terms apply to any redistribution and
modification of the affected modules.
```



## Changes to `virtuoso.ini`

After building and installing the new plugins, you may need to add them to the __`Plugins`__ 
section of any existing `virtuoso.ini` file. You need to make sure that each _`Load`_ line uses 
a unique number, although numbering does not have to be sequential.
```pre
[Plugins]
...
...
Load20 = plain, proj4
Load21 = plain, geos
Load22 = plain, shapefileio
```

The `proj4` plugin requires access to a number of data files from the `proj` project which are 
normally installed in `/usr/share/proj`. For this, you need to change your `virtuoso.ini` file, 
and add this directory to the existing __`DirsAllowed`__ setting, like this:
```pre
[Parameters]
..
..
DirsAllowed                     = ., /opt/virtuoso-opensource/vad, /usr/share/proj
..
..
```

After making these modifications to the `virtuoso.ini` file, you need to restart the virtuoso engine
to make these additional functions available.


## Troubleshooting

If the plugins are successfully built and installed, you should see the following lines in your
`virtuoso.log` file:
```pre
12:08:51 { Loading plugin 8: Type `plain', file `proj4' in `/opt/virtuoso-opensource/hosting'
12:08:51   plain version 3230 from OpenLink Software
12:08:51   Cartographic Projections support based on Frank Warmerdam's proj4 library
12:08:51   SUCCESS plugin 8: loaded from /opt/virtuoso-opensource/hosting/proj4.so }
12:08:51 { Loading plugin 9: Type `plain', file `geos' in `/opt/virtuoso-opensource/hosting'
12:08:51   plain version 3230 from OpenLink Software
12:08:51   GEOS plugin based on Geometry Engine Open Source library from Open Source Geospatial Foundation
12:08:51   SUCCESS plugin 9: loaded from /opt/virtuoso-opensource/hosting/geos.so }
12:08:51 { Loading plugin 10: Type `plain', file `shapefileio' in `/opt/virtuoso-opensource/hosting'
12:08:51   ShapefileIO version 0.1virt71 from OpenLink Software
12:08:51   Shapefile support based on Frank Warmerdam's Shapelib
12:08:51   SUCCESS plugin 10: loaded from /opt/virtuoso-opensource/hosting/shapefileio.so }
```

If you see the following lines near the bottom of your `virtuoso.log` file, then you need to install the
`proj-data` package, if available for your operating system.
```pre
12:23:17 PL LOG: Initial setup of DB.DBA.SYS_PROJ4_SRIDS data from files in "/usr/share/proj"
12:23:17 PL LOG: Error during initial setup of DB.DBA.SYS_PROJ4_SRIDS data: 39000: FA005:
Can't open file '/usr/share/proj/epsg', error 2
```

If the `proj` plugin is initialized successfully, you will see the following lines near the bottom 
of your `virtuoso.ini` file:
```pre
12:10:08 PL LOG: Initial setup of DB.DBA.SYS_PROJ4_SRIDS data from files in "/usr/share/proj"
12:10:08 PL LOG: DB.DBA.SYS_PROJ4_SRIDS now contains 8650 spatial reference systems
```