Commit afbaef4e authored by Administrator's avatar Administrator
Browse files

list dataset description in search page width keyword plein text search + DOI

parent d69c77a9
<form class="form-inline ">
<input class="form-control" type="text" placeholder="Search" aria-label="Search">
<form class="form-inline "[formGroup]="Form">
<input class="form-control" type="text" placeholder="Search" aria-label="Search" formControlName="keyword">
<button type="submit" (click)="simpleSearch()">Search</button>
</form>
......@@ -7,13 +7,15 @@
<div *ngIf="!isXmlItemsEmpty()" class="w3-container">
<table class="w3-table-all w3-card-4">
<thead>
<th style="text-align: center;">Uri (DOI)</th>
<th style="text-align: center;">Title</th>
<th style="text-align: center;">Description</th>
</thead>
<tbody>
<tr *ngFor="let item of xmlItems">
<tr *ngFor="let item of xmlItems">
<td><a href="{{item.uri.value}}" target="blank">{{item.uri.value}}</a></td>
<td>{{item.title.value}}</td>
<td>{{item.description.value}} </td>
<td>{{item.description.value.substr(0,250) }}... </td>
</tr>
</tbody>
</table>
......
import { Component, OnInit } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { ParseXmlService } from '../services/parse-xml.service';
import { FormControl, FormGroup } from '@angular/forms';
@Component({
......@@ -16,6 +17,10 @@ export class SearchComponent implements OnInit {
public xmlItems: string[][] = [];
Form = new FormGroup({
keyword: new FormControl()
});
constructor(
private http: HttpClient,
private parserService: ParseXmlService
......@@ -36,12 +41,13 @@ export class SearchComponent implements OnInit {
query=
'query=PREFIX dcat: <http://www.w3.org/ns/dcat#>\n\
PREFIX dcterms: <http://purl.org/dc/terms/>\n\
SELECT ?title ?description\n\
SELECT ?title ?description ?uri \n\
where {\n\
?dataset a dcat:Dataset ;\n\
dcterms:title ?title ;\n\
dcterms:description ?description\n\
FILTER (contains( ?description, "Northern") || contains( ?title, "Northern"))\n\
dcterms:description ?description; \n\
dcat:keyword ?uri ; \n\
FILTER (contains( ?description, "'+ this.Form.value.keyword +'") || contains( ?title, "'+ this.Form.value.keyword +'"))\n\
.\n\
}'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment