Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F63840155
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
Wed, May 22, 20:06
Size
1 KB
Mime Type
text/x-java
Expires
Fri, May 24, 20:06 (2 d)
Engine
blob
Format
Raw Data
Handle
17825685
Attached To
rSVGTESTAPP svg-test-app
query.service.ts
View Options
import { Injectable } from '@angular/core';
@Injectable()
export class QueryService {
query: string;
select = 'SELECT ?s ?p ?o '
whereSubject: string;
whereObject: string;
wherePredicate: string;
Optional = '';
queryLimit = ' LIMIT 200';
constructor() {
}
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