-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bef4b98
commit e5cca80
Showing
7 changed files
with
130 additions
and
66 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
...atakatalog/Søk_og_filter/Filter/_index.md → ...t/Felles datakatalog/Search/LLM/_index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
title: Filter | ||
title: LLM | ||
weight: 2 | ||
--- | ||
|
||
TBD | ||
TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- | ||
title: Search | ||
weight: 1 | ||
--- | ||
|
||
The service responsible for handling searches is [fdk-search-service](https://github.com/Informasjonsforvaltning/fdk-search-service), which is described by [this OpenAPI specification](https://raw.githubusercontent.com/Informasjonsforvaltning/fdk-search-service/main/openapi.yaml). | ||
|
||
Production endpoint: <https://search.api.fellesdatakatalog.digdir.no/search> | ||
Demo endpoint: <https://search.api.demo.fellesdatakatalog.digdir.no/search> | ||
Staging endpoint: <https://search.api.staging.fellesdatakatalog.digdir.no/search> | ||
|
||
Simple example using the staging endpoint: | ||
```Shell | ||
curl -X POST 'https://search.api.staging.fellesdatakatalog.digdir.no/search' -H 'Content-Type: application/json' -d '{"query":"test"}' | ||
``` | ||
|
||
### Boosting | ||
|
||
Hits from some fields will be prioritized over others, i.e. a matching hit from the title field will be prioritized over a hit from the description field | ||
|
||
### Specific resource types | ||
|
||
Each resource type has it's own endpoint, the available endpoints are `/datasets`, `/data-services`, `/concepts`, `/information-models`, `/events` and `/services` | ||
|
||
Example using the datasets endpoint: | ||
```Shell | ||
curl -X POST 'https://search.api.staging.fellesdatakatalog.digdir.no/search/datasets' -H 'Content-Type: application/json' -d '{"query":"test"}' | ||
``` | ||
|
||
### Pagination | ||
|
||
All search results will be paginated, it is possible to manipulate the size and page number with the pagination field in the search body. | ||
|
||
Example using the pagination field: | ||
```Shell | ||
curl -X POST 'https://search.api.staging.fellesdatakatalog.digdir.no/search' -H 'Content-Type: application/json' -d '{"query":"test","pagination":{"size":1,"page":5}}' | ||
``` | ||
|
||
### Filtering | ||
|
||
It's possible to filter the search result, see SearchFilters in the OpenAPI specification for a list of all possible filters. | ||
|
||
Example using the data theme filter: | ||
```Shell | ||
curl -X POST 'https://search.api.staging.fellesdatakatalog.digdir.no/search' -H 'Content-Type: application/json' -d '{"query":"test","filters":{"dataTheme":{"value":["ENVI"]}}}' | ||
``` | ||
|
||
Example using the open data filter: | ||
```Shell | ||
curl -X POST 'https://search.api.staging.fellesdatakatalog.digdir.no/search' -H 'Content-Type: application/json' -d '{"query":"test","filters":{"openData":{"value":true}}}' | ||
``` | ||
|
||
Example using the formats filter: | ||
```Shell | ||
curl -X POST 'https://search.api.staging.fellesdatakatalog.digdir.no/search' -H 'Content-Type: application/json' -d '{"query":"test","filters":{"formats":{"value":["MEDIA_TYPE application/json"]}}}' | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
--- | ||
title: SPARQL | ||
weight: 3 | ||
--- | ||
|
||
[Read more about SPARQL here](https://www.w3.org/TR/sparql11-overview/). | ||
|
||
Production endpoint: <https://sparql.fellesdatakatalog.digdir.no> | ||
Demo endpoint: <https://sparql.demo.fellesdatakatalog.digdir.no> | ||
Staging endpoint: <https://sparql.staging.fellesdatakatalog.digdir.no> | ||
|
||
Simple example using the staging endpoint: | ||
```Shell | ||
curl -X POST 'https://sparql.staging.fellesdatakatalog.digdir.no/?query=SELECT%20%2A%20WHERE%20%7B%20?sub%20?pred%20?obj%20.%20%7D%20LIMIT%201' | ||
``` | ||
|
||
Data.norge.no has a simple GUI for SPARQL queries: | ||
- production <https://data.norge.no/sparql> | ||
- demo <https://demo.fellesdatakatalog.digdir.no/sparql> | ||
- staging <https://staging.fellesdatakatalog.digdir.no/sparql> | ||
|
||
### Query examples | ||
|
||
List all properties and objects where the subject is this dataset <https://staging.fellesdatakatalog.digdir.no/datasets/04edc67b-046c-37a8-9822-29f03d2f1e80>: | ||
|
||
```shell | ||
PREFIX dcat: <http://www.w3.org/ns/dcat#> | ||
PREFIX foaf: <http://xmlns.com/foaf/0.1/> | ||
PREFIX dct: <http://purl.org/dc/terms/> | ||
|
||
SELECT ?property ?object | ||
|
||
WHERE { | ||
?dataset a dcat:Dataset . | ||
?record foaf:primaryTopic ?dataset . | ||
?record a dcat:CatalogRecord . | ||
?record dct:identifier "04edc67b-046c-37a8-9822-29f03d2f1e80" . | ||
?dataset ?property ?object . | ||
} | ||
``` | ||
|
||
List all dataset titles: | ||
|
||
```shell | ||
PREFIX dcat: <http://www.w3.org/ns/dcat#> | ||
PREFIX dct: <http://purl.org/dc/terms/> | ||
|
||
SELECT ?title | ||
|
||
WHERE { | ||
?dataset a dcat:Dataset . | ||
?dataset dct:title ?title . | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
title: Search | ||
weight: 8 | ||
--- | ||
|
||
There are 3 different ways to search the data in Data.norge.no, each is based on a different technology. | ||
|
||
### Search | ||
|
||
The main search service in Data.norge.no is based on ElasticSearch. This service only searches the text in a few fields, but has filters and other advanced functionality that helps users navigate. | ||
|
||
### LLM | ||
|
||
The LLM search service uses a 'Large Language Model' (LLM) that is built from the same data used in the main search, but will accept naturally worded queries where the other search demands exact wording of titles or keywords. | ||
|
||
### SPARQL | ||
|
||
The SPARQL search service is based on the RDF query language SPARQL, and is our most advanced and powerful search. A user will have to create queries that follows the correct syntax, but will be able to search all harvested data points, not just pre-selected fields. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.