Adapt code to new SPARQL response on test server
The test server is now in place. In the future every update to the KH will first be tested here before being pushed to the production environment.
Please try out the consortium map with the following backend URL (works only inside of TU Dresden network): https://knowledgehub.test.n4e.geo.tu-dresden.de/fuseki/knowledge-graph/sparql (see Frontend here).
The Fuseki instance on the test server runs on a new major version (4.8.0) and there is some adaption in the code for the consortium map needed. Currently, the production environment is still running with the older version, so I recommend to implement these adaptions in a separate branch, until we upgrade the production Fuseki endpoint.
I already tested the current code with the test endpoint. Currently the map does not load because the Fuseki API has changed slightly, probably caused by an internal change in the json-ld processing library:
The response requested with Accept: application/ld+json
now does not shorten all properties in the CONSTRUCT
part via the @context
anymore automatically. Instead, in the @context
only the prefixes are included. You can see this by comparing the @context
part in the response on the old (production) Fuseki server and the new (test) Fuseki server.
So I would see 2 possible solutions:
-
Replace all direct property references with a prefixed reference (e.g.
currentParticipant["hasLogo"]
->currentParticipant["vcard:hasLogo"]
). -
Keep the code as it is, but include the following
json-ld
library and run something likejsonld.compact(graph, context)
with the following context:
Click to expand
{
"asWKT" : {
"@id" : "http://www.opengis.net/ont/geosparql#asWKT",
"@type" : "http://www.opengis.net/ont/geosparql#wktLiteral"
},
"role" : {
"@id" : "http://www.w3.org/ns/org#role",
"@type" : "@id"
},
"hasNFDI4EarthContactPerson" : {
"@id" : "http://nfdi4earth.de/ontology#hasNFDI4EarthContactPerson",
"@type" : "@id"
},
"name" : {
"@id" : "http://xmlns.com/foaf/0.1/name"
},
"country-name" : {
"@id" : "http://www.w3.org/2006/vcard/ns#country-name"
},
"sourceSystemID" : {
"@id" : "http://nfdi4earth.de/ontology#sourceSystemID"
},
"locality" : {
"@id" : "http://www.w3.org/2006/vcard/ns#locality"
},
"hasRorId" : {
"@id" : "http://w3id.org/nfdi4ing/metadata4ing#hasRorId"
},
"hasGeometry" : {
"@id" : "http://www.opengis.net/ont/geosparql#hasGeometry",
"@type" : "@id"
},
"hasLocality" : {
"@id" : "http://www.w3.org/2006/vcard/ns#hasLocality",
"@type" : "@id"
},
"homepage" : {
"@id" : "http://xmlns.com/foaf/0.1/homepage",
"@type" : "@id"
},
"hasLogo" : {
"@id" : "http://www.w3.org/2006/vcard/ns#hasLogo",
"@type" : "http://www.w3.org/2001/XMLSchema#anyURI"
},
"label" : {
"@id" : "http://www.w3.org/2000/01/rdf-schema#label"
},
"geo" : "http://www.opengis.net/ont/geosparql#",
"schema" : "http://schema.org/",
"m4i" : "http://w3id.org/nfdi4ing/metadata4ing#",
"sf" : "http://www.opengis.net/ont/sf#",
"rdf" : "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"org" : "http://www.w3.org/ns/org#",
"rdfs" : "http://www.w3.org/2000/01/rdf-schema#",
"vcard" : "http://www.w3.org/2006/vcard/ns#",
"foaf" : "http://xmlns.com/foaf/0.1/",
"n4e" : "http://nfdi4earth.de/ontology#"
}