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 .changeset/lov-rail-vocabularies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@matdata/yasqe": patch
---

The bundled class and property suggestions always include the ERA ontology (`era:`), railML 3 (`railml:`) and RailTopoModel (`rtm:`), which are not in the LOV dump.
2 changes: 1 addition & 1 deletion docs/developer-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,7 @@ Return the terms most used first; Yasqe filters them on what the user typed and

#### Linked Open Vocabularies Terms

The LOV suggestions come from `packages/yasqe/src/lov-terms.json`, which is bundled with Yasqe: no request is made to the LOV API at runtime. The file holds the classes and properties of the most used LOV vocabularies (ranked by the number of vocabularies that use them, up to about 600 KB) and is generated from the LOV N-Quads dump:
The LOV suggestions come from `packages/yasqe/src/lov-terms.json`, which is bundled with Yasqe: no request is made to the LOV API at runtime. The file holds the classes and properties of the most used LOV vocabularies (ranked by the number of vocabularies that use them, up to about 600 KB) and is generated from the LOV N-Quads dump. The namespaces in `ALWAYS_INCLUDED` in `fetchLovData.js` (the ERA ontology, railML 3 and RailTopoModel) are added first, whatever their rank or the size budget, and their terms are read from the vocabulary's own source when the dump has none:

```bash
npm run util:fetchLov # downloads https://lov.linkeddata.es/lov.nq.gz
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ Ctrl+clicking on `http://dbpedia.org/resource/European_Union` automatically quer
Press `Ctrl+Space` after `a` (or `rdf:type`) to get class suggestions, or in the position of a property to get property suggestions. MatGUI suggests:

1. **Used in this endpoint**: the classes and properties the endpoint of the tab actually uses, most used first, with the number of instances (classes) or triples (properties) next to them. This also covers vocabularies that are not registered anywhere, such as railML 3, the ERA ontology or your own ontologies.
2. **Linked Open Vocabularies**: matching classes and properties of the most used vocabularies in [LOV](https://lov.linkeddata.es/dataset/lov/). MatGUI ships this list, so no request is made to LOV while you type. Terms that the endpoint already suggested are not repeated, and a term is inserted as a prefixed name with its `PREFIX` when LOV knows the vocabulary's preferred prefix.
2. **Linked Open Vocabularies**: matching classes and properties of the most used vocabularies in [LOV](https://lov.linkeddata.es/dataset/lov/). MatGUI ships this list, so no request is made to LOV while you type. Terms that the endpoint already suggested are not repeated, and a term is inserted as a prefixed name with its `PREFIX` when LOV knows the vocabulary's preferred prefix. The ERA ontology (`era:`), railML 3 (`railml:`) and RailTopoModel (`rtm:`) are always included, even though they are not in LOV.

Without typing anything, the endpoint's most used terms are listed. While you type, a suggestion matches on its full IRI, its prefixed name (`era:Op`) or, when you type a plain word (`Operat`), on any part of its local name.

Expand Down
12 changes: 12 additions & 0 deletions fetchLovData.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ export const ALWAYS_INCLUDED = [
"https://gitlab.com/era-europa-eu/public/interoperable-data-programme/era-ontology/era-ontology/-/raw/main/ontology.ttl",
],
},
{
// railML 3 ontology (not in LOV)
namespace: "http://ontology.railml.org/railml3#",
prefix: "railml",
sources: ["https://ontology.railml.org/ontology.ttl"],
},
{
// RailTopoModel, as published in the railML ontology
namespace: "http://ontology.railml.org/railtopomodel#",
prefix: "rtm",
sources: ["https://ontology.railml.org/ontology.ttl"],
},
];

const RDF_TYPE = "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";
Expand Down
2 changes: 1 addition & 1 deletion packages/yasqe/src/lov-terms.json

Large diffs are not rendered by default.

Loading