Skip to content

Commit

Permalink
Change the format of reconciliation queries, responses and data exten…
Browse files Browse the repository at this point in the history
…sion responses (#92)

* Change the format of reconciliation queries, responses and data extension responses.

This removes the use of arbitrary keys in JSON objects.
As a result we are no longer using "patternProperties" in our own JSON schemas.
Closes #33.

* Reformat wront-properties.json

* Avoid JSON responses with a root array: wrap them in an object

* Rename 'result' field to 'candidates' in reconciliation response
  • Loading branch information
wetneb authored and fsteeg committed Jul 13, 2023
1 parent 1f7fe05 commit b11a5f0
Show file tree
Hide file tree
Showing 19 changed files with 680 additions and 569 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,38 @@
}
}
],
"rows": {
"10662041X": {
"variantName": [
"rows": [
{
"id": "10662041X",
"properties": [
{
"label": "Stryi-Leitgeb, Gerda"
}
],
"geographicAreaCode": [
"id": "variantName",
"values": [
{
"label": "Stryi-Leitgeb, Gerda"
}
]
},
{
"str": "http://d-nb.info/standards/vocab/gnd/geographic-area-code#XA-DE",
"label": "Deutschland"
}
],
"professionOrOccupation": [
"id": "geographicAreaCode",
"values": [
{
"str": "http://d-nb.info/standards/vocab/gnd/geographic-area-code#XA-DE",
"label": "Deutschland"
}
]
},
{
"id": "4037223-6",
"name": "Malerin",
"type": "Person"
"id": "professionOrOccupation",
"values": [
{
"id": "4037223-6",
"name": "Malerin",
"type": "Person"
}
]
}
]
}
}
}
]
}
112 changes: 71 additions & 41 deletions latest/examples/data-extension-response/valid/example-full.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,60 +22,90 @@
"service": "https://www.wikidata.org/api/reconcile"
}
],
"rows": {
"10662041X": {
"variantName": [
"rows": [
{
"id": "10662041X",
"properties": [
{
"str": "Stryi-Leitgeb, Gerda"
"id": "variantName",
"values": [
{
"str": "Stryi-Leitgeb, Gerda"
},
{
"str": "Leitgeb, Gerda Stryi-"
}
]
},
{
"str": "Leitgeb, Gerda Stryi-"
}
],
"geographicAreaCode": [
{
"str": "http://d-nb.info/standards/vocab/gnd/geographic-area-code#XA-DE"
}
],
"professionOrOccupation": [
{
"id": "4037223-6",
"name": "Malerin",
"description": "Beruf"
"id": "geographicAreaCode",
"values": [
{
"str": "http://d-nb.info/standards/vocab/gnd/geographic-area-code#XA-DE"
}
]
},
{
"id": "4033430-2",
"name": "Künstlerin"
}
],
"wikidataId": [
"id": "professionOrOccupation",
"values": [
{
"id": "4037223-6",
"name": "Malerin",
"description": "Beruf"
},
{
"id": "4033430-2",
"name": "Künstlerin"
}
]
},
{
"id": "Q3874347",
"name": "Gerda Stryi-Leitgeb"
"id": "wikidataId",
"values": [
{
"id": "Q3874347",
"name": "Gerda Stryi-Leitgeb"
}
]
}
]
},
"1064905412": {
"variantName": [
{}
],
"geographicAreaCode": [
{
"id": "1064905412",
"properties": [
{
"str": "http://d-nb.info/standards/vocab/gnd/geographic-area-code#XA-DE"
}
],
"professionOrOccupation": [
"id": "variantName",
"values": [
{}
]
},
{
"id": "4002844-6",
"name": "Architekt"
}
],
"wikidataId": [
"id": "geographicAreaCode",
"values": [
{
"str": "http://d-nb.info/standards/vocab/gnd/geographic-area-code#XA-DE"
}
]
},
{
"id": "professionOrOccupation",
"values": [
{
"id": "4002844-6",
"name": "Architekt"
}
]
},
{
"id": "Q3874347",
"name": "Gerda Stryi-Leitgeb"
"id": "wikidataId",
"values": [
{
"id": "Q3874347",
"name": "Gerda Stryi-Leitgeb"
}
]
}
]
}
}
]
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"q1": {
"properties": []
}
"queries": [
{
"properties": []
}
]
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"q1": {
"limit": 1
}
"queries": [
{
"limit": 1
}
]
}
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
{
"q0": {
"query": "Christel Hanewinckel",
"type": "DifferentiatedPerson",
"limit": 5,
"props": [
{
"pid": "professionOrOccupation",
"v": "Politik*"
},
{
"pid": "affiliation",
"v": "http://d-nb.info/gnd/2022139-3"
}
],
"type_strict": "should"
},
"q1": {
"query": "Franz Thönnes",
"type": "DifferentiatedPerson",
"limit": 5,
"props": [
{
"pid": "professionOrOccupation",
"v": "Politik*"
},
{
"pid": "affiliation",
"v": "http://d-nb.info/gnd/2022139-3"
}
],
"type_strict": "should"
}
}
"queries": [
{
"query": "Christel Hanewinckel",
"type": "DifferentiatedPerson",
"limit": 5,
"props": [
{
"pid": "professionOrOccupation",
"v": "Politik*"
},
{
"pid": "affiliation",
"v": "http://d-nb.info/gnd/2022139-3"
}
],
"type_strict": "should"
},
{
"query": "Franz Thönnes",
"type": "DifferentiatedPerson",
"limit": 5,
"props": [
{
"pid": "professionOrOccupation",
"v": "Politik*"
},
{
"pid": "affiliation",
"v": "http://d-nb.info/gnd/2022139-3"
}
],
"type_strict": "should"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[
{
"properties": [{"pid":"uid", "v": "27eb892afbb2"}]
},
{
"properties": [{"pid":"uid", "v": "ab09da9dd37e"}]
}
]
11 changes: 11 additions & 0 deletions latest/examples/reconciliation-query-batch/invalid/old-format.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"q0": {
"query": "Christel Hanewinckel",
"limit": 5
},
"q1": {
"query": "Franz Thönnes",
"type": "DifferentiatedPerson",
"limit": 5
}
}
68 changes: 35 additions & 33 deletions latest/examples/reconciliation-query-batch/valid/example-full.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
{
"q0": {
"query": "Christel Hanewinckel",
"type": "DifferentiatedPerson",
"limit": 5,
"properties": [
{
"pid": "professionOrOccupation",
"v": "Politik*"
},
{
"pid": "affiliation",
"v": "http://d-nb.info/gnd/2022139-3"
}
],
"type_strict": "should"
},
"q1": {
"query": "Franz Thönnes",
"type": "DifferentiatedPerson",
"limit": 5,
"properties": [
{
"pid": "professionOrOccupation",
"v": "Politik*"
},
{
"pid": "affiliation",
"v": "http://d-nb.info/gnd/2022139-3"
}
],
"type_strict": "should"
}
}
"queries": [
{
"query": "Christel Hanewinckel",
"type": "DifferentiatedPerson",
"limit": 5,
"properties": [
{
"pid": "professionOrOccupation",
"v": "Politik*"
},
{
"pid": "affiliation",
"v": "http://d-nb.info/gnd/2022139-3"
}
],
"type_strict": "should"
},
{
"query": "Franz Thönnes",
"type": "DifferentiatedPerson",
"limit": 5,
"properties": [
{
"pid": "professionOrOccupation",
"v": "Politik*"
},
{
"pid": "affiliation",
"v": "http://d-nb.info/gnd/2022139-3"
}
],
"type_strict": "should"
}
]
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{
"q1": {
"query": "Hans-Eberhard Urbaniak"
},
"q2": {
"query": "Ernst Schwanhold"
}
}
"queries": [
{
"query": "Hans-Eberhard Urbaniak"
},
{
"query": "Ernst Schwanhold"
}
]
}
Loading

0 comments on commit b11a5f0

Please sign in to comment.