Skip to content

Commit

Permalink
Merge pull request #8 from cedadev/sparql_test2
Browse files Browse the repository at this point in the history
Poetry Update and SPARQL Query Removal
  • Loading branch information
dwest77a authored Jan 22, 2025
2 parents 790fa73 + e1a1411 commit f46ec09
Show file tree
Hide file tree
Showing 16 changed files with 6,042 additions and 1,347 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Automatic Test

on:
- push
- pull_request

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip3 install .
pip3 install -r requirements_fix.txt
- name: Run tests
run: pytest
44 changes: 44 additions & 0 deletions docs/triple_store_removal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Notes for removing triple store

## SPARQL Query requests:

### get_concepts_in_scheme

From all items, verify in scheme, pull out ID and verify in endpoints list, then get prefLabel.

### get_alt_concepts_in_scheme

From all items, verify in scheme, pull out ID and verify in endpoints list, then get altLabel.

### get_broader

Does something interesting with a request for 'narrower'

### get_alt_label

Links to get nerc or get ceda alt_label. Still just getting alt or pref labels.

## Facet Object Components

### __facets private attribute
- `facets[facet]` = dict of concepts arranged by label/concept (@value - prefLabel/@id)
- `facets[facet-alt]` = same as above but with (@value - altLabel/@id)
- `facets[broader-processing-level]` = get alt level for proc level mappings.

## __proc_level_mappings
- `proc_level_mappings[proc_level.uri]` - @id from above facet = single item(concept) from records that contain a 'narrower' option.

## __platform_program_mappings
- `platform_program_mappings[platform.uri]` - @id from above facet = single item(label) from records that contain a 'narrower' option.

## __programme_group_mappings
- `programme_group_mappings[single item(concept)]` - from above = single item(label) from other records that contain a 'narrower' option.

## __reversible_facet_mappings
- Reversed mappings for each facet, makes construction of mappings easier.

## FACET_ENDPOINTS
- Defined config values

## LABEL_SOURCE
- Defined config values
869 changes: 235 additions & 634 deletions poetry.lock

Large diffs are not rendered by default.

57 changes: 29 additions & 28 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,45 +1,46 @@
[tool.poetry]
[project]
name = "tag-scanner"

version = "2.1.9"
version = "2.2.0"
description = "This package provides a command line tool moles_esgf_tag to generate dataset tags for both MOLES and ESGF."
license = "{file='LICENSE'}"
license = "BSD 3"
readme = "README.md"

authors = ["Daniel Westwood <[email protected]>", "Antony Wilson <[email protected]>"]

authors = [
{ name = "Daniel Westwood", email = "[email protected]"},
{ name = "Antony Wilson", email = "[email protected]"}
]
classifiers = [
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
]

include = [
{ path = "templates/*.html" },
{ path = "conf/tag_check.conf" }
{ path = "conf/tag_check.conf" },
{ path = "tag_scanner/tests/*"}
]
dependencies = [
"verboselogs>=1.7",
"elasticsearch (>=7.6.0,<7.7)",
"tqdm (>=4.45.0,<5)",
"pytest<8.3.3",
"jinja2 (>=3,<4)",
"numpy (>=1.25,<2.0)",
"netcdf4 (>=1.7.2,<2.0.0)",
"six (>=1.16.0,<2.0.0)",
"requests (>=2.32.3,<3.0.0)",
# "directory-tree @ https://github.com/cedadev/ceda-directory-tree.git"
]

[tool.poetry.dependencies]
python = ">=3.8,<4.0"
verboselogs = "1.7"
elasticsearch = "7.6.0"
tqdm = "^4.45.0"
pytest = "^8.3.3"
jinja2 = "^3"
directory-tree = { git = "https://github.com/cedadev/ceda-directory-tree.git", tag = "v1.1.4"}

sparqlwrapper = "^2.0.0"
netcdf4 = "^1.7.2"
six = "^1.16.0"
requires-python = ">=3.9,<4"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.poetry.scripts]
[project.scripts]
moles_esgf_tag = "tag_scanner.scripts:CCITaggerCommandLineClient.main"
cci_json_check = "tag_scanner.scripts:TestJSONFile.cmd"
cci_check_tags = "tag_scanner.scripts.check_tags:main"
Expand Down
1 change: 1 addition & 0 deletions requirements_fix.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://github.com/cedadev/ceda-directory-tree/archive/v1.1.5.tar.gz
2 changes: 2 additions & 0 deletions tag_scanner/dataset/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
__copyright__ = 'Copyright 2024 United Kingdom Research and Innovation'
__license__ = 'BSD - see LICENSE file in top-level package directory'
__contact__ = '[email protected]'

from .dataset import Dataset
Loading

0 comments on commit f46ec09

Please sign in to comment.