Skip to content

Commit 704136a

Browse files
docs: Clarify CLI help text to align with databus hierarchy (#47)
* docs: clarify CLI terminology to align with Databus model (Artifact vs Version) * required changes * docs: clarify CLI terminology - rename title/abstract/description to artifact_* * refactor: rename artifact metadata vars and update CLI help docs * Delete help_output.txt
1 parent 4e66475 commit 704136a

File tree

3 files changed

+39
-34
lines changed

3 files changed

+39
-34
lines changed

databusclient/api/deploy.py

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,9 @@ def _create_distributions_from_metadata(
310310

311311
def create_dataset(
312312
version_id: str,
313-
title: str,
314-
abstract: str,
315-
description: str,
313+
artifact_version_title: str,
314+
artifact_version_abstract: str,
315+
artifact_version_description: str,
316316
license_url: str,
317317
distributions: List[str],
318318
attribution: str = None,
@@ -330,12 +330,12 @@ def create_dataset(
330330
----------
331331
version_id: str
332332
The version ID representing the Dataset. Needs to be in the form of $DATABUS_BASE/$ACCOUNT/$GROUP/$ARTIFACT/$VERSION
333-
title: str
334-
The title text of the dataset
335-
abstract: str
336-
A short (one or two sentences) description of the dataset
337-
description: str
338-
A long description of the dataset. Markdown syntax is supported
333+
artifact_version_title: str
334+
Artifact & Version Title: used for BOTH artifact and version. Keep stable across releases; identifies the data series.
335+
artifact_version_abstract: str
336+
Artifact & Version Abstract: used for BOTH artifact and version (max 200 chars). Updating it changes both artifact and version metadata.
337+
artifact_version_description: str
338+
Artifact & Version Description: used for BOTH artifact and version. Supports Markdown. Updating it changes both artifact and version metadata.
339339
license_url: str
340340
The license of the dataset as a URI.
341341
distributions: str
@@ -422,9 +422,9 @@ def create_dataset(
422422
artifact_graph = {
423423
"@id": artifact_id,
424424
"@type": "Artifact",
425-
"title": title,
426-
"abstract": abstract,
427-
"description": description,
425+
"title": artifact_version_title,
426+
"abstract": artifact_version_abstract,
427+
"description": artifact_version_description,
428428
}
429429
graphs.append(artifact_graph)
430430

@@ -434,9 +434,9 @@ def create_dataset(
434434
"@type": ["Version", "Dataset"],
435435
"@id": _versionId,
436436
"hasVersion": version,
437-
"title": title,
438-
"abstract": abstract,
439-
"description": description,
437+
"title": artifact_version_title,
438+
"abstract": artifact_version_abstract,
439+
"description": artifact_version_description,
440440
"license": license_url,
441441
"distribution": distribution_list,
442442
}
@@ -512,9 +512,9 @@ def deploy(
512512
def deploy_from_metadata(
513513
metadata: List[Dict[str, Union[str, int]]],
514514
version_id: str,
515-
title: str,
516-
abstract: str,
517-
description: str,
515+
artifact_version_title: str,
516+
artifact_version_abstract: str,
517+
artifact_version_description: str,
518518
license_url: str,
519519
apikey: str,
520520
) -> None:
@@ -527,12 +527,12 @@ def deploy_from_metadata(
527527
List of file metadata entries (see _create_distributions_from_metadata)
528528
version_id : str
529529
Dataset version ID in the form $DATABUS_BASE/$ACCOUNT/$GROUP/$ARTIFACT/$VERSION
530-
title : str
531-
Dataset title
532-
abstract : str
533-
Short description of the dataset
534-
description : str
535-
Long description (Markdown supported)
530+
artifact_version_title : str
531+
Artifact & Version Title: used for BOTH artifact and version.
532+
artifact_version_abstract : str
533+
Artifact & Version Abstract: used for BOTH artifact and version.
534+
artifact_version_description : str
535+
Artifact & Version Description: used for BOTH artifact and version.
536536
license_url : str
537537
License URI
538538
apikey : str
@@ -542,9 +542,9 @@ def deploy_from_metadata(
542542

543543
dataset = create_dataset(
544544
version_id=version_id,
545-
title=title,
546-
abstract=abstract,
547-
description=description,
545+
artifact_version_title=artifact_version_title,
546+
artifact_version_abstract=artifact_version_abstract,
547+
artifact_version_description=artifact_version_description,
548548
license_url=license_url,
549549
distributions=distributions,
550550
)

databusclient/cli.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ def app():
2929
help="Target databus version/dataset identifier of the form "
3030
"<https://databus.dbpedia.org/$ACCOUNT/$GROUP/$ARTIFACT/$VERSION>",
3131
)
32-
@click.option("--title", required=True, help="Dataset title")
33-
@click.option("--abstract", required=True, help="Dataset abstract max 200 chars")
34-
@click.option("--description", required=True, help="Dataset description")
32+
@click.option("--title", required=True, help="Artifact & Version Title: used for BOTH artifact and version. Keep stable across releases; identifies the data series.")
33+
@click.option("--abstract", required=True, help="Artifact & Version Abstract: used for BOTH artifact and version (max 200 chars). Updating it changes both artifact and version metadata.")
34+
@click.option("--description", required=True, help="Artifact & Version Description: used for BOTH artifact and version. Supports Markdown. Updating it changes both artifact and version metadata.")
3535
@click.option(
3636
"--license", "license_url", required=True, help="License (see dalicc.net)"
3737
)
@@ -86,7 +86,12 @@ def deploy(
8686
click.echo(f"Deploying dataset version: {version_id}")
8787

8888
dataid = api_deploy.create_dataset(
89-
version_id, title, abstract, description, license_url, distributions
89+
version_id=version_id,
90+
artifact_version_title=title,
91+
artifact_version_abstract=abstract,
92+
artifact_version_description=description,
93+
license_url=license_url,
94+
distributions=distributions
9095
)
9196
api_deploy.deploy(dataid=dataid, api_key=apikey)
9297
return

tests/test_deploy.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ def test_empty_cvs():
9393

9494
dataset = create_dataset(
9595
version_id="https://dev.databus.dbpedia.org/user/group/artifact/1970.01.01/",
96-
title="Test Title",
97-
abstract="Test abstract blabla",
98-
description="Test description blabla",
96+
artifact_version_title="Test Title",
97+
artifact_version_abstract="Test abstract blabla",
98+
artifact_version_description="Test description blabla",
9999
license_url="https://license.url/test/",
100100
distributions=dst,
101101
)

0 commit comments

Comments
 (0)