Skip to content
Snippets Groups Projects
Commit 07f7a248 authored by Baptiste Toulemonde's avatar Baptiste Toulemonde
Browse files

change sparql queries

parent 5af1278b
No related branches found
No related tags found
2 merge requests!9Fix/describe repository api,!8Fix/mapping
......@@ -2,6 +2,7 @@ import { Component, OnInit } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { ParseXmlService } from '../services/parse-xml.service';
import { FormBuilder, FormControl, FormGroup } from '@angular/forms';
import { environment } from 'src/environments/environment.prod';
export interface formData{
......@@ -49,6 +50,7 @@ export class SearchComponent implements OnInit {
where {\n\?dataset a dcat:Dataset ;\n\
dcterms:title ?title ;\n\
dcterms:description ?description; \n\
dcterms:isPartOf* <'+ environment.fdpUrl +'>;\n\
dcat:keyword ?uri ; \n\
FILTER (contains( ?description, "' +
term +'") || contains( ?title, "'+ term +'"))\n\.\n\
......
import { Component, OnInit } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { ParseXmlService } from '../services/parse-xml.service';
import { environment } from 'src/environments/environment';
@Component({
......@@ -17,11 +18,19 @@ export class StatsComponent implements OnInit {
ngOnInit(): void {
let query1='query=SELECT (COUNT(?s) AS ?triples) WHERE { ?s a <http://www.w3.org/ns/dcat#Catalog> }'
let query1='query=prefix dct: <http://purl.org/dc/terms/>\n\
SELECT (COUNT(?s) AS ?triples) \n\
WHERE { ?s a <http://www.w3.org/ns/dcat#Catalog>;\n\
dct:isPartOf <https://f2ds.eosc-pillar.eu>\n\
}'
this.parserService.getXmlResult(query1).subscribe(data=>{if (data){this.results = []; data.results.bindings.forEach(element => { this.results.push(element);});
this.stats.push(this.results[0]["triples"].value)
let query2='query=SELECT (COUNT(?s) AS ?triples) WHERE { ?s a <http://www.w3.org/ns/dcat#Dataset> }'
let query2='query=prefix dct: <http://purl.org/dc/terms/>\n\
SELECT (COUNT(?s) AS ?triples) \n\
WHERE { ?s a <http://www.w3.org/ns/dcat#Dataset>;\n\
dct:isPartOf <'+ environment.fdpUrl +'>\n\
}'
this.parserService.getXmlResult(query2).subscribe(data=>{if (data){this.results = []; data.results.bindings.forEach(element => { this.results.push(element);});
this.stats.push(this.results[0]["triples"].value); }})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment