Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Export cleaned so that it doesn't contain irrelevant columns (#242).
- Documented and tested SPARQL query restrictions (#243).

## [2.1.1] - 2025-10-14

### Changed
Expand Down
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Table of contents:
* [Static, production build](#static-production-build)
* [Logging in](#logging-in)
* [Configuration file](#configuration-file)
* [Writing SPARQL queries](#writing-sparql-queries)
* [Specifying sources](#specifying-sources)
* [About httpProxies](#about-httpproxies)
* [Adding variable type](#adding-variable-type)
Expand Down Expand Up @@ -154,7 +155,7 @@ The configuration file must follow the structure shown below.
"logoLocation": "Image location of the logo shown at the top of the app (relative to public folder.).",
"logoRedirectURL": "The URL the Web application redirects to when a user clicks on the logo.",
"defaultIDP": "The default value used for IDP when logging in, this IDP can be manually changed in the Web app as well. ",
"queryFolder": "The base location of the queries, all query locations will start from this folder (relative to public folder).",
"queryFolder": "The base location of the SPARQL queries, all query locations will start from this folder (relative to public folder).",
"introductionText": "The text that the app shows on the dashboard, which the app also shows when you first open it.",
"queryGroups" : [
{
Expand All @@ -167,7 +168,7 @@ The configuration file must follow the structure shown below.
{
"id": "A unique ID for the query. This ID appears in the URL of the displayed result. Queries are ordered in the menu according to ascending ID.",
"queryGroupId": "ID of the query group too which this query belongs. If not given, the query is displayed outside existing groups.",
"queryLocation": "Path to the query location, relative to 'queryFolder'",
"queryLocation": "Path to the SPARQL query location, relative to 'queryFolder'",
"name": "A name for the query",
"description": "Description of the query",
"icon": "The key to the icon for the query. This is optional and a default menu icon will be used when left empty.",
Expand Down Expand Up @@ -213,6 +214,16 @@ The configuration file must follow the structure shown below.
}
```

### Writing SPARQL queries

Write each [SPARQL query](https://www.w3.org/TR/sparql11-query/) in a separate file (see `queryLocation` in the configuration file).

The following restrictions apply to SPARQL queries in Miravi:

* Mark your query variables with `?`, not with `$`. The `$` sign is reserved for use in [templated queries](#templated-queries).
* Do not use `_` in variable names, unless for [adding variable type](#adding-variable-type).
* Do not use `id` as a variable name. It is reserved for internal use.

### Specifying sources

The set of sources over which a query will be executed is derived from two *optional* inputs in a query entry:
Expand Down
12 changes: 12 additions & 0 deletions main/configs/test/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,18 @@
],
"lenient": true
}
},
{
"id": "9300",
"queryGroupId": "gr-test",
"queryLocation": "idols_id.rq",
"name": "Reserved variable name test",
"description": "Tests a query with a reserved variable name.",
"comunicaContext": {
"sources": [
"http://localhost:8000/example/idols"
]
}
}
]
}
9 changes: 9 additions & 0 deletions main/configs/test/public/queries/idols_id.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
PREFIX schema: <http://schema.org/>

SELECT ?id ?birthDate_int WHERE {
?list schema:name ?listTitle;
schema:itemListElement [
schema:name ?id;
schema:birthDate ?birthDate_int;
].
}
Loading