Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V3 added to unit tests #210

Merged
merged 13 commits into from
Nov 8, 2024
Merged
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
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
venv
__pycache__
node_modules
package.json
package-lock.json

34 changes: 23 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,14 @@ The `examples` folder contains example files, including some supplied
by Business Wire. Examples show how NewsML 1.2 files convert to their
equivalents in ninjs.

Two versions of ninjs: ninjs 1.4 and ninjs 2.0
Three versions of ninjs: ninjs 1.5, ninjs 2.1 and ninjs 3.0
-------------------------

This repository specifies both the 1.4 and 2.0 versions of ninjs.
This repository specifies all versions of ninjs.

The 1.x series adds new features to the version of ninjs that started
with ninjs 1.0 back in 2013, in a way that is fully backwards
compatible. The latest release in this series is 1.4, which includes
new fields _contentcreated_, _expires_ and _rightsinfo_. The 1.4
version of ninjs was approved by the IPTC Standards Committee on May
18th, 2022.
compatible. The latest release in this series is 1.5.

The 2.x series fixes some issues that made the 1.x series tricky for
developers to work with. The main change is that we avoid the use of
Expand All @@ -50,15 +47,25 @@ October 20th, 2021.
An errata update was made in May 2022 to fix a problem with the way GeoJSON
properties were integrated into the "places" object.

The 3.x series is a major update to ninjs, which is not backwards compatible.

Version 3.0 offers three document types, the existing "newsItem" and a new
document types event and planning. For improved readability and for aligning
with general best practise for variable naming and graphQL the properties now
use camel case.

The 3.0 version of ninjs was approved by the IPTC Standards Committee on
October 2nd, 2024.

Which version should I choose for my project?
-------------------------

If you are starting a green-field project, we recommend using ninjs 2.0.
If you are starting a green-field project, we recommend using ninjs 3.0.
This version should be easiest for developers to work with.

If you are already using a 1.x version of ninjs, we recommend at least
upgrading to version 1.4. This should be an easy change, because 1.4 is
backwards-compatible with versions 1.0, 1.1, 1.2 and 1.3.
upgrading to version 1.5. This should be an easy change, because 1.5 is
backwards-compatible with all previous versions of 1.x.

Protocol Buffers demo
---------------------
Expand All @@ -76,7 +83,7 @@ Unit tests
----------

To run unit tests in the `validation/test_suite` folder against each
of the ninjs 1.0, 1.1, 1.2, 1.3, 1.4 and 2.0 schemas, run the following
of the ninjs 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 2.0, 2.1 and 3.0 schemas, run the following
tool in a command/terminal window:

pip install -r validation/python/requirements.txt
Expand All @@ -86,6 +93,11 @@ We automatically run unit tests on every commit using CircleCI. The
badge above the title on this page indicates the current status of the
unit tests.

Additionaly the same unit test suite can be run via Javascript with the following: -

npm install
npm test

Dev schema
----------

Expand All @@ -102,5 +114,5 @@ ninjs Generator
---------------

In the `generator` folder is the source code to the ninjs generator, a
user-facing tool to generate sample ninjs files of either 1.4 or 2.0 version, which is hosted at
user-facing tool to generate sample ninjs files of either 1.5 or 2.1 version, which is hosted at
https://www.iptc.org/std/ninjs/generator/.
2 changes: 1 addition & 1 deletion examples/2.1/schema-extension/extension-schema.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "http://www.example.com/ninjs-extension#",
"$id": "https://www.example.com/ninjs-extension#",
"type": "object",
"title": "Example extension of ninjs",
"description": "All properties from IPTC ninjs 2.1 are valid, plus some extra properties that we define here.",
Expand Down
4 changes: 2 additions & 2 deletions examples/3.0/20231005-65-addb-event.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "3.0",
"schema": "http://www.iptc.org/std/ninjs/ninjs-schema_3.0.json"
},
"uri": "urn:newsml:addb.no:20140226:0065-ninjs2.2-addb--event-test",
"uri": "urn:newsml:addb.no:20140226:0065-ninjs3.0-addb--event-test",
"type": "event",
"genres": [
{
Expand Down Expand Up @@ -56,4 +56,4 @@
"uri": "https://www.aepsad.gob.es"
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"uri": "https://antidopingdatabase.com/news/anti-doping-measures-at-the-tour-down-under-will-be-the-toughest-ever",
"standard": {
"name": "ninjs",
"version": "2.2",
"schema": "http://www.iptc.org/std/ninjs/ninjs-schema_2.2.json"
"version": "3.0",
"schema": "http://www.iptc.org/std/ninjs/ninjs-schema_3.0.json"
},
"type": "text",
"representationType": "full",
Expand Down
Loading