LDflex / Query-Solid

Simple access to data in Solid pods through LDflex expressions
https://solid.github.io/query-ldflex/
MIT License
66 stars 15 forks source link

Get a property starting by '@' raises an error #41

Open matthieu-fesselier opened 4 years ago

matthieu-fesselier commented 4 years ago

If I try to get a property starting by @, like the JSONLD keywords, I get an error:

  await solid.data.context.extend(base_context)
  const type = solid.data["https://api.coopstarter.happy-dev.fr/resources/1/"]['@type']
  console.log(`${await type}`)

  // Uncaught (in promise) Error
  // expandProperty @ | JSONLDResolver.js:65

It works if I remove the @ before type. But in this case, I expect the http://happy-dev.fr/owl/#type property and not the rdf:type

RubenVerborgh commented 4 years ago

@rubensworks Is this a JSONLDResolver matter?

rubensworks commented 4 years ago

Expansion of keywords (like @type) is not standardized in the JSON-LD spec. So this is not a bug, just not a feature (yet) :-) It's something that should be implemented in the expansion logic in jsonld-context-parser.js.