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

Error parsing linkedart context definition #2551

Closed
michielhildebrand opened this issue Jun 25, 2024 · 2 comments
Closed

Error parsing linkedart context definition #2551

michielhildebrand opened this issue Jun 25, 2024 · 2 comments
Labels

Comments

@michielhildebrand
Copy link

Version

4.10

What happened?

We use Jena to parse RDF files, including jsonld. When loading the latest version of the linked art context definition in jsonld (https://linked.art/ns/v1/linked-art.json) Jena reports an error. According to the maintainers of the linked art context definition the jsonld is correct and is parsed by pyld, see linked-art/linked.art#235 (comment). The specific section of the jsonld document that triggers the error is.

"@context": {
   "@id": "crm:P177_assigned_property_of_type",
   "@type": "@vocab",
   "@context": {
       "part_of": {
           "@id": "crm:P46i_forms_part_of"
       }
   }
}

Relevant output and stacktrace

I reproduced the error using the ld-cli

cat linkart.json | ./ld-cli expand --ordered --pretty
JsonLdError[code=The local context defined within a term definition is invalid [code=INVALID_SCOPED_CONTEXT]., message=The local context defined within a term definition is invalid [code=INVALID_SCOPED_CONTEXT].]
	at com.apicatalog.jsonld.context.TermDefinitionBuilder.create(TermDefinitionBuilder.java:540)
	at com.apicatalog.jsonld.context.ActiveContextBuilder.create(ActiveContextBuilder.java:457)
	at com.apicatalog.jsonld.expansion.ObjectExpansion.initLocalContext(ObjectExpansion.java:200)
	at com.apicatalog.jsonld.expansion.ObjectExpansion.expand(ObjectExpansion.java:102)
	at com.apicatalog.jsonld.expansion.Expansion.compute(Expansion.java:119)
	at com.apicatalog.jsonld.processor.ExpansionProcessor.expand(ExpansionProcessor.java:124)
	at com.apicatalog.jsonld.api.ExpansionApi.get(ExpansionApi.java:131)
	at com.apicatalog.cli.command.ExpandCmd.call(ExpandCmd.java:76)
	at com.apicatalog.cli.command.ExpandCmd.call(ExpandCmd.java:18)
	at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
	at picocli.CommandLine.access$1300(CommandLine.java:145)
	at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2352)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2314)
	at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
	at picocli.CommandLine$RunLast.execute(CommandLine.java:2316)
	at picocli.CommandLine.execute(CommandLine.java:2078)
	at com.apicatalog.cli.App.main(App.java:82)
Caused by: JsonLdError[code=The local context defined within a term definition is invalid [code=INVALID_SCOPED_CONTEXT]., message=The local context defined within a term definition is invalid [code=INVALID_SCOPED_CONTEXT].]
	at com.apicatalog.jsonld.context.TermDefinitionBuilder.create(TermDefinitionBuilder.java:540)
	at com.apicatalog.jsonld.context.ActiveContextBuilder.create(ActiveContextBuilder.java:457)
	at com.apicatalog.jsonld.context.TermDefinitionBuilder.create(TermDefinitionBuilder.java:537)
	... 17 more
Caused by: JsonLdError[code=A keyword redefinition has been detected [code=KEYWORD_REDEFINITION]., message=A keyword [@id] redefinition has been detected.]
	at com.apicatalog.jsonld.context.TermDefinitionBuilder.create(TermDefinitionBuilder.java:165)
	at com.apicatalog.jsonld.context.ActiveContextBuilder.create(ActiveContextBuilder.java:457)
	at com.apicatalog.jsonld.context.TermDefinitionBuilder.create(TermDefinitionBuilder.java:537)
	... 19 more


### Are you interested in making a pull request?

None
@michielhildebrand
Copy link
Author

As the bug already appears in titanium-json-ld I reported the bug there filip26/titanium-json-ld#348.

Should we close this one?

@afs
Copy link
Member

afs commented Jun 25, 2024

Hi @michielhildebrand,

Thanks for checking Titanium JSON-LD.

There isn't any Jena code on that stack trace so it doesn't look like Jena setup of a call to Titanium is involved.
The stack trace is from com.apicatalog.cli.App.main which is not Jena code.

The de-facto reference impl online for JSON-LD is https://json-ld.org/playground/.

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

No branches or pull requests

2 participants