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

What does "JSON containment" mean? #415

Open
1 task done
cabo opened this issue May 16, 2024 · 3 comments
Open
1 task done

What does "JSON containment" mean? #415

cabo opened this issue May 16, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@cabo
Copy link

cabo commented May 16, 2024

Describe the issue

the page https://bib.ietf.org offers a choice "JSON containment".
What does this phrase mean?
Where are this and other aspects of the search feature documented?

Code of Conduct

@cabo cabo added the bug Something isn't working label May 16, 2024
@kesara
Copy link
Member

kesara commented May 16, 2024

There's a description available. Hidden under Search Help.
Screenshot 2024-05-16 at 12 53 28

JSON containment (json_struct in API) query must be a valid JSON structure, and items containing this structure will match:

{"series": [{"title": {"content": "RFC"}}]}

@cabo
Copy link
Author

cabo commented May 16, 2024

Thanks. I don't know what a "JSON structure" is, though, and I also have no idea what kind of JSON we are talking about (bib entries are in XML?).

@kesara
Copy link
Member

kesara commented May 16, 2024

Bibliographic data is stored as JSONb in a PostgreSQL database.
That interface allows you to search those entries as JSON queries.
As for the structure:

{
  "data": {
    "abstract": {
      "content": "string",
      "format": "string",
      "language": "string",
      "script": "string"
    },
    "biblionote": [
      {
        "content": "string",
        "type": "string"
      }
    ],
    "contributor": [
      {
        "organization": {
          "abbreviation": {
            "content": "string",
            "format": "string",
            "language": "string",
            "script": "string"
          },
          "contact": [
            {
              "address": {
                "city": "string",
                "country": "string",
                "postcode": "string",
                "state": "string",
                "street": [
                  "string"
                ]
              },
              "email": "string",
              "phone": {
                "content": "string",
                "type": "string"
              },
              "uri": "string"
            }
          ],
          "name": [
            {
              "content": "string",
              "format": "string",
              "language": "string",
              "script": "string"
            }
          ],
          "url": "string"
        },
        "person": {
          "affiliation": [
            {
              "organization": {
                "abbreviation": {
                  "content": "string",
                  "format": "string",
                  "language": "string",
                  "script": "string"
                },
                "contact": [
                  {}
                ],
                "name": [
                  {}
                ],
                "url": "string"
              }
            }
          ],
          "contact": [
            {
              "address": {
                "city": "string",
                "country": "string",
                "postcode": "string",
                "state": "string",
                "street": [
                  "string"
                ]
              },
              "email": "string",
              "phone": {
                "content": "string",
                "type": "string"
              },
              "uri": "string"
            }
          ],
          "name": {
            "addition": {
              "content": "string",
              "format": "string",
              "language": "string",
              "script": "string"
            },
            "completename": {
              "content": "string",
              "format": "string",
              "language": "string",
              "script": "string"
            },
            "given": {
              "forename": [
                {
                  "content": "string",
                  "format": "string",
                  "initial": "string",
                  "language": "string",
                  "script": "string"
                }
              ],
              "formatted_initials": {
                "content": "string",
                "format": "string",
                "language": "string",
                "script": "string"
              }
            },
            "prefix": {
              "content": "string",
              "format": "string",
              "language": "string",
              "script": "string"
            },
            "surname": {
              "content": "string",
              "format": "string",
              "language": "string",
              "script": "string"
            }
          }
        },
        "role": [
          {
            "description": [
              {
                "content": "string",
                "format": "string",
                "language": "string",
                "script": "string"
              }
            ],
            "type": "string"
          }
        ]
      }
    ],
    "copyright": [
      {
        "from": 0,
        "owner": [
          {
            "abbreviation": {
              "content": "string",
              "format": "string",
              "language": "string",
              "script": "string"
            },
            "contact": [
              {
                "address": {
                  "city": "string",
                  "country": "string",
                  "postcode": "string",
                  "state": "string",
                  "street": [
                    null
                  ]
                },
                "email": "string",
                "phone": {
                  "content": "string",
                  "type": "string"
                },
                "uri": "string"
              }
            ],
            "name": [
              {
                "content": "string",
                "format": "string",
                "language": "string",
                "script": "string"
              }
            ],
            "url": "string"
          }
        ]
      }
    ],
    "date": [
      {
        "type": "string",
        "value": "string"
      }
    ],
    "docid": [
      {
        "id": "string",
        "primary": true,
        "scope": "string",
        "type": "string"
      }
    ],
    "docnumber": "string",
    "doctype": "string",
    "edition": {
      "content": "string",
      "number": "string"
    },
    "extent": {
      "locality": [
        {
          "reference_from": "string",
          "reference_to": "string",
          "type": "string"
        }
      ]
    },
    "fetched": "2019-08-24",
    "formattedref": {
      "content": "string",
      "format": "string",
      "language": "string",
      "script": "string"
    },
    "keyword": [
      {
        "content": "string"
      }
    ],
    "language": "string",
    "link": [
      {
        "content": "string",
        "type": "string"
      }
    ],
    "place": "string",
    "relation": [
      {
        "bibitem": {},
        "description": {
          "content": "string",
          "format": "string",
          "language": "string",
          "script": "string"
        },
        "type": "string"
      }
    ],
    "revdate": "string",
    "script": "string",
    "series": [
      {
        "abbrev": "string",
        "formattedref": {
          "content": "string",
          "format": "string",
          "language": "string",
          "script": "string"
        },
        "number": "string",
        "organization": "string",
        "partnumber": "string",
        "place": "string",
        "run": "string",
        "title": {
          "content": "string",
          "format": "string",
          "language": "string",
          "script": "string"
        },
        "type": "main"
      }
    ],
    "title": [
      {
        "content": "string",
        "format": "string",
        "language": "string",
        "script": "string",
        "type": "string"
      }
    ],
    "type": "string",
    "version": [
      {
        "draft": "string"
      }
    ]
  }
}

It's from https://bib.ietf.org/api/v1/#operation/getBibItemByDocId

Yes, this should be better documented.
And maybe we don't need this kind of complexity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants