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

Support lookup from vocabs published via GitHub pages #60

Open
acka47 opened this issue Nov 17, 2020 · 2 comments
Open

Support lookup from vocabs published via GitHub pages #60

acka47 opened this issue Nov 17, 2020 · 2 comments
Assignees

Comments

@acka47
Copy link
Member

acka47 commented Nov 17, 2020

  1. I created https://w3id.org/acka47/subjects/ with redirect using https://github.com/skohub-io/skohub-docker-vocabs
  2. I wrote a JSON schema that includes a lookup to the vocab, see https://github.com/acka47/skohub-example-json-schema
  3. I tried out several viariants of adding the lookup URL, see https://github.com/acka47/skohub-example-json-schema/commits/main

As already discussed, the SkoHub Vocabs published via GitHub Pages does not support content negotiation. I am afraid, there is currently no way to enable the lookup and the SkoHub Editor code has to be adjusted for this.

@sroertgen already adjusted the SkoHub Editor code for WLO to directly look for the json vocab and the FlexSearch index, see
https://github.com/openeduhub/oeh-add-content/blob/4a80a03b4ba75b5c1d1e8cd89b8f20ae4b3903e8/frontend/src/components/JSONPointerForm/SkohubLookup.js#L84-L109

Thus, a solution for this problem would be to add this as fallback in the editor when content negotiation fails.

@acka47 acka47 assigned acka47 and literarymachine and unassigned acka47 Nov 17, 2020
@acka47 acka47 changed the title Allow lookup from vocabs published via GitHub pages Support lookup from vocabs published via GitHub pages Nov 17, 2020
@acka47
Copy link
Member Author

acka47 commented Nov 17, 2020

@sroertgen already adjusted the SkoHub Editor code for WLO to directly look for the json vocab and the FlexSearch index,

Here is a link to the respective commit: openeduhub@8fb3847#diff-986dba4e0568e578b474d17b17e9ea00cacbbaf28dbea33d782f45c9393a8f6b

@acka47
Copy link
Member Author

acka47 commented Nov 20, 2020

Actually, the lookup (without typeahead search) works when you provide a valid JSON Schema. (I had a typo in the versions I tested and the editor would somehow load the last valid schema...) So, this is not too important now. With @literarymachine I agreed to add some configuration option like this at a later point:

{
   "_widget":{
      "type":"SkohubLookup",
      "options":{
         "url":"https://acka47.github.io/skohub-example-subjects/w3id.org/acka47/subjects/index.json",
         "index":"https://acka47.github.io/skohub-example-subjects/w3id.org/acka47/subjects/index.index"
      }
   }
}

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