GeoSPARQL implementation not supporting distance in meters and transformations
Version
5.4
Question
Hello,
I'm trying to run this query:
PREFIX geo: <http://www.opengis.net/ont/geosparql#>
PREFIX geof: <http://www.opengis.net/def/function/geosparql/>
PREFIX uom: <http://www.opengis.net/def/uom/OGC/1.0/>
# Test GeoSPARQL distance calculation between two cities
SELECT ?city1 ?city2 ?distance_km WHERE { # Define test points with EPSG:4326 (WGS84) coordinate reference system
VALUES (?city1 ?point1 ?city2 ?point2) {
("London" "<http://www.opengis.net/def/crs/EPSG/0/4326> POINT(-0.1276 51.5074)"^^geo:wktLiteral "Paris" "<http://www.opengis.net/def/crs/EPSG/0/4326> POINT(2.3522 48.8566)"^^geo:wktLiteral)
("New York" "<http://www.opengis.net/def/crs/EPSG/0/4326> POINT(-74.0060 40.7128)"^^geo:wktLiteral "Boston" "<http://www.opengis.net/def/crs/EPSG/0/4326> POINT(-71.0588 42.3601)"^^geo:wktLiteral)
("Amsterdam" "<http://www.opengis.net/def/crs/EPSG/0/4326> POINT(4.9041 52.3676)"^^geo:wktLiteral "Brussels" "<http://www.opengis.net/def/crs/EPSG/0/4326> POINT(4.3517 50.8503)"^^geo:wktLiteral)
}
# Calculate distance in kilometers
BIND(geof:distance(?point1, ?point2, uom:metre) / 1000 AS ?distance_km)
}
ORDER BY ?distance_km
On an jena fuseki geosparql instance in which I have defined the SIS_DATA variable to a writeable folder.
The result is an empty field for the ?distance_km variable. While this query works well on the AKSW endpoint.
When I replace
BIND(geof:distance(?point1, ?point2, uom:metre) / 1000 AS ?distance_km)
with:
BIND(geof:distance(?point1, ?point2, uom:degree) / 1000 AS ?distance_km)
The field is not empty anymore, but degrees is not what I need :).
I'm thinking this might have something to do with another problem that I experience. The geof:transform function doesn't seem to work either. Is this related?
Thank you!
I checked with @SimonBin (who set up the and the AKSW endpoint) and the most likely reason is that in our setup we also place the dependency below on the class path of Fuseki. This dependency is only in test scope in jena-geosparql for licensing reasons. In our setup we effectively set it to compile. We haven't tested this on our side yet, but we expect that adding this jar file with dependencies to Fuseki's class path is sufficient to make the metre-based distance calculations work:
jena-geosparql/pom.xml
<dependency>
<groupId>org.apache.sis.non-free</groupId>
<artifactId>sis-embedded-data</artifactId>
<version>${ver.sis}</version>
<!-- <scope>test</scope> -->
</dependency>
also see https://sis.apache.org/book/en/developer-guide.html#Installation
Thank you Aklakan and Simon for your answer. Based on your feedback, I added a couple of additional lines to the Dockerfile: https://github.com/Matdata-eu/apache-jena-fuseki-geosparql/blob/bugfix-metric-distance/Dockerfile I had to include a bunch of dependencies to make sure there are no 'dependency not found' error during startup of the container. So I'm sure the classes are properly loaded at runtime. Derby is also sending lines to the log file.
But the metric distance calculation is still not working. I don't see much moving in the sis_data folder. When I open a shell in the container and run sis crs epsg:4326 and accept a couple of times, there are files added to the sis folder. But still no luck on the distance calculation.
I'm no Java expert, but I'm assuming that the way I'm running the container includes the additional dependencies in the same way as adding the dependency to the pom.xml file.
I've activated TRACE debugging on fuseki and the result is below. Besides the first few lines, there is nothing about any conversion issues.
Do you have other ideas?
PS C:\Users\mathi\Git\semantics\apache-jena-fuseki-geosparql> docker run -it -v ${PWD}/data:/fuseki-base -p 3030:3030 jena-geosparql
20:02:05 TRACE LocatorFile :: Not found: location-mapping.ttl
20:02:05 TRACE LocatorClassLoader :: Failed to open: location-mapping.ttl
20:02:05 TRACE LocatorFile :: Not found: location-mapping.rdf
20:02:05 TRACE LocatorClassLoader :: Failed to open: location-mapping.rdf
20:02:05 TRACE LocatorFile :: Not found: etc/location-mapping.rdf
20:02:05 TRACE LocatorClassLoader :: Failed to open: etc/location-mapping.rdf
20:02:05 TRACE LocatorFile :: Not found: etc/location-mapping.ttl
20:02:05 TRACE LocatorClassLoader :: Failed to open: etc/location-mapping.ttl
20:02:05 DEBUG JenaIOEnvironment :: Failed to find configuration: location-mapping.ttl;location-mapping.rdf;etc/location-mapping.rdf;etc/location-mapping.ttl
20:02:06 DEBUG info :: System architecture: 64 bit
20:02:06 DEBUG System :: System architecture: 64 bit
20:02:07 INFO Server :: Apache Jena Fuseki 5.4.0
20:02:07 INFO Config :: Fuseki Base = /fuseki-base
20:02:07 INFO Config :: Load configuration: file:///fuseki-base/configuration/test.ttl
20:02:07 DEBUG StreamManager :: Not mapped: file:///fuseki-base/configuration/test.ttl
20:02:07 TRACE LocatorFile :: Found: file:///fuseki-base/configuration/test.ttl
20:02:07 DEBUG StreamManager :: Found: file:///fuseki-base/configuration/test.ttl (LocatorFile)
20:02:07 DEBUG AdapterFileManager :: loadModel(org/apache/jena/vocabulary/assembler.ttl)
20:02:07 DEBUG StreamManager :: Not mapped: org/apache/jena/vocabulary/assembler.ttl
20:02:07 TRACE LocatorFile :: Not found: org/apache/jena/vocabulary/assembler.ttl
20:02:07 TRACE LocatorHTTP :: Not found : org/apache/jena/vocabulary/assembler.ttl
20:02:07 TRACE LocatorFTP :: Not found : org/apache/jena/vocabulary/assembler.ttl
20:02:07 TRACE LocatorClassLoader :: Found: org/apache/jena/vocabulary/assembler.ttl
20:02:07 DEBUG StreamManager :: Found: org/apache/jena/vocabulary/assembler.ttl (ClassLoaderLocator)
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?a rdfs:isDefinedBy ?b) -> (?a rdfs:seeAlso ?b) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x rdf:rest ?y) -> (?y rdf:type rdf:List) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x rdfs:label ?y) -> (?y rdf:type rdfs:Literal) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x rdfs:comment ?y) -> (?y rdf:type rdfs:Literal) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x rdfs:range ?y) -> (?y rdf:type rdfs:Class) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x rdfs:domain ?y) -> (?y rdf:type rdfs:Class) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x rdfs:subClassOf ?y) -> (?y rdf:type rdfs:Class) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x rdfs:subPropertyOf ?y) -> (?y rdf:type rdf:Property) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x rdf:rest ?y) -> (?x rdf:type rdf:List) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x rdf:first ?y) -> (?x rdf:type rdf:List) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x rdf:object ?y) -> (?x rdf:type rdf:Statement) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x rdf:predicate ?y) -> (?x rdf:type rdf:Statement) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x rdf:subject ?y) -> (?x rdf:type rdf:Statement) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x rdfs:range ?y) -> (?x rdf:type rdf:Property) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x rdfs:domain ?y) -> (?x rdf:type rdf:Property) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x rdfs:subClassOf ?y) -> (?x rdf:type rdfs:Class) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x rdfs:subPropertyOf ?y) -> (?x rdf:type rdf:Property) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x rdf:type ?y) -> (?y rdf:type rdfs:Class) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?a rdfs:isDefinedBy ?b) -> (?a rdfs:seeAlso ?b) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#rootModel> ?y) -> (?y rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#Model>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#baseModel> ?y) -> (?y rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#Model>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#locationMapper> ?y) -> (?y rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#LocationMapper>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#subModel> ?y) -> (?y rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#Model>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#reasoner> ?y) -> (?y rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#ReasonerFactory>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#rules> ?y) -> (?y rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#RuleSet>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#initialContent> ?y) -> (?y rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#Content>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#content> ?y) -> (?y rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#Content>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#fileManager> ?y) -> (?y rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#FileManager>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#reificationMode> ?y) -> (?y rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#ReificationMode>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#schema> ?y) -> (?y rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#Model>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#prefixMapping> ?y) -> (?y rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#PrefixMapping>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#ontModelSpec> ?y) -> (?y rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#OntModelSpec>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#includes> ?y) -> (?y rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#PrefixMapping>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#reasonerFactory> ?y) -> (?y rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#ReasonerFactory>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#mapName> ?y) -> (?x rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#FileModel>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#reificationMode> ?y) -> (?x rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#Model>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#locationMapper> ?y) -> (?x rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#FileManager>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#rules> ?y) -> (?x rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#HasRules>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#directory> ?y) -> (?x rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#FileModel>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#content> ?y) -> (?x rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#Loadable>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#schema> ?y) -> (?x rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#ReasonerFactory>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#likeBuiltinSpec> ?y) -> (?x rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#OntModelSpec>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#prefixMapping> ?y) -> (?x rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#Model>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#reasoner> ?y) -> (?x rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#InfModel>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#policyPath> ?y) -> (?x rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#DocumentManager>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#reasonerFactory> ?y) -> (?x rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#OntModelSpec>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#fileEncoding> ?y) -> (?x rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#FileModel>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#rootModel> ?y) -> (?x rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#UnionModel>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#baseModel> ?y) -> (?x rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#InfModel>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#initialContent> ?y) -> (?x rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#Loadable>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#ontModelSpec> ?y) -> (?x rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#OntModel>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#fileManager> ?y) -> (?x rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#HasFileManager>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#literalContent> ?y) -> (?x rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#ContentItem>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#modelName> ?y) -> (?x rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#NamedModel>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#includes> ?y) -> (?x rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#PrefixMapping>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#contentEncoding> ?y) -> (?x rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#ContentItem>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#prefix> ?y) -> (?x rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#SinglePrefixMapping>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#rulesFrom> ?y) -> (?x rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#HasRules>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#externalContent> ?y) -> (?x rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#ContentItem>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#namespace> ?y) -> (?x rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#SinglePrefixMapping>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#importSource> ?y) -> (?x rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#OntModelSpec>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#documentManager> ?y) -> (?x rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#OntModelSpec>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#subModel> ?y) -> (?x rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#UnionModel>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2004/08/location-mapping#mapping> ?y) -> (?x rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#LocationMapper>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#reasonerClass> ?y) -> (?x rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#ReasonerFactory>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#rule> ?y) -> (?x rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#HasRules>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#reasonerURL> ?y) -> (?x rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#ReasonerFactory>) ]
20:02:07 DEBUG FBRuleInfGraph :: Adding rule [ (?x <http://jena.hpl.hp.com/2005/11/Assembler#ontLanguage> ?y) -> (?x rdf:type <http://jena.hpl.hp.com/2005/11/Assembler#OntModelSpec>) ]
20:02:07 DEBUG info :: File mode: Mapped
20:02:07 DEBUG System :: File mode: Mapped
20:02:07 DEBUG BlockAccessMapped :: Segment:8388608 BlockSize=8192 blocksPerSegment=1024
20:02:07 DEBUG BlockAccessMapped :: Segment:8388608 BlockSize=8192 blocksPerSegment=1024
20:02:08 DEBUG TDB2StorageBuilder :: Triple table: SPO :: SPO,POS,OSP
20:02:08 DEBUG BlockAccessMapped :: Segment:8388608 BlockSize=8192 blocksPerSegment=1024
20:02:08 DEBUG BlockAccessMapped :: Segment:8388608 BlockSize=8192 blocksPerSegment=1024
20:02:08 DEBUG BlockAccessMapped :: Segment:8388608 BlockSize=8192 blocksPerSegment=1024
20:02:08 DEBUG BlockAccessMapped :: Segment:8388608 BlockSize=8192 blocksPerSegment=1024
20:02:08 DEBUG BlockAccessMapped :: Segment:8388608 BlockSize=8192 blocksPerSegment=1024
20:02:08 DEBUG BlockAccessMapped :: Segment:8388608 BlockSize=8192 blocksPerSegment=1024
20:02:08 DEBUG TDB2StorageBuilder :: Quad table: GSPO :: GSPO,GPOS,GOSP,POSG,OSPG,SPOG
20:02:08 DEBUG BlockAccessMapped :: Segment:8388608 BlockSize=8192 blocksPerSegment=1024
20:02:08 DEBUG BlockAccessMapped :: Segment:8388608 BlockSize=8192 blocksPerSegment=1024
20:02:08 DEBUG BlockAccessMapped :: Segment:8388608 BlockSize=8192 blocksPerSegment=1024
20:02:08 DEBUG BlockAccessMapped :: Segment:8388608 BlockSize=8192 blocksPerSegment=1024
20:02:08 DEBUG BlockAccessMapped :: Segment:8388608 BlockSize=8192 blocksPerSegment=1024
20:02:08 DEBUG BlockAccessMapped :: Segment:8388608 BlockSize=8192 blocksPerSegment=1024
20:02:08 DEBUG BlockAccessMapped :: Segment:8388608 BlockSize=8192 blocksPerSegment=1024
20:02:08 DEBUG BlockAccessMapped :: Segment:8388608 BlockSize=8192 blocksPerSegment=1024
20:02:08 DEBUG BlockAccessMapped :: Segment:8388608 BlockSize=8192 blocksPerSegment=1024
20:02:08 DEBUG BlockAccessMapped :: Segment:8388608 BlockSize=8192 blocksPerSegment=1024
20:02:08 DEBUG BlockAccessMapped :: Segment:8388608 BlockSize=8192 blocksPerSegment=1024
20:02:08 DEBUG BlockAccessMapped :: Segment:8388608 BlockSize=8192 blocksPerSegment=1024
20:02:08 DEBUG BlockAccessMapped :: Segment:8388608 BlockSize=8192 blocksPerSegment=1024
20:02:08 DEBUG BlockAccessMapped :: Segment:8388608 BlockSize=8192 blocksPerSegment=1024
20:02:08 DEBUG BlockAccessMapped :: Segment:8388608 BlockSize=8192 blocksPerSegment=1024
20:02:08 DEBUG BlockAccessMapped :: Segment:8388608 BlockSize=8192 blocksPerSegment=1024
20:02:08 DEBUG TDB2StorageBuilder :: Prefixes: GPU :: GPU
20:02:08 DEBUG LockMRSW :: Lock : main
20:02:08 DEBUG LockMRSW :: Lock : main
20:02:08 DEBUG LockMRSW :: Lock : main
20:02:08 INFO Config :: Database: /test
20:02:08 INFO Config :: UI Base = fuseki-server.jar
20:02:08 DEBUG InternalLoggerFactory :: Using SLF4J as the default logging framework
20:02:08 INFO Server :: Path = /test
20:02:08 INFO Server :: Memory: 3.8 GiB
20:02:08 INFO Server :: Java: 21.0.7
20:02:08 INFO Server :: OS: Linux 5.15.167.4-microsoft-standard-WSL2 amd64
20:02:08 INFO Server :: PID: 1
20:02:08 DEBUG CrossOriginFilter :: Cross-origin filter configuration: allowedOrigins = *, allowedTimingOrigins = null, allowedMethods = GET,POST,DELETE,PUT,HEAD,OPTIONS,PATCH, allowedHeaders = X-Requested-With, Content-Type, Accept, Origin, Last-Modified, Authorization, preflightMaxAge = 1800, allowCredentials = true,exposedHeaders = Cache-Control, Content-Language, Content-Length, Content-Type, Expires, Last-Modified, Pragma,chainPreflight = false
20:02:08 DEBUG BooleanConverter :: Setting default value: false
20:02:08 DEBUG BooleanConverter :: Converting 'Boolean' value 'false' to type 'Boolean'
20:02:08 DEBUG BooleanConverter :: No conversion required, value is already a Boolean
20:02:08 DEBUG ByteConverter :: Setting default value: 0
20:02:08 DEBUG ByteConverter :: Converting 'Integer' value '0' to type 'Byte'
20:02:08 DEBUG ByteConverter :: Converted to Byte value '0'
20:02:08 DEBUG CharacterConverter :: Setting default value:
20:02:08 DEBUG CharacterConverter :: Converting 'Character' value ' ' to type 'Character'
20:02:08 DEBUG CharacterConverter :: No conversion required, value is already a Character
20:02:08 DEBUG DoubleConverter :: Setting default value: 0
20:02:08 DEBUG DoubleConverter :: Converting 'Integer' value '0' to type 'Double'
20:02:08 DEBUG DoubleConverter :: Converted to Double value '0.0'
20:02:08 DEBUG FloatConverter :: Setting default value: 0
20:02:08 DEBUG FloatConverter :: Converting 'Integer' value '0' to type 'Float'
20:02:08 DEBUG FloatConverter :: Converted to Float value '0.0'
20:02:08 DEBUG IntegerConverter :: Setting default value: 0
20:02:08 DEBUG IntegerConverter :: Converting 'Integer' value '0' to type 'Integer'
20:02:08 DEBUG IntegerConverter :: No conversion required, value is already a Integer
20:02:08 DEBUG LongConverter :: Setting default value: 0
20:02:08 DEBUG LongConverter :: Converting 'Integer' value '0' to type 'Long'
20:02:08 DEBUG LongConverter :: Converted to Long value '0'
20:02:08 DEBUG ShortConverter :: Setting default value: 0
20:02:08 DEBUG ShortConverter :: Converting 'Integer' value '0' to type 'Short'
20:02:08 DEBUG ShortConverter :: Converted to Short value '0'
20:02:08 DEBUG BigDecimalConverter :: Setting default value: 0.0
20:02:08 DEBUG BigDecimalConverter :: Converting 'BigDecimal' value '0.0' to type 'BigDecimal'
20:02:08 DEBUG BigDecimalConverter :: No conversion required, value is already a BigDecimal
20:02:08 DEBUG BigIntegerConverter :: Setting default value: 0
20:02:08 DEBUG BigIntegerConverter :: Converting 'BigInteger' value '0' to type 'BigInteger'
20:02:08 DEBUG BigIntegerConverter :: No conversion required, value is already a BigInteger
20:02:08 DEBUG BooleanConverter :: Setting default value: false
20:02:08 DEBUG BooleanConverter :: Converting 'Boolean' value 'false' to type 'Boolean'
20:02:08 DEBUG BooleanConverter :: No conversion required, value is already a Boolean
20:02:08 DEBUG ByteConverter :: Setting default value: 0
20:02:08 DEBUG ByteConverter :: Converting 'Integer' value '0' to type 'Byte'
20:02:08 DEBUG ByteConverter :: Converted to Byte value '0'
20:02:08 DEBUG CharacterConverter :: Setting default value:
20:02:08 DEBUG CharacterConverter :: Converting 'Character' value ' ' to type 'Character'
20:02:08 DEBUG CharacterConverter :: No conversion required, value is already a Character
20:02:08 DEBUG DoubleConverter :: Setting default value: 0
20:02:08 DEBUG DoubleConverter :: Converting 'Integer' value '0' to type 'Double'
20:02:08 DEBUG DoubleConverter :: Converted to Double value '0.0'
20:02:08 DEBUG FloatConverter :: Setting default value: 0
20:02:08 DEBUG FloatConverter :: Converting 'Integer' value '0' to type 'Float'
20:02:08 DEBUG FloatConverter :: Converted to Float value '0.0'
20:02:08 DEBUG IntegerConverter :: Setting default value: 0
20:02:08 DEBUG IntegerConverter :: Converting 'Integer' value '0' to type 'Integer'
20:02:08 DEBUG IntegerConverter :: No conversion required, value is already a Integer
20:02:08 DEBUG LongConverter :: Setting default value: 0
20:02:08 DEBUG LongConverter :: Converting 'Integer' value '0' to type 'Long'
20:02:08 DEBUG LongConverter :: Converted to Long value '0'
20:02:08 DEBUG ShortConverter :: Setting default value: 0
20:02:08 DEBUG ShortConverter :: Converting 'Integer' value '0' to type 'Short'
20:02:08 DEBUG ShortConverter :: Converted to Short value '0'
20:02:08 DEBUG StringConverter :: Setting default value:
20:02:08 DEBUG StringConverter :: Converting 'String' value '' to type 'String'
20:02:08 DEBUG ArrayConverter :: Setting default value: [Z@1736c1e4
20:02:08 DEBUG ArrayConverter :: Converting 'boolean[]' value '[Z@1736c1e4' to type 'boolean[]'
20:02:08 DEBUG ArrayConverter :: No conversion required, value is already a boolean[]
20:02:08 DEBUG ArrayConverter :: Setting default value: [B@32dcfeea
20:02:08 DEBUG ArrayConverter :: Converting 'byte[]' value '[B@32dcfeea' to type 'byte[]'
20:02:08 DEBUG ArrayConverter :: No conversion required, value is already a byte[]
20:02:08 DEBUG ArrayConverter :: Setting default value: [C@738a815c
20:02:08 DEBUG ArrayConverter :: Converting 'char[]' value '[C@738a815c' to type 'char[]'
20:02:08 DEBUG ArrayConverter :: No conversion required, value is already a char[]
20:02:08 DEBUG ArrayConverter :: Setting default value: [D@2565a7d0
20:02:08 DEBUG ArrayConverter :: Converting 'double[]' value '[D@2565a7d0' to type 'double[]'
20:02:08 DEBUG ArrayConverter :: No conversion required, value is already a double[]
20:02:08 DEBUG ArrayConverter :: Setting default value: [F@4fd7b79
20:02:08 DEBUG ArrayConverter :: Converting 'float[]' value '[F@4fd7b79' to type 'float[]'
20:02:08 DEBUG ArrayConverter :: No conversion required, value is already a float[]
20:02:08 DEBUG ArrayConverter :: Setting default value: [I@5103eea2
20:02:08 DEBUG ArrayConverter :: Converting 'int[]' value '[I@5103eea2' to type 'int[]'
20:02:08 DEBUG ArrayConverter :: No conversion required, value is already a int[]
20:02:08 DEBUG ArrayConverter :: Setting default value: [J@762405bf
20:02:08 DEBUG ArrayConverter :: Converting 'long[]' value '[J@762405bf' to type 'long[]'
20:02:08 DEBUG ArrayConverter :: No conversion required, value is already a long[]
20:02:08 DEBUG ArrayConverter :: Setting default value: [S@7e77678c
20:02:08 DEBUG ArrayConverter :: Converting 'short[]' value '[S@7e77678c' to type 'short[]'
20:02:08 DEBUG ArrayConverter :: No conversion required, value is already a short[]
20:02:08 DEBUG ArrayConverter :: Setting default value: [Ljava.math.BigDecimal;@113eed88
20:02:08 DEBUG ArrayConverter :: Converting 'BigDecimal[]' value '[Ljava.math.BigDecimal;@113eed88' to type 'BigDecimal[]'
20:02:08 DEBUG ArrayConverter :: No conversion required, value is already a BigDecimal[]
20:02:08 DEBUG ArrayConverter :: Setting default value: [Ljava.math.BigInteger;@9d99851
20:02:08 DEBUG ArrayConverter :: Converting 'BigInteger[]' value '[Ljava.math.BigInteger;@9d99851' to type 'BigInteger[]'
20:02:08 DEBUG ArrayConverter :: No conversion required, value is already a BigInteger[]
20:02:08 DEBUG ArrayConverter :: Setting default value: [Ljava.lang.Boolean;@2ae3235e
20:02:08 DEBUG ArrayConverter :: Converting 'Boolean[]' value '[Ljava.lang.Boolean;@2ae3235e' to type 'Boolean[]'
20:02:08 DEBUG ArrayConverter :: No conversion required, value is already a Boolean[]
20:02:08 DEBUG ArrayConverter :: Setting default value: [Ljava.lang.Byte;@3686389
20:02:08 DEBUG ArrayConverter :: Converting 'Byte[]' value '[Ljava.lang.Byte;@3686389' to type 'Byte[]'
20:02:08 DEBUG ArrayConverter :: No conversion required, value is already a Byte[]
20:02:08 DEBUG ArrayConverter :: Setting default value: [Ljava.lang.Character;@4228f269
20:02:08 DEBUG ArrayConverter :: Converting 'Character[]' value '[Ljava.lang.Character;@4228f269' to type 'Character[]'
20:02:08 DEBUG ArrayConverter :: No conversion required, value is already a Character[]
20:02:08 DEBUG ArrayConverter :: Setting default value: [Ljava.lang.Double;@775f15fd
20:02:08 DEBUG ArrayConverter :: Converting 'Double[]' value '[Ljava.lang.Double;@775f15fd' to type 'Double[]'
20:02:08 DEBUG ArrayConverter :: No conversion required, value is already a Double[]
20:02:08 DEBUG ArrayConverter :: Setting default value: [Ljava.lang.Float;@1552da16
20:02:08 DEBUG ArrayConverter :: Converting 'Float[]' value '[Ljava.lang.Float;@1552da16' to type 'Float[]'
20:02:08 DEBUG ArrayConverter :: No conversion required, value is already a Float[]
20:02:08 DEBUG ArrayConverter :: Setting default value: [Ljava.lang.Integer;@77ce88c4
20:02:08 DEBUG ArrayConverter :: Converting 'Integer[]' value '[Ljava.lang.Integer;@77ce88c4' to type 'Integer[]'
20:02:08 DEBUG ArrayConverter :: No conversion required, value is already a Integer[]
20:02:08 DEBUG ArrayConverter :: Setting default value: [Ljava.lang.Long;@29b5533
20:02:08 DEBUG ArrayConverter :: Converting 'Long[]' value '[Ljava.lang.Long;@29b5533' to type 'Long[]'
20:02:08 DEBUG ArrayConverter :: No conversion required, value is already a Long[]
20:02:08 DEBUG ArrayConverter :: Setting default value: [Ljava.lang.Short;@7608a838
20:02:08 DEBUG ArrayConverter :: Converting 'Short[]' value '[Ljava.lang.Short;@7608a838' to type 'Short[]'
20:02:08 DEBUG ArrayConverter :: No conversion required, value is already a Short[]
20:02:08 DEBUG ArrayConverter :: Setting default value: [Ljava.lang.String;@21a6a494
20:02:08 DEBUG ArrayConverter :: Converting 'String[]' value '[Ljava.lang.String;@21a6a494' to type 'String[]'
20:02:08 DEBUG ArrayConverter :: No conversion required, value is already a String[]
20:02:08 DEBUG ArrayConverter :: Setting default value: [Ljava.lang.Class;@794c5f5e
20:02:08 DEBUG ArrayConverter :: Converting 'Class[]' value '[Ljava.lang.Class;@794c5f5e' to type 'Class[]'
20:02:08 DEBUG ArrayConverter :: No conversion required, value is already a Class[]
20:02:08 DEBUG ArrayConverter :: Setting default value: [Ljava.util.Date;@4ab66127
20:02:08 DEBUG ArrayConverter :: Converting 'Date[]' value '[Ljava.util.Date;@4ab66127' to type 'Date[]'
20:02:08 DEBUG ArrayConverter :: No conversion required, value is already a Date[]
20:02:08 DEBUG ArrayConverter :: Setting default value: [Ljava.util.Calendar;@37fef327
20:02:08 DEBUG ArrayConverter :: Converting 'Calendar[]' value '[Ljava.util.Calendar;@37fef327' to type 'Calendar[]'
20:02:08 DEBUG ArrayConverter :: No conversion required, value is already a Calendar[]
20:02:08 DEBUG ArrayConverter :: Setting default value: [Ljava.io.File;@55951fcd
20:02:08 DEBUG ArrayConverter :: Converting 'java.io.File[]' value '[Ljava.io.File;@55951fcd' to type 'java.io.File[]'
20:02:08 DEBUG ArrayConverter :: No conversion required, value is already a java.io.File[]
20:02:08 DEBUG ArrayConverter :: Setting default value: [Ljava.sql.Date;@7534785a
20:02:08 DEBUG ArrayConverter :: Converting 'java.sql.Date[]' value '[Ljava.sql.Date;@7534785a' to type 'java.sql.Date[]'
20:02:08 DEBUG ArrayConverter :: No conversion required, value is already a java.sql.Date[]
20:02:08 DEBUG ArrayConverter :: Setting default value: [Ljava.sql.Time;@3ba3f40d
20:02:08 DEBUG ArrayConverter :: Converting 'java.sql.Time[]' value '[Ljava.sql.Time;@3ba3f40d' to type 'java.sql.Time[]'
20:02:08 DEBUG ArrayConverter :: No conversion required, value is already a java.sql.Time[]
20:02:08 DEBUG ArrayConverter :: Setting default value: [Ljava.sql.Timestamp;@46ab4efc
20:02:08 DEBUG ArrayConverter :: Converting 'java.sql.Timestamp[]' value '[Ljava.sql.Timestamp;@46ab4efc' to type 'java.sql.Timestamp[]'
20:02:08 DEBUG ArrayConverter :: No conversion required, value is already a java.sql.Timestamp[]
20:02:08 DEBUG ArrayConverter :: Setting default value: [Ljava.net.URL;@b5312df
20:02:08 DEBUG ArrayConverter :: Converting 'java.net.URL[]' value '[Ljava.net.URL;@b5312df' to type 'java.net.URL[]'
20:02:08 DEBUG ArrayConverter :: No conversion required, value is already a java.net.URL[]
20:02:08 INFO Shiro :: Shiro configuration: file:/fuseki-base/shiro.ini
20:02:08 TRACE BeanUtils :: setProperty(org.apache.shiro.web.filter.authz.SslFilter@2c678c7b, enabled, false)
20:02:08 TRACE BeanUtils :: Target bean = org.apache.shiro.web.filter.authz.SslFilter@2c678c7b
20:02:08 TRACE BeanUtils :: Target name = enabled
20:02:08 DEBUG ConvertUtils :: Convert string 'false' to class 'boolean'
20:02:08 TRACE ConvertUtils :: Using converter ConverterFacade[BooleanConverter[UseDefault=true]]
20:02:08 DEBUG BooleanConverter :: Converting 'String' value 'false' to type 'Boolean'
20:02:08 DEBUG BooleanConverter :: Converted to Boolean value 'false'
20:02:08 TRACE PropertyUtils :: setSimpleProperty: Invoking method public void org.apache.shiro.web.servlet.OncePerRequestFilter.setEnabled(boolean) with value false (class java.lang.Boolean)
20:02:08 TRACE BeanUtils :: setProperty(org.apache.shiro.realm.text.IniRealm@2bfa17b0, credentialsMatcher, org.apache.shiro.authc.credential.SimpleCredentialsMatcher@625264ed)
20:02:08 TRACE BeanUtils :: Target bean = org.apache.shiro.realm.text.IniRealm@2bfa17b0
20:02:08 TRACE BeanUtils :: Target name = credentialsMatcher
20:02:08 TRACE PropertyUtils :: setSimpleProperty: Invoking method public void org.apache.shiro.realm.AuthenticatingRealm.setCredentialsMatcher(org.apache.shiro.authc.credential.CredentialsMatcher) with value org.apache.shiro.authc.credential.SimpleCredentialsMatcher@625264ed (class org.apache.shiro.authc.credential.SimpleCredentialsMatcher)
20:02:08 INFO Server :: Start Fuseki (http=3030)
20:03:46 DEBUG CrossOriginFilter :: Cross-origin request to /test/ is a simple cross-origin request
20:03:46 DEBUG CrossOriginFilter :: Cross-origin request to /test/ with origin http://localhost:3030 does not match allowed timing origins []
20:03:46 INFO Fuseki :: [3] POST http://localhost:3030/test/
20:03:46 INFO Fuseki :: [3] Query = PREFIX geo: <http://www.opengis.net/ont/geosparql#> PREFIX geof: <http://www.opengis.net/def/function/geosparql/> PREFIX uom: <http://www.opengis.net/def/uom/OGC/1.0/> # Test GeoSPARQL distance calculation between two cities SELECT ?city1 ?city2 ?distance_km WHERE { # Define test points with EPSG:4326 (WGS84) coordinate reference system VALUES (?city1 ?point1 ?city2 ?point2) { ("London" "<http://www.opengis.net/def/crs/EPSG/0/4326> POINT(-0.1276 51.5074)"^^geo:wktLiteral "Paris" "<http://www.opengis.net/def/crs/EPSG/0/4326> POINT(2.3522 48.8566)"^^geo:wktLiteral) ("New York" "<http://www.opengis.net/def/crs/EPSG/0/4326> POINT(-74.0060 40.7128)"^^geo:wktLiteral "Boston" "<http://www.opengis.net/def/crs/EPSG/0/4326> POINT(-71.0588 42.3601)"^^geo:wktLiteral) ("Amsterdam" "<http://www.opengis.net/def/crs/EPSG/0/4326> POINT(4.9041 52.3676)"^^geo:wktLiteral "Brussels" "<http://www.opengis.net/def/crs/EPSG/0/4326> POINT(4.3517 50.8503)"^^geo:wktLiteral) } # Calculate distance in kilometers BIND(geof:distance(?point1, ?point2, uom:metre) / 1000 AS ?distance_km) } ORDER BY ?distance_km
20:03:47 DEBUG ConNeg :: Accept request: application/sparql-results+json,*/*;q=0.9
20:03:47 DEBUG ConNeg :: Content type chosen: [application/sparql-results+json]
20:03:47 TRACE Fuseki :: Content-Type for response: application/sparql-results+json; charset=utf-8
20:03:47 INFO Fuseki :: [3] 200 OK (693 ms)
if you like you can also start the aksw/fuseki-geoplus:5.5.0-1 container or try to compare where the difference is. Our docker image is built mostly with maven and not with manual wget
Thank you for the reference to your working docker image Simon! I was able to get my image working now. I removed all the wget commands installing sis/derby and its dependencies and just added the jenax-arq-plugins-bundle-5.5.0-1-SNAPSHOT.jar found in your docker image ./jars folder and it started working.
I figured that this shouldn't be the solution to the problem. So I started looking at the pom file of this library: https://github.com/Scaseco/jenax/blob/develop/jenax-arq-parent/jenax-arq-plugins-parent/jenax-arq-plugins-bundle/pom.xml and added all the dependencies one by one to my project. Or better yet, I added everything instead of your jar file except for the other jenax dependencies. And it's not working.
So there is an immediate dependency of fuseki-geosparql inside jenax-arq-plugins-bundle ?
in case you are using shading, did you remember to call the ServicesResourceTransformer? ~~I still believe the most likely cause for your issue is an incorrect SIS database set-up (there are several ways to use SIS, one of them is to use the sis-embedded-data, another one is to use sis-epsg and the environment variable)~~
in case you are using shading, did you remember to call the ServicesResourceTransformer?
I'm far from a Java expert so I had to look up these words :), I'm not using shading.
I still believe the most likely cause for your issue is an incorrect SIS database set-up (there are several ways to use SIS, one of them is to use the sis-embedded-data, another one is to use sis-epsg and the environment variable)
Is there anything specific I will need to do to "set it up" besides adding the dependency?
I converted the wget into a pom file and use maven now to load everything. Dockerfile and pom file are here. Still not working unless I add the jenax jar file
I see that in jena-geosparql there are two distance functions:
<http://www.opengis.net/def/function/geosparql/distance>(geof:distance)<http://jena.apache.org/function/spatial#distance>(spatialF:distance)
In our JenaX plugins bundle we added an override such that Jena's default geof:distance function actually refers to spatialF:distance. I don't recall the reason anymore, but most likely it was because only that way the function would work as one would expect it to work.
If you replace geof:distance with spatialF:distance, does it work for you then?
Update: According to my colleague @LorenzBuehmann the reason is that back then jena-geosparql was implemented against the GeoSPARQL 1.0 spec where geof:distance only supported euclidean distances. @galbiston had however already implemented an improved non-standard spatialF:distance function with SRS support, which by now has become standardized with GeoSPARQL 1.1.
So the geof:distance function registration could be updated.
I see that @Aklakan and @LorenzBuehmann managed to clear up your issue.
In summary:
- it was not related to SIS (sorry for the confusion I caused here!)
- The EPSG 4326 is not a metric coordinate system, which means you cannot use the GeoSPARQL 1.0 geof:distance function to calculate the distance in metres
- in JenaX, we changed the behaviour of core Jena and replaced
geof:distancewith the Jena geospatial vendor functionspatialF:distancebecause we are lazy bums. that's why it works in our Docker image and with JenaX loaded - you could use the vendor function
spatialF:transformSRSto convert the geometry to a metric coordinate system first, then you could use the standardgeof:distance
See also https://github.com/opengeospatial/ogc-geosparql/issues/398 and https://github.com/opengeospatial/ogc-geosparql/issues/468 for further discussions on this issue
Ah yes indeed...
If you replace geof:distance with spatialF:distance, does it work for you then?
Yes that works!
On this page: https://jena.apache.org/documentation/geosparql/ it's written:
So I thought geof:distance should work.
So the geof:distance function registration could be updated.
That would indeed be the best solution!
Thank you very much @Aklakan , @SimonBin and @LorenzBuehmann
Do I close this question or convert it into an issue to make sure this gets implemented?
So the geof:distance function registration could be updated.
@MathiasVDA Please create a specific issue for this.
See new issue #3320