Closed github-actions[bot] closed 1 month ago
This issue has been reviewed and marked as 'ready'. The description has been updated with testable acceptance criteria, and relevant library documents ([], 0 in total) have been added as comments.
Implement --capital-cities CLI command, add tests and documentation
Workflow name: transformation-07.1-in-progress-issue-to-ready-issue Workflow run URL: https://github.com/xn-intenton-z2a/repository0/actions/runs/15264121815 Workflow event: schedule Workflow inputs: null HEAD of main URL: https://github.com/xn-intenton-z2a/repository0/commit/0b42cfc480d3ab87ca12cb89a434566d8c93a6c3
The feature branch has been merged: agentic-lib-issue-2288
Workflow name: flow-publish-stats Workflow run URL: https://github.com/xn-intenton-z2a/repository0/actions/runs/15264193216 Workflow event: workflow_run Workflow inputs: null HEAD of main URL: https://github.com/xn-intenton-z2a/repository0/commit/9f275b397467fa5e738e55faa2f801c92aabdd04
Workflow name: flow-publish-stats Workflow run URL: https://github.com/xn-intenton-z2a/repository0/actions/runs/15264202881 Workflow event: schedule Workflow inputs: null HEAD of main URL: https://github.com/xn-intenton-z2a/repository0/commit/9f275b397467fa5e738e55faa2f801c92aabdd04
Workflow name: transformation-07-code-to-close-issue Workflow run URL: https://github.com/xn-intenton-z2a/repository0/actions/runs/15264554320 Workflow event: schedule Workflow inputs: null HEAD of main URL: https://github.com/xn-intenton-z2a/repository0/commit/6eb7f5bf94d291603e82a2425a5fbdcf7b95915d
The --capital-cities
feature is fully implemented with both stdout and file output, comprehensive unit tests pass, and the README has been updated to document the new CLI command. The solution directly addresses the issue’s core functionality and adds substantial user value by enabling OWL ontology generation for capital cities.
None
The issue has been automatically resolved and the fix has been merged.
The --capital-cities
feature is fully implemented with both stdout and file output, comprehensive unit tests pass, and the README has been updated to document the new CLI command. The solution directly addresses the issue’s core functionality and adds substantial user value by enabling OWL ontology generation for capital cities.
Objective
Add a new CLI command
--capital-cities
to fetch a list of countries and their capital cities from the Rest Countries API, transform the results into an OWL ontology JSON, and either print it to stdout or write it to a file when--output <path>
is provided.Acceptance Criteria
CLI Invocation
node src/lib/main.js --capital-cities
:https://restcountries.com/v3.1/all
.ontology
, containing:classes: ["Country", "City"]
objectProperties: [{ name: "hasCapital", domain: "Country", range: "City" }]
individuals
: oneCountry
individual per country (withid
= country code), oneCity
individual per capital (withid
= city name), and one triple for each country linking it to its capital via thehasCapital
property.JSON.parse(output)
should not throw).File Output
node src/lib/main.js --capital-cities --output <path>
:<path>
containing the exact same JSON structure as above.fs.promises.writeFile()
to create or overwrite<path>
.Unit Tests
global.fetch
to return a sample array:main(["--capital-cities"])
spies onconsole.log
:console.log
was called once with the correct stringified JSON.JSON.parse(spyCallArg)
matches the expected object structure.main(["--capital-cities","--output","out.json"])
stubsfs.promises.writeFile
:'out.json'
and the correct JSON string.Documentation
README.md
, under CLI Usage, add a section:MISSION.md
.Verification
npm test
).node src/lib/main.js --capital-cities
prints valid JSON.node src/lib/main.js --capital-cities --output sample.json
createssample.json
with correct content._No other files beyond
src/lib/main.js
,tests/unit/main.test.js
, andREADME.md
should be modified. This implements the coreCAPITAL_CITIES
feature._