From eb0d0985013a712c758245063a6b4b09bfd01150 Mon Sep 17 00:00:00 2001 From: Osma Suominen Date: Tue, 28 Aug 2018 13:55:51 +0300 Subject: [PATCH] Specify skosmos:defaultEndpoint as a resource, not literal. Fixes #786 --- config.ttl.dist | 2 +- migrate-config.php | 2 +- model/GlobalConfig.php | 7 ++++++- tests/testconfig.ttl | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/config.ttl.dist b/config.ttl.dist index a35aad7c0..e38bb0644 100644 --- a/config.ttl.dist +++ b/config.ttl.dist @@ -18,7 +18,7 @@ :config a skosmos:Configuration ; # SPARQL endpoint # a local Fuseki server is usually on localhost:3030 - #skosmos:sparqlEndpoint "http://localhost:3030/ds/sparql" ; + #skosmos:sparqlEndpoint ; # use the dev.finto.fi endpoint where the example vocabularies reside skosmos:sparqlEndpoint ; # sparql-query extension, or "Generic" for plain SPARQL 1.1 diff --git a/migrate-config.php b/migrate-config.php index 0f31a9cc0..08cbf1936 100644 --- a/migrate-config.php +++ b/migrate-config.php @@ -98,7 +98,7 @@ function parse_vocabularies_file($vocabulariesFile) :config a skosmos:Configuration ; # SPARQL endpoint # a local Fuseki server is usually on localhost:3030 - skosmos:sparqlEndpoint "$endpoint" ; + skosmos:sparqlEndpoint <$endpoint> ; # sparql-query extension, or "Generic" for plain SPARQL 1.1 # set to "JenaText" instead if you use Fuseki with jena-text index skosmos:sparqlDialect "$dialect" ; diff --git a/model/GlobalConfig.php b/model/GlobalConfig.php index b0d7fadd7..6260cc312 100644 --- a/model/GlobalConfig.php +++ b/model/GlobalConfig.php @@ -164,7 +164,12 @@ public function getSparqlTimeout() */ public function getDefaultEndpoint() { - return $this->getLiteral('skosmos:sparqlEndpoint', 'http://localhost:3030/ds/sparql'); + $endpoint = $this->resource->get('skosmos:sparqlEndpoint'); + if ($endpoint) { + return $endpoint->getUri(); + } else { + return 'http://localhost:3030/ds/sparql'; + } } /** diff --git a/tests/testconfig.ttl b/tests/testconfig.ttl index 89987dbd9..b8db0b06b 100644 --- a/tests/testconfig.ttl +++ b/tests/testconfig.ttl @@ -21,7 +21,7 @@ :config a skosmos:Configuration ; # SPARQL endpoint # a local Fuseki server is usually on localhost:3030 - skosmos:sparqlEndpoint "http://localhost:13030/ds/sparql" ; + skosmos:sparqlEndpoint ; # sparql-query extension, or "Generic" for plain SPARQL 1.1 # set to "JenaText" instead if you use Fuseki with jena-text index skosmos:sparqlDialect "Generic" ;