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

Invalid predicate IRI for key in JSON field #90

Open
adlerfaulkner opened this issue Apr 13, 2022 · 0 comments
Open

Invalid predicate IRI for key in JSON field #90

adlerfaulkner opened this issue Apr 13, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@adlerfaulkner
Copy link

When wrapping a nested json field in @value like YargsCliExtractor:_parameters below:

{
  "@context": "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^3.0.0/components/context.jsonld",
  "@graph": [
    {
      "@id": "urn:solid-server-app-setup:default:CliExtractor",
      "@type": "YargsCliExtractor",
      "YargsCliExtractor:_options": {
        "@type": "@json",
        "@value": {
          "usage": "node ./bin/server.js [args]"
        }
      },
      "YargsCliExtractor:_parameters": {
        "@type": "@json",
        "@value": {
          "config": {
            "alias": "c",
            "requiresArg": true,
            "type": "string",
            "describe": "The configuration for the server. The default only stores data in memory; to persist to your filesystem, use @css:config/file.json."
          },
        ...

I get an error saying Invalid predicate IRI: config (full error below). I'm not sure why it works for YargsCliExtractor:_options but not YargsCliExtractor:_parameters. That seems to mean that it has something to do with the nested json within config.

Full trace:

Could not build the config files from /Users/adlerfaulkner/standard-knowledge-data-store/config/config.json
Cause: Error while parsing file "/Users/adlerfaulkner/community-server/config/app/variables/cli/cli.json": Invalid predicate IRI: config
Error: Error while parsing file "/Users/adlerfaulkner/community-server/config/app/variables/cli/cli.json": Invalid predicate IRI: config
    at Function.addPathToError (/Users/adlerfaulkner/community-server/node_modules/componentsjs/lib/rdf/RdfParser.js:73:16)
    at PassThrough.<anonymous> (/Users/adlerfaulkner/community-server/node_modules/componentsjs/lib/rdf/RdfParser.js:46:38)
    at PassThrough.emit (node:events:532:35)
    at JsonLdParser.<anonymous> (/Users/adlerfaulkner/community-server/node_modules/rdf-parse/lib/RdfParser.js:71:47)
    at JsonLdParser.emit (node:events:532:35)
    at ParsingContext.emitError (/Users/adlerfaulkner/community-server/node_modules/jsonld-streaming-parser/lib/ParsingContext.js:232:21)
    at Util.predicateToTerm (/Users/adlerfaulkner/community-server/node_modules/jsonld-streaming-parser/lib/Util.js:438:37)
    at EntryHandlerPredicate.validate (/Users/adlerfaulkner/community-server/node_modules/jsonld-streaming-parser/lib/entryhandler/EntryHandlerPredicate.js:90:71)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async JsonLdParser.validateKey (/Users/adlerfaulkner/community-server/node_modules/jsonld-streaming-parser/lib/JsonLdParser.js:320:17)
    at async JsonLdParser.newOnValueJob (/Users/adlerfaulkner/community-server/node_modules/jsonld-streaming-parser/lib/JsonLdParser.js:174:62)
    at async JsonLdParser.executeBufferedJobs (/Users/adlerfaulkner/community-server/node_modules/jsonld-streaming-parser/lib/JsonLdParser.js:434:13)

If I remove all of the fields inside config so that it's just config: {} the error goes away.

The problem also seems to be fixed If I put YargsCliExtractor:_parameters and it's json type into the @context like this:

{
  "@context": [
    "https://linkedsoftwaredependencies.org/bundles/npm/@solid/community-server/^3.0.0/components/context.jsonld",
    { "parameters": { "@id": "YargsCliExtractor:_parameters", "@type": "@json" } }
  ],
  "@graph": [
    {
      "comment": "Extracts CLI arguments into a key/value object. Config and mainModulePath are only defined here so their description is returned.",
      "@id": "urn:solid-server-app-setup:default:CliExtractor",
      "@type": "YargsCliExtractor",
      "YargsCliExtractor:_options": {
        "@type": "@json",
        "@value": {
          "usage": "node ./bin/server.js [args]"
        }
      },
      "parameters": {
        "config": {
          "alias": "c",
          "requiresArg": true,
          "type": "string",
          "describe": "The configuration for the server. The default only stores data in memory; to persist to your filesystem, use @css:config/file.json."
        },
        ...

I am on version 2.4.3.

@rubensworks rubensworks added the bug Something isn't working label Apr 14, 2022
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