https://github.com/clariah/vocabulary-recommender
Science Score: 23.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
○codemeta.json file
-
○.zenodo.json file
-
✓DOI references
Found 1 DOI reference(s) in README -
✓Academic publication links
Links to: springer.com -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.2%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: CLARIAH
- Language: TypeScript
- Default Branch: main
- Size: 274 KB
Statistics
- Stars: 4
- Watchers: 9
- Forks: 0
- Open Issues: 6
- Releases: 0
Metadata Files
README.md
Vocabulary Recommender Command-line interface (CLI)
The vocabulary recommender CLI provides a recommendation interface which returns relevant Internationalized Resource Identifiers (IRIs) based on the search input. It works with SPARQL or Elasticsearch endpoints which contain relevant vocabulary datasets.
Homogeneous recommendations
The vocabulary recommender supports multiple search terms. The algorighm minimizes the number of vocabularies required for a set of recommendations. For example, the result sdo:Person sdo:knows would be preferred above sdo:Person foaf:knows, because the former only requires one vocabulary, whereas the latter requires two. A comprehensive literature study has been conducted to find a suitable algorithm, which resulted in using combiSQORE.
Installation
A. When pulling this repository from GitHub:
- Run
yarnto install the dependencies. - Run
yarn buildto generate the JavaScript code. - Run
yarn recommendto run the JavaScript code. > Runyarn recommend --helpto see which arguments can be specified.
An example query looks as follows:
yarn recommend -t person -c class
New to yarn? The instructions to download and install yarn can be found (here).
B. When installing the npm package "vocabulary-recommender":
The npm package can be installed with:
yarn add vocabulary-recommender or npm i vocabulary-recommender
The command vocabulary-recommender <input arguments> only works from any directory in terminal when this package is installed globally!
NOTE: For safety reasons, it is NOT recommended to install npm packages globally! But if you wish to have easier access and have a true CLI experience, this can be done with the command:
yarn global add vocabulary-recommenderOtherwise, just change directory (cd) to the location where the package was installed.
Configuration
Configuration file
The configuration file conf.json is created during the first run of the vocabulary recommender and saved in the project directory. It has the following format:
json
{
defaultEndpoint: "defaultkey",
defaultQueryClass: "defaultQueryClass.rq",
defaultQueryProperty: "defaultQueryProperty.rq",
defaultQueryESClass: "./queries/defaultESClass.json",
defaultQueryESProperty: "./queries/defaultESProp.json",
endpoints: {
"defaultkey": {
type: "search",
url: "https://api.endpoint.nl/",
},
"otherkey": {
type: "sparql",
url: "https://api.endpoint.nl/sparql",
queryClass: "configuredQueryClass.rq",
queryProperty: "configuredQueryProperty.rq",
},
},
}
Endpoint Configuration: In the configuration file, endpoints can be specified by providing the endpoints key name, together with the key url and the key type of the endpoint. A default endpoint can be set using the key name of the endpoint.
To specify the endpoint(s) that is/are used, add the -e flag and the endpoint name to the input command:
yarn recommend -t person -c class -e otherkey
When no endpoint is specified, the default endpoint is used automatically. When the number of endpoints is less than the number of search terms, the default endpoint is used for the rest of the search terms.
yarn recommend -t person -c class -> defaultkey is queried.
yarn recommend -t person knows -c class property -e otherkey -> otherkey is queried for the search term 'person'. defaultkey is used for the search term 'knows'.
Query Configuration:
Four default queries must be specified: defaultQueryClass, defaultQueryProperty, defaultQueryESClass and defaultQueryESProperty. It is also possible to specify specific configured queries under the queryClass and queryProperty keys. The query corresponding to the set category (class / property) is selected automatically according to the configuration. The SPARQL queries should be stored in a file with the extension .rq and should contain the searchterm ${term} in the following format:
sql
select ?iri ?desc ?score where {
filter(regex(str(?iri),'${term}','i'))
?iri dct:description ?desc .
}
SPARQL queries must always return the variables iri and score. Elasticsearch queries must always return the _id and the _score which are retrieved by using bool queries. They should be stored in a .json file.
The results always return the same information that the query returns. That means that our previous example would not only return the iri and the score but also the description.
Preferred vocabularies configuration
You also configure a preference ordering of vocabularies by passing a dictionary with your preferred vocabularies as a parameter when calling the homogeneousRecommendation() function. The key is the prefix of the vocabulary, and the value represents the importance of the vocabulary. Internally, the preference ordering works by exploiting the fact that the ordering of vocabularies influences the result of the combiSQORE algorithm that has been chosen for the vocabulary recommender.
ts
{
"prefix1": 10,
"prefix2": 15
}
Output as JSON
Because of the use of yarn, using yarn recommend <searchTerm> <category> <endpoint> -f json > example.json will create a json file that does not have the correct syntax due to the added yarn information.
To avoid this behaviour, run the script directly with node: node --no-warnings ./dist/recommend <searchTerm> <category> <endpoint> -f json > example.json
Owner
- Name: CLARIAH
- Login: CLARIAH
- Kind: organization
- Website: http://www.clariah.nl
- Repositories: 65
- Profile: https://github.com/CLARIAH
CLARIAH offers humanities scholars a Common Lab providing access to large collections of digital resources and innovative tools for research
GitHub Events
Total
Last Year
Committers
Last synced: over 1 year ago
Top Committers
| Name | Commits | |
|---|---|---|
| Jana Grimm | j****m@t****c | 81 |
| Philippe Renzen | p****n@t****c | 33 |
| Kathrin Dentler | k****n@d****g | 16 |
| Wouter Beek | w****r@t****c | 6 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 12 months ago
All Time
- Total issues: 10
- Total pull requests: 8
- Average time to close issues: 18 days
- Average time to close pull requests: 3 days
- Total issue authors: 4
- Total pull request authors: 3
- Average comments per issue: 0.8
- Average comments per pull request: 0.5
- Merged pull requests: 6
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- rlzijdeman (4)
- philipperenzen (3)
- kathrinrin (2)
- kerim1 (1)
Pull Request Authors
- janaGrimm (4)
- wouterbeek (2)
- philipperenzen (2)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- @types/lodash ^4.14.186 development
- @types/node 14 development
- @types/node-fetch ^2.6.2 development
- @types/yargs ^17.0.12 development
- typescript * development
- lodash ^4.17.21
- node-fetch ^2.6.7
- yargs ^17.5.1
- @types/lodash 4.14.186
- @types/node 18.7.15
- @types/node 14.18.27
- @types/node-fetch 2.6.2
- @types/yargs 17.0.12
- @types/yargs-parser 21.0.0
- ansi-regex 5.0.1
- ansi-styles 4.3.0
- asynckit 0.4.0
- cliui 7.0.4
- color-convert 2.0.1
- color-name 1.1.4
- combined-stream 1.0.8
- delayed-stream 1.0.0
- emoji-regex 8.0.0
- escalade 3.1.1
- form-data 3.0.1
- get-caller-file 2.0.5
- is-fullwidth-code-point 3.0.0
- lodash 4.17.21
- mime-db 1.52.0
- mime-types 2.1.35
- node-fetch 2.6.7
- require-directory 2.1.1
- string-width 4.2.3
- strip-ansi 6.0.1
- tr46 0.0.3
- typescript 4.8.4
- webidl-conversions 3.0.1
- whatwg-url 5.0.0
- wrap-ansi 7.0.0
- y18n 5.0.8
- yargs 17.5.1
- yargs-parser 21.1.1