Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F64866842
query.service.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, May 30, 01:43
Size
1 KB
Mime Type
text/x-java
Expires
Sat, Jun 1, 01:43 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
17970516
Attached To
rSVGTESTAPP svg-test-app
query.service.ts
View Options
import { Injectable } from '@angular/core';
import { DataService } from './resources.service';
@Injectable()
export class QueryService {
query: string;
select = 'SELECT ?p ?o '
whereSubject: string;
whereObject: string;
wherePredicate: string;
Optional = '';
queryLimit = ' LIMIT 200';
constructor(private dataService: DataService ) {
}
public assemble_resource_data(resourceValue: string, resourceOwlClass?: string) {
switch (resourceOwlClass) {
case 'subject': {
this.whereSubject = ' <' + decodeURI(resourceValue) + '> ';
this.wherePredicate = ' ?p ';
this.whereObject = ' ?o ';
break;
}
case 'object': {
this.whereObject = ' <' + decodeURI(resourceValue) + '> ';
this.wherePredicate = ' ?p ';
this.whereSubject = ' ?s ';
break;
}
case 'predicate': {
this.wherePredicate = ' <' + decodeURI(resourceValue) + '> ';
this.whereObject = ' ?o ';
this.whereSubject = ' ?s ';
break;
}
}
this.query = this.select + 'WHERE { ' + this.whereSubject + this.wherePredicate + this.whereObject + this.Optional + ' } ' + this.queryLimit;
return this.query;
}
}
Event Timeline
Log In to Comment