Skip to content
Open
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
16 changes: 8 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v6.0.0
hooks:
- id: check-json
- id: check-yaml
Expand All @@ -15,34 +15,34 @@ repos:
- id: yamlfmt

- repo: https://github.com/mgedmin/check-manifest
rev: '0.49'
rev: '0.51'
hooks:
- id: check-manifest

- repo: https://github.com/psf/black
rev: 23.3.0
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 26.1.0
hooks:
- id: black

- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
rev: 7.3.0
hooks:
- id: flake8
args: [--count, --show-source, --statistics]

- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.3.0
rev: v3.2.0
hooks:
- id: setup-cfg-fmt

- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 7.0.0
hooks:
- id: isort
args: [--profile, black, --filter-files]

- repo: https://github.com/asottile/pyupgrade
rev: v3.6.0
rev: v3.21.2
hooks:
- id: pyupgrade
args: [--py38-plus]
1 change: 1 addition & 0 deletions examples/mp_api.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Simple script illustrating some of the features of this package."""

from pprint import pprint

from fastapi.responses import HTMLResponse
Expand Down
1 change: 1 addition & 0 deletions marketplace/app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.. currentmodule:: marketplace.app
.. moduleauthor:: Pablo de Andres, Pranjali Singh (Fraunhofer IWM)
"""

from typing import Optional

from packaging.version import parse
Expand Down
24 changes: 8 additions & 16 deletions marketplace/datasink_client/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,13 @@ def get_datasets_uid_sparql(collections):
g = Graph()
g.parse(data=collections, format="json-ld")

qrs = g.query(
"""
qrs = g.query("""
SELECT ?asource ?id
WHERE {
?asource a <http://www.w3.org/ns/dcat#Dataset> .
?asource <http://purl.org/dc/terms/identifier> ?id.
}
"""
)
""")

for row in qrs:
uid_list.append(row.id.value)
Expand All @@ -46,15 +44,13 @@ def get_collections_uid_sparql(collections):
g = Graph()
g.parse(data=collections, format="json-ld")

qrs = g.query(
"""
qrs = g.query("""
SELECT ?asource ?id
WHERE {
?asource a <http://www.w3.org/ns/dcat#Catalog> .
?asource <http://purl.org/dc/terms/identifier> ?id.
}
"""
)
""")

for row in qrs:
uid_list.append(row.id.value)
Expand All @@ -74,16 +70,14 @@ def get_collections_from_catalog(collections):
g = Graph()
g.parse(data=collections, format="json-ld")

qrs = g.query(
"""
qrs = g.query("""
SELECT ?asource ?identifier ?subject ?title
WHERE {
?asource a <http://www.w3.org/ns/dcat#Catalog> .
?asource <http://purl.org/dc/terms/identifier> ?identifier.
?asource <http://purl.org/dc/terms/title> ?title.
}
"""
)
""")

for row in qrs:
inf_packages.append(row.identifier.value)
Expand Down Expand Up @@ -214,8 +208,7 @@ def get_datasets_from_catalog(datasets):
g = Graph()
g.parse(data=datasets, format="turtle")

qrs = g.query(
"""
qrs = g.query("""
SELECT ?asource ?identifier ?isPartOf ?title ?spatial
WHERE {
?asource a <http://www.w3.org/ns/dcat#Dataset> .
Expand All @@ -224,8 +217,7 @@ def get_datasets_from_catalog(datasets):
?asource <http://purl.org/dc/terms/title> ?title.
?asource <http://purl.org/dc/terms/spatial> ?spatial.
}
"""
)
""")

for row in qrs:
dataset = {}
Expand Down
3 changes: 1 addition & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ license = MIT
license_files = LICENSE
classifiers =
Development Status :: 2 - Pre-Alpha
License :: OSI Approved :: MIT License
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: Implementation :: CPython
Expand All @@ -27,7 +26,7 @@ install_requires =
rdflib==6.2.0
rdflib-jsonld==0.6.2
requests>2.26.0,<3.0
python_requires = >=3.8
python_requires = >=3.10

[options.entry_points]
console_scripts =
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""This file is required for editable installs of the package."""

from setuptools import setup

setup()
1 change: 1 addition & 0 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

.. moduleauthor:: Carl Simon Adorf <simon.adorf@epfl.ch>
"""

import pytest

from marketplace.client import MarketPlaceClient
Expand Down
Loading