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 "> <form class="form-inline "[formGroup]="Form">
<input class="form-control" type="text" placeholder="Search" aria-label="Search"> <input class="form-control" type="text" placeholder="Search" aria-label="Search" formControlName="keyword">
<button type="submit" (click)="simpleSearch()">Search</button> <button type="submit" (click)="simpleSearch()">Search</button>
</form> </form>
...@@ -7,13 +7,15 @@ ...@@ -7,13 +7,15 @@
<div *ngIf="!isXmlItemsEmpty()" class="w3-container"> <div *ngIf="!isXmlItemsEmpty()" class="w3-container">
<table class="w3-table-all w3-card-4"> <table class="w3-table-all w3-card-4">
<thead> <thead>
<th style="text-align: center;">Uri (DOI)</th>
<th style="text-align: center;">Title</th> <th style="text-align: center;">Title</th>
<th style="text-align: center;">Description</th> <th style="text-align: center;">Description</th>
</thead> </thead>
<tbody> <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.title.value}}</td>
<td>{{item.description.value}} </td> <td>{{item.description.value.substr(0,250) }}... </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
......
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http'; import { HttpClient, HttpHeaders } from '@angular/common/http';
import { ParseXmlService } from '../services/parse-xml.service'; import { ParseXmlService } from '../services/parse-xml.service';
import { FormControl, FormGroup } from '@angular/forms';
@Component({ @Component({
...@@ -16,6 +17,10 @@ export class SearchComponent implements OnInit { ...@@ -16,6 +17,10 @@ export class SearchComponent implements OnInit {
public xmlItems: string[][] = []; public xmlItems: string[][] = [];
Form = new FormGroup({
keyword: new FormControl()
});
constructor( constructor(
private http: HttpClient, private http: HttpClient,
private parserService: ParseXmlService private parserService: ParseXmlService
...@@ -36,12 +41,13 @@ export class SearchComponent implements OnInit { ...@@ -36,12 +41,13 @@ export class SearchComponent implements OnInit {
query= query=
'query=PREFIX dcat: <http://www.w3.org/ns/dcat#>\n\ 'query=PREFIX dcat: <http://www.w3.org/ns/dcat#>\n\
PREFIX dcterms: <http://purl.org/dc/terms/>\n\ PREFIX dcterms: <http://purl.org/dc/terms/>\n\
SELECT ?title ?description\n\ SELECT ?title ?description ?uri \n\
where {\n\ where {\n\
?dataset a dcat:Dataset ;\n\ ?dataset a dcat:Dataset ;\n\
dcterms:title ?title ;\n\ dcterms:title ?title ;\n\
dcterms:description ?description\n\ dcterms:description ?description; \n\
FILTER (contains( ?description, "Northern") || contains( ?title, "Northern"))\n\ dcat:keyword ?uri ; \n\
FILTER (contains( ?description, "'+ this.Form.value.keyword +'") || contains( ?title, "'+ this.Form.value.keyword +'"))\n\
.\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