Skip to content

Commit

Permalink
Merge pull request #33 from zazuko/dialect-string-type
Browse files Browse the repository at this point in the history
chore: remove plain strings used for dialects
  • Loading branch information
BenjaminHofstetter authored Nov 14, 2024
2 parents 4af74e2 + 33ed6b3 commit ad852dc
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { LibraryConfigurationService } from '@blueprint/service/library-configur

import { Observable, tap } from 'rxjs';
import { environment } from '../../../../environments/environment';
import { FullTextSearchDialect } from "@blueprint/service/sparql/sparql.service";
@Injectable({
providedIn: 'root'
})
Expand Down Expand Up @@ -37,7 +38,7 @@ export class ConfigService {
this._libraryConfigurationService.sparqlConsoleUrl = environment.sparqlConsoleUrl;
this._libraryConfigurationService.graphExplorerUrl = environment.graphExplorerUrl;
this._libraryConfigurationService.production = environment.production;
this._libraryConfigurationService.fullTextSearchDialect = environment.fullTextSearchDialect as "fuseki" | "stardog";
this._libraryConfigurationService.fullTextSearchDialect = environment.fullTextSearchDialect;

}))
}
Expand All @@ -51,5 +52,5 @@ export type FluxConfig = {
readonly endpointUrl: string,
readonly sparqlConsoleUrl: string,
readonly graphExplorerUrl: string,
readonly fullTextSearchDialect: 'fuseki' | 'stardog'
readonly fullTextSearchDialect: FullTextSearchDialect
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class LibraryConfigurationService {
return this.configuration.fullTextSearchDialect;
}

set fullTextSearchDialect(value: 'fuseki' | 'stardog' | 'neptune' | 'graphdb') {
set fullTextSearchDialect(value: FullTextSearchDialect) {
switch (value) {
case 'fuseki':
this.configuration.fullTextSearchDialect = FullTextSearchDialect.FUSEKI;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ export class SparqlService {

/**
* Execute a SPARQL SELECT query
*
*
* @param query The SPARQL SELECT query
* @returns an observable of the resulting bindings
* @returns an observable of the resulting bindings
*/
select(query: string): Observable<Record<string, SparqlResultTerm>[]> {
const endpoint = this.libraryConfigurationService.endpointUrl;
Expand All @@ -58,7 +58,7 @@ export class SparqlService {

/**
* Execute a SPARQL CONSTRUCT query
*
*
* @param query The SPARQL CONSTRUCT query
* @returns an observable of the resulting dataset
*/
Expand Down Expand Up @@ -96,4 +96,4 @@ export enum FullTextSearchDialect {
STARDOG = 'stardog',
NEPTUNE = 'neptune',
GRAPHDB = 'graphdb'
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
// `ng build --configuration production` replaces `environment.ts` with `environment.prod.ts`.
// The list of file replacements can be found in `angular.json`.

import { FullTextSearchDialect } from "@blueprint/service/sparql/sparql.service";

export const environment = {
production: false,
endpointUrl: 'http://localhost:4200/query', // this will be overwritten by /src/config.json
sparqlConsoleUrl: null, // e.g. yasgui -> will be overwritten by /src/config.json
graphExplorerUrl: null, // this will be overwritten by /src/config.json
fullTextSearchDialect: 'neptune', // this will be overwritten by /src/config.json
fullTextSearchDialect: 'neptune' as FullTextSearchDialect, // this will be overwritten by /src/config.json
neptune: {
ftsEndpoint: "https://vpc-opensearch-zazuko-blueprint-glbaecqrcqwr5om3z5jj2duuiq.eu-central-1.es.amazonaws.com"
} // this will be overwritten by /src/config.json// this will be overwritten by /src/config.json
Expand Down
4 changes: 3 additions & 1 deletion projects/blueprint/src/environments/environment.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import type { FullTextSearchDialect } from "@blueprint/service/sparql/sparql.service";

export const environment = {
production: true,
endpointUrl: 'https://ld.flux.zazuko.com/query', // this will be overwritten by /src/config.json
sparqlConsoleUrl: null, // e.g. yasgui -> will be overwritten by /src/config.json
graphExplorerUrl: null, // this will be overwritten by /src/config.json
fullTextSearchDialect: 'neptune', // this will be overwritten by /src/config.json
fullTextSearchDialect: 'neptune' as FullTextSearchDialect, // this will be overwritten by /src/config.json
neptune: {
ftsEndpoint: "https://vpc-opensearch-zazuko-blueprint-glbaecqrcqwr5om3z5jj2duuiq.eu-central-1.es.amazonaws.com"
} // this will be overwritten by /src/config.json
Expand Down

0 comments on commit ad852dc

Please sign in to comment.