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

JSON-LD context not resolving with 0.0.0 version #2

Open
sneakers-the-rat opened this issue Jan 8, 2024 · 4 comments
Open

JSON-LD context not resolving with 0.0.0 version #2

sneakers-the-rat opened this issue Jan 8, 2024 · 4 comments

Comments

@sneakers-the-rat
Copy link

This context line:

"https://linkedsoftwaredependencies.org/bundles/npm/koreografeye/^0.0.0/components/context.jsonld"

causes an error:

2024-01-08T19:27:47.982Z [Components.js] warn: Detected remote context lookup for 'https://linkedsoftwaredependencies.org/bundles/npm/koreografeye-mastodon/^0.0.0/components/context.jsonld' in ./config.jsonld. This may indicate a missing or invalid dependency, incorrect version number, or an invalid context URL.
/Users/jonny/git/KoreografeyeDemo/node_modules/componentsjs/lib/rdf/RdfParser.js:85
        return new Error(`Error while parsing file "${path}": ${error.message}`);
               ^

Error: Error while parsing file "./config.jsonld": Failed to load remote context https://linkedsoftwaredependencies.org/bundles/npm/koreografeye-mastodon/^0.0.0/components/context.jsonld: Internal Server Error

Setting it as "https://linkedsoftwaredependencies.org/bundles/npm/koreografeye/^0.4.6/components/context.jsonld", fixes the problem, but you might even just want to to >0.0.0 which presumably would resolve (didn't test)

@phochste
Copy link
Contributor

phochste commented Jan 8, 2024

The context line is correct: all it matches all 0.x.x versions of koreografeye. I don't know what caused the problem at your end. This investigating if I can replicate it.

@sneakers-the-rat
Copy link
Author

sneakers-the-rat commented Jan 8, 2024

According tonode-semver docs:

Allows changes that do not modify the left-most non-zero element in the [major, minor, patch] tuple. In other words, this allows patch and minor updates for versions 1.0.0 and above, patch updates for versions 0.X >=0.1.0, and no updates for versions 0.0.X.

So ^0.0.0 matches nothing -

But also:

A missing minor and patch values will desugar to zero, but also allow flexibility within those values, even if the major version is zero.

^1.x := >=1.0.0 <2.0.0-0
^0.x := >=0.0.0 <1.0.0-0

So if you want >=0.0.0,<1.0.0 (==0.x.x) then that should be ^0.x

Confirmed with their semver calculator: ^0.0.0 matches nothing, but all these work:

  • ^0.x
  • 0.x.x
  • <1

@phochste
Copy link
Contributor

phochste commented Jan 9, 2024

Ok got it. It is a node version issue. I can get the same errors when using the node version you mentioned in the KoreografyePlugin ticket. I'll look into it!

@sneakers-the-rat
Copy link
Author

sneakers-the-rat commented Jan 9, 2024

Not trying to make a big deal out of this, ultimately I don't really care, just thought i'd give a nod and say hey, so up to you.

i'm just about to log off for the night, but if i go to the website in my browser i get a failure to resolve: https://linkedsoftwaredependencies.org/bundles/npm/koreografeye/%5E0.0.0/components/context.jsonld

but these all work just fine:

Not sure if node handles the error differently in different versions, but i'm telling ya that ^0.0.0 can only ever be satisfied by v0.0.0 - since there are no non-zero elements, the only valid match is a version that does not modify any numbers. don't take my word for it, check out that calculator from NPM i linked above.

If what you intended to do was match 0.x.x (>=0.0.0, <1.0.0) then any of the above three version specifiers do that, should just be a simple find and replace ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants