GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Parsing breaks on JSON-LD 1.1 `@version` keyword. · Issue #263 · jsonld-java/jsonld-java

Parsing breaks on JSON-LD 1.1 @version keyword. #263

New issue
Copy link
New issue
Copy link
Open
Open
Parsing breaks on JSON-LD 1.1 @version keyword.#263
Copy link

Description

@RinkeHoekstra
RinkeHoekstra
opened on Jun 21, 2019
Issue body actions

The graphToRdf function in RDFDataset.java checks whether any of the keys in the JSON document are reserved JSON-LD keywords. As JsonLdUtils.isKeyword() doesn't know of @version (introduced in 1.1), it then tries to interpret its value, which fails.

Solution: add || "@version".equals(key) to the isKeyword function in JsonLdUtils.java:

    /**
     * Returns whether or not the given value is a keyword (or a keyword alias).
     *
     * @param v
     *            the value to check.
     * @param [ctx]
     *            the active context to check against.
     *
     * @return true if the value is a keyword, false if not.
     */
    static boolean isKeyword(Object key) {
        if (!isString(key)) {
            return false;
        }
        return "@base".equals(key) || "@context".equals(key) || "@container".equals(key)
                || "@default".equals(key) || "@embed".equals(key) || "@explicit".equals(key)
                || "@graph".equals(key) || "@id".equals(key) || "@index".equals(key)
                || "@language".equals(key) || "@list".equals(key) || "@omitDefault".equals(key)
                || "@reverse".equals(key) || "@preserve".equals(key) || "@set".equals(key)
                || "@type".equals(key) || "@value".equals(key) || "@vocab".equals(key)
                || "@requireAll".equals(key) || "@version".equals(key);
    }

Activity

  1. ChandlerTodd commented on Jan 14, 2020

    @ChandlerTodd
    ChandlerTodd
    on Jan 14, 2020
    More actions

    Is the error that comes up with this issue the com.github.jsonldjava.core.JsonLdError: invalid term definition: 1.1? I am running into this problem when the @Version is in the context.

  2. antohaby commented on Apr 15, 2020

    @antohaby
    antohaby
    on Apr 15, 2020
    More actions

    As a workaround, it is possible to substitute a document via DocumentLoader.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.