Skip to content

Commit

Permalink
fix the cors problem
Browse files Browse the repository at this point in the history
  • Loading branch information
Sepideh Alassi committed Jan 17, 2024
1 parent 1aa704c commit c3f3000
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
3 changes: 2 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"port": 6400,
"browserTarget": "beol:build"
"browserTarget": "beol:build",
"proxyConfig": "./proxy.conf.json"
},
"configurations": {
"production": {
Expand Down
11 changes: 5 additions & 6 deletions src/app/services/beol.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -704,9 +704,8 @@ export class BeolService {

getJourney(entryIri: string): Observable<DataGraphDB> {
const journeyTemplate = `
PREFIX trip-onto: <http://www.dhlab.unibas.ch/ontology/trip-onto#>
PREFIX trip-onto: <http://journeyStar.dhlab.ch/ontology/trip-onto#>
PREFIX schema: <https://schema.org/>
PREFIX : <http://www.dhlab.unibas.ch/data/JBReisebuechlein#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX ofn:<http://www.ontotext.com/sparql/functions/>
SELECT ?From ?To ?Departure ?Arrival ?EndDate ?DurationOfStayInDays
Expand Down Expand Up @@ -735,9 +734,8 @@ export class BeolService {

getStages(entryIri: string):Observable<DataGraphDB> {
const stageTemplate = `
PREFIX trip-onto: <http://www.dhlab.unibas.ch/ontology/trip-onto#>
PREFIX trip-onto: <http://journeyStar.dhlab.ch/ontology/trip-onto#>
PREFIX schema: <https://schema.org/>
PREFIX : <http://www.dhlab.unibas.ch/data/JBReisebuechlein#>
SELECT ?From ?To ?startDate ?endDate ?Transportation ?Accomodation
WHERE {
?journey a trip-onto:Journey .
Expand All @@ -763,15 +761,16 @@ export class BeolService {
}

requestGraphDB(query: string): Observable<DataGraphDB> {
const url = "http://localhost:7200/repositories/reisbuechlein";

const url = "https://graphdb.organa.myds.me/repositories/journeyStar";
const headers = {
"Content-Type": "application/x-www-form-urlencoded",
"Accept": "application/json",
}
const body = new HttpParams()
.set('query', query)

return this._http.post<DataGraphDB>(url, body, {'headers': headers});
return this._http.post<DataGraphDB>(url, body, {'headers': headers, withCredentials: true });
}

/**
Expand Down

0 comments on commit c3f3000

Please sign in to comment.