digitalbazaar / digitalbazaar/pyld

Guidance on how to validate all parameters are defined in context

Open
#200 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

strict mode
Dominant language
Python
Stars
683
Forks
138
Avg merge
2d 14h
Merged PRs (30d)
15

Description

Thank you very much for your work on this library. I am looking to write a simple script to make sure a some jsonld data from my API is exhaustively mapped (i.e. every term is mapped to one in the context) and was wondering if there is a way to do this with pyld.

My understanding of jsonld is that I can define whatever properties I want and even if they are not defined in the context, they will still be expanded / compacted etc

{
  "@context": "http://schema.org/",
  "@type": "Person",
  "name": "Jane Doe",
  "jobTitle": "Professor",
  "telephone": "(425) 123-4567",
  "dummy_name": "foo_bar"
}

would be canonized to

_:c14n0 <http://schema.org/dummy_name> "foo_bar" .
_:c14n0 <http://schema.org/jobTitle> "Professor" .
_:c14n0 <http://schema.org/name> "Jane Doe" .
_:c14n0 <http://schema.org/telephone> "(425) 123-4567" .
_:c14n0 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Person> .

However, I was hoping that in the jsonld processor, there might be a way to check that the vocab is invalid during the process of fetching the schema.org vocab. I think this would be valuable since to my understanding, there aren't any jsonld linters that can automatically run these sorts of checks in a ci/cd pipeline, ensuring rdf data is valid without needing to write redundant shacl shapes.

Thank you very much
Regards
Colton

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing pyld's expansion, compaction, canonization, and schema.org context-fetching behavior described in the issue. Determine whether the requested exhaustive-term validation belongs in the processor, and define a reproducible validation result or error path; no file or test is named, so the relevant entry points must first be located.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.