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

ninjs 3.0 release candidate, including events, planning, live streams and camelCase properties #157

Merged
merged 97 commits into from
Nov 26, 2024
Merged
Changes from 3 commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
b824e0f
Added new 2.2 schema file, with a draft first pass at handling events…
bquinn Aug 7, 2023
17ce022
Sketches for possible 2.2 updates for events (planning not done yet)
bquinn Aug 21, 2023
9c94f03
Added all coverage properties from G2 into draft ninjs schema.
bquinn Sep 5, 2023
63aafbc
Updates to align with agreed approach after last ninjs WG meeting - s…
bquinn Sep 29, 2023
6c73949
example-event: added example event
iyoung Oct 5, 2023
b026d43
example-folder: added 2.2 examples
iyoung Oct 5, 2023
0acd3ce
Create tt_event_sample
jolla56 Oct 5, 2023
53d2a4e
Rename tt_event_sample to tt_event_sample.json
jolla56 Oct 5, 2023
06779bb
Create tt_event_2.2.json
jolla56 Oct 5, 2023
e3c699d
updated simple event
iyoung Oct 9, 2023
5f85abd
Cleaned up examples
trondhuso Oct 16, 2023
ee7513e
Adding press conference example
trondhuso Oct 16, 2023
412b401
Added persons who attends the press conference
trondhuso Oct 16, 2023
ba51c45
minor changes to different addb-related events. Added a Champion Leag…
trondhuso Oct 17, 2023
637b847
Rename tt_event_sample.json to tt_event_pressconference_sample.json
jolla56 Oct 28, 2023
45262ae
Rename tt_event_2.2.json to tt_event_pressconference_2.2.json
jolla56 Oct 28, 2023
9a74a4a
Two fixes to schema so tests should now pass.
bquinn Nov 28, 2023
5b3dc87
Update version number in JSON schema header and note that this is a w…
bquinn Nov 28, 2023
98cce7e
Merge pull request #158 from iptc/events-planning-examples
bquinn Nov 28, 2023
434b7e9
Add renditions to plannedcoverage objects. Add video-specific charact…
bquinn Feb 13, 2024
37a4454
fix for cidr pattern remove ipv4 restriction
iyoung Feb 13, 2024
1de1c00
fix(duplicate-property): remove duplicate property rendition
iyoung Mar 27, 2024
4318f02
Merge pull request #167 from iptc/fix/remove-resolution
iyoung Mar 28, 2024
e686f45
feat(dates-option): support truncated and accurate dates
iyoung Apr 12, 2024
fc993fb
feat(news-item-planned): add test example planned coverage
iyoung Apr 15, 2024
3d0b5d9
Added type to association
iyoung May 13, 2024
839ac40
Merge pull request #175 from iptc/feat/news-item-test
iyoung May 13, 2024
dd364d4
feat(event-no-renditions): schema denies events with renditions
iyoung Apr 12, 2024
f7dd70f
Merge pull request #174 from iptc/feat/event-no-renditions
iyoung May 14, 2024
6ffb9e5
Adding another example with both truncated start and end dates
bquinn Jun 10, 2024
0e2c37d
Adding regex for truncated datetime based on AFP ninjs schema
bquinn Jun 10, 2024
7b7d2ab
Adding test for invalid truncateddatetime
bquinn Jun 10, 2024
e5afa11
Merge pull request #173 from iptc/feat/event-dates-option
iyoung Jun 10, 2024
5fd03a0
fix(coverage-status): use a news coverage status for coverage status
iyoung Jun 24, 2024
94858bc
fix(pubstatus): add pub status back in
iyoung Jun 24, 2024
4c6a618
Merge pull request #178 from iptc/fix/coveragestatus
iyoung Jul 9, 2024
a81403d
fix(urgency-truncated): fix for urgency type and truncated datetime
iyoung Jul 9, 2024
f7596a0
Merge pull request #182 from iptc/fix/planned-coverage-urgency
iyoung Aug 19, 2024
c0afc17
Merge branch 'main' into events-planning
bquinn Sep 2, 2024
0a63ad5
First version of a ninjs schema all in camelCase. Requires breaking c…
bquinn Sep 2, 2024
12c129f
First set of 3.0 unit tests
bquinn Sep 2, 2024
fa6958f
Enacted changes to camelCase branch agreed at yesterday's WG meeting.
bquinn Sep 3, 2024
8790f77
Add additionalProperties: false for objects where we hadn't declared it.
bquinn Sep 3, 2024
29e4423
Changing duration to expectedduration (retaining "squashed case" for …
bquinn Sep 3, 2024
84fe98a
Changing duration to expectedduration (retaining "squashed case" for …
bquinn Sep 3, 2024
78b607f
Merge branch 'expectedduration' of github.com:iptc/newsinjson into ex…
bquinn Sep 3, 2024
f24d75e
fix(2.2-schema): fixing feedback (#183)
iyoung Sep 10, 2024
a16c92a
Merge pull request #192 from iptc/expectedduration
bquinn Sep 10, 2024
3b1fe0d
Merge pull request #191 from iptc/add-additional-properties-190
bquinn Sep 10, 2024
39636c4
Merge branch 'events-planning' into camelCase
bquinn Sep 10, 2024
8b438e7
Add missing additionalProperties: false, and fix the camelCase bug
bquinn Sep 10, 2024
93b558d
Fix spelling mistake
bquinn Sep 10, 2024
a3fd630
Removed note from comment - we decided not to make the suggested change
bquinn Sep 10, 2024
ac5f081
Merge pull request #186 from iptc/camelCase
bquinn Sep 15, 2024
e641c37
Move graphql tool to top-level folder. We still need to update it
bquinn Sep 15, 2024
76bb8d7
fix(event-restrictions): relax use of schema
iyoung Sep 16, 2024
0c29831
Merge pull request #197 from iptc/remove-event-restrictions
iyoung Sep 30, 2024
a02885e
Removing many rendition properties from the ninjs 3.0 draft (#195)
bquinn Sep 30, 2024
d16188d
fix(planned-coverage): remove g2 refs and unclear properties
iyoung Sep 30, 2024
799f37c
fix(add-type): add type to planned coverage
iyoung Sep 30, 2024
5267afd
fix(planned-content): update to the naming of planned content
iyoung Oct 1, 2024
ad96728
Merge pull request #198 from iptc/planned-coverage-tidy
iyoung Oct 1, 2024
0e09bb3
samplefix
jolla56 Oct 28, 2024
509f511
fix(single-quote): minor quote change
iyoung Oct 28, 2024
4ad5920
graphfixes
jolla56 Oct 28, 2024
e790c1a
fix(v3-tests): include v3 tests in python runner
iyoung Oct 28, 2024
6d043d4
feat(v3-unit-tests): add v3 to unit tests
iyoung Oct 28, 2024
410c715
fix(v3-tests): small fixes to rights test files
iyoung Oct 28, 2024
d48e5e0
schemaupdate
jolla56 Oct 29, 2024
7fbd551
planning
jolla56 Nov 3, 2024
e480a97
Merge pull request #209 from iptc/graph3
iyoung Nov 6, 2024
ed34a68
Merge pull request #208 from iptc/samplefix
iyoung Nov 6, 2024
e4f6d7a
fix(unit-tests): update 3.0 tests to run
iyoung Nov 6, 2024
8a7dca8
fix(v3-tests): include v3 tests in python runner
iyoung Oct 28, 2024
681cdb1
feat(v3-unit-tests): add v3 to unit tests
iyoung Oct 28, 2024
303f4e6
fix(unit-tests): update 3.0 tests to run
iyoung Nov 6, 2024
811b4ea
chore(move-collection): move collection example
iyoung Nov 7, 2024
09cb29f
fix(move-tests): pushes the moved 2.2 tests
iyoung Nov 7, 2024
805fcfa
Merge branch 'feat/v3-unit-tests' of github.com:iptc/newsinjson into …
bquinn Nov 7, 2024
6e30baf
Removed all references to schema version 2.2
bquinn Nov 7, 2024
5b72b55
Removed references to 2.2 from 3.0 examples
bquinn Nov 7, 2024
b25ee47
chore(packages): add package files to codebase
iyoung Nov 8, 2024
d7b9a3f
Merge pull request #210 from iptc/feat/v3-unit-tests
bquinn Nov 8, 2024
aa176ad
fix erratum found in pre-release 3.0 schema: data types of recurrence…
bquinn Nov 11, 2024
52b52a8
Merge pull request #214 from iptc/fix/3.0-erratum-recurrence-types
iyoung Nov 11, 2024
e2fb027
Tidy up descriptions in the JSON Schema. Fixes #196 (#215)
bquinn Nov 11, 2024
3ff271b
Update ninjs generator to support version 3.0 (#211)
bquinn Nov 11, 2024
8cae52e
Added refinement to specify expectedDuration property. Fixes #216.
bquinn Nov 11, 2024
e224a44
Merge pull request #218 from iptc/fix/expectedDuration-desc
bquinn Nov 13, 2024
93befbd
3.0 docs (#212)
bquinn Nov 14, 2024
40294ba
3.0 docs update (#220)
bquinn Nov 25, 2024
364e66b
Merge branch 'main' into events-planning
iyoung Nov 25, 2024
17f0644
Fix to latest schema version reference in the docs
bquinn Nov 25, 2024
5eb023f
Merge branch 'events-planning' of github.com:iptc/newsinjson into eve…
bquinn Nov 25, 2024
1e9e84e
Added latest generated version of the docs
bquinn Nov 25, 2024
e19bf68
Fixing URI formats so we pass javascript ajv validation (Python
bquinn Nov 26, 2024
7077f12
Tidying up text and updating some references to 3.0
bquinn Nov 26, 2024
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

Large diffs are not rendered by default.

39 changes: 39 additions & 0 deletions validation/python/runtests.py
Original file line number Diff line number Diff line change
@@ -90,6 +90,10 @@ def __init__(self, *args, **kwargs):
specification_path,
'ninjs-schema_2.1.json',
)
ninjs22_schema_filename = os.path.join(
specification_path,
'ninjs-schema_2.2.json',
)
ninjs1xdev_schema_filename = os.path.join(
specification_path,
'ninjs-schema-dev_0.2_v1.5.json'
@@ -114,6 +118,8 @@ def __init__(self, *args, **kwargs):
self.ninjs20_schema = json.load(schemafile)
with open(ninjs21_schema_filename) as schemafile:
self.ninjs21_schema = json.load(schemafile)
with open(ninjs22_schema_filename) as schemafile:
self.ninjs22_schema = json.load(schemafile)
with open(ninjs1xdev_schema_filename) as schemafile:
self.ninjs1xdev_schema = json.load(schemafile)
with open(ninjs2xdev_schema_filename) as schemafile:
@@ -200,6 +206,7 @@ def test_simplest_instance(self):
self.assertIsNone(jsonschema.validate({"uri": "test1.5"}, self.ninjs15_schema))
self.assertIsNone(jsonschema.validate({"uri": "test2.0"}, self.ninjs20_schema))
self.assertIsNone(jsonschema.validate({"uri": "test2.1"}, self.ninjs21_schema))
self.assertIsNone(jsonschema.validate({"uri": "test2.2"}, self.ninjs22_schema))
self.assertIsNone(jsonschema.validate({"uri": "test-1.x-dev"}, self.ninjs1xdev_schema))
self.assertIsNone(jsonschema.validate({"uri": "test-2.x-dev"}, self.ninjs2xdev_schema))

@@ -567,6 +574,38 @@ def test_failing_2_1_unit_tests_against_2_1_schema(self):
folder_name=os.path.join('2.1', 'should_fail')
)

def test_passing_2_2_unit_tests_against_2_2_schema(self):
"""
Run files in TEST_FILES_FOLDER/2.2/should_pass against the 2.2 schema.
They should all pass (ie they are all valid against the schema).

Also run 2.0/should_pass and 2.1/should_pass against the 2.2 schema,
because it should be backwards compatible to 2.0.
"""
self.folder_should_pass(
schema=self.ninjs22_schema,
folder_name=os.path.join('2.2', 'should_pass'),
)
self.folder_should_pass(
schema=self.ninjs22_schema,
folder_name=os.path.join('2.1', 'should_pass'),
)
self.folder_should_pass(
schema=self.ninjs22_schema,
folder_name=os.path.join('2.0', 'should_pass')
)


def test_failing_2_2_unit_tests_against_2_2_schema(self):
"""
Run files in TEST_FILES_FOLDER/2.2/should_fail against the 2.2 schema.
They should all fail (ie they are all invalid in some way).
"""
self.folder_should_fail(
schema=self.ninjs22_schema,
folder_name=os.path.join('2.2', 'should_fail')
)



if __name__ == '__main__':
31 changes: 31 additions & 0 deletions validation/test_suite/2.2/should_pass/001_ninjs_example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"standard": {
"name": "ninjs",
"version": "2.2",
"schema": "http://www.iptc.org/std/ninjs/ninjs-schema_2.2.json"
},
"uri": "http://ninjs.example.com/newsitems/ninjs2-2-tests",
"headlines": [
{
"role": "main",
"value": "Test of ninjs 2.2 properties"
},
{
"role": "extension",
"value": "Extensible headline test"
}
],
"descriptions": [
{
"role": "caption",
"value": "Extensible description test"
}
],
"trustindicators": [
{
"role" : "http://cv.iptc.org/newscodes/trustindicator/editorialPolicy",
"title" : "The BBC's Editorial Standards",
"href": "https://www.bbc.com/editorialguidelines/guidelines/editorial-standards"
}
]
}
23 changes: 23 additions & 0 deletions validation/test_suite/2.2/should_pass/002_simple_event.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"standard": {
"name": "ninjs",
"version": "2.2",
"schema": "http://www.iptc.org/std/ninjs/ninjs-schema_2.2.json"
},
"uri": "urn:002-ninjs2.2-simple-event-test",
"events": [
{
"name": "2023 NATO Summit Press Conference",
"uri": "urn:nato.int:2023-nato-summit-press-conference",
"location": [
{
"type": "address",
"address": {
"locality": "Vilnius",
"country": "Lithuania"
}
}
]
}
]
}
32 changes: 32 additions & 0 deletions validation/test_suite/2.2/should_pass/003_complex_event.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"standard": {
"name": "ninjs",
"version": "2.2",
"schema": "http://www.iptc.org/std/ninjs/ninjs-schema_2.2.json"
},
"uri": "urn:002-ninjs2.2-complex-event-test",
"type": "event",
"events": [
{
"name": "2023 NATO Summit",
"uri": "urn:nato.int:2023-nato-summit",
"dates": {
"startdate": "2023-07-11",
"enddate": "2023-07-12"
},
"organiser": {
"name": "NATO",
"uri": "https://www.nato.int/"
},
"location": [
{
"type": "address",
"address": {
"locality": "Vilnius",
"country": "Lithuania"
}
}
]
}
]
}
40 changes: 40 additions & 0 deletions validation/test_suite/2.2/should_pass/004_recurring_event.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"standard": {
"name": "ninjs",
"version": "2.2",
"schema": "http://www.iptc.org/std/ninjs/ninjs-schema_2.2.json"
},
"uri": "urn:004-ninjs2.2-recurring-event-test",
"type": "event",
"events": [
{
"name": "Times Square Ball Drop",
"dates": {
"startdate": "2023-12-31T23:59:59-04:00",
"enddate": "2024-01-01T00:00:00-04:00",
"recurrence": {
"recurrence-rules": [
{
"frequency": "yearly"
}
]
}
},
"organiser": {
"name": "NATO",
"uri": "https://www.nato.int/"
},
"location": [
{
"name": "Times Square",
"type": "address",
"address": {
"locality": "New York",
"area": "New York",
"country": "United States"
}
}
]
}
]
}
115 changes: 115 additions & 0 deletions validation/test_suite/2.2/should_pass/005_planned_coverage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
{
"standard": {
"name": "ninjs",
"version": "2.2",
"schema": "http://www.iptc.org/std/ninjs/ninjs-schema_2.2.json"
},
"uri": "urn:005-ninjs2.2-planned-coverage-test",
"type": "planning",
"plannedcoverage": [
{
"uri": "planning-times-square-001-text",
"headline": "",
"type": "text",
"event": "times-square-event-001",
"itemcount": { "rangefrom": 1, "rangeto": 1 },
"scheduled": "2024-01-01T00:30:00-04:00",
"services": [
"all-items-feed",
"all-text-items-feed",
"text-highlights-feed"
],
"wordcount": 300,
"language": "en-US",
"audiences": [
{
"audience": "45-60",
"significance": 8
}
]
},
{
"uri": "planning-times-square-001-video",
"type": "video",
"event": "times-square-event-001",
"itemcount": { "rangefrom": 1, "rangeto": 1 },
"scheduled": "2024-01-01T00:30:00-04:00",
"services": [
"all-items-feed",
"all-video-items-feed",
"video-highlights-feed"
],
"audiences": [
{
"audience": "18-25",
"significance": 8
}
]
},
{
"uri": "planning-times-square-001-all-photos",
"type": "picture",
"event": "times-square-event-001",
"itemcount": { "rangefrom": 5, "rangeto": 15 },
"scheduled": "2024-01-01T00:30:00-04:00",
"services": [
"all-items-feed",
"all-photo-items-feed"
],
"audiences": [
{
"audience": "casual",
"significance": 7
}
]
},
{
"uri": "planning-times-square-001-top-photos",
"type": "picture",
"event": "times-square-event-001",
"itemcount": { "rangefrom": 1, "rangeto": 3 },
"scheduled": "2024-01-01T00:30:00-04:00",
"services": [
"photo-highlights-feed"
],
"audiences": [
{
"audience": "casual",
"significance": 8
}
]
}
],
"events": [
{
"uri": "times-square-event-001",
"name": "Times Square Ball Drop",
"dates": {
"startdate": "2023-12-31T23:59:59-04:00",
"enddate": "2024-01-01T00:00:00-04:00",
"recurrence": {
"recurrence-rules": [
{
"frequency": "yearly"
}
]
}
},
"organiser": {
"name": "NATO",
"uri": "https://www.nato.int/"
},
"location": [
{
"name": "Times Square",
"type": "address",
"address": {
"locality": "New York",
"area": "New York",
"country": "United States"
}
}
]
}
]
}