question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

/serverapi/vocab should allow reaching fragments

See original GitHub issue

I’m submitting a

  • bug report.

Two different related issues here:

Current Behaviour:

  1. /serverapi/vocab#Area returns the full vocabulary.
  2. at http://localhost:8080/serverapi/contexts/EntryPoint.jsonld see:
"@context": {
"Area": {
"@id": "http://localhost:8080/serverapi/vocab**#EntryPoint/Area**",  <<<<<
"@type": "@id"
},

Expected Behaviour:

  1. /serverapi/vocab#Area should return the Area object (with context) only, not the full vocabulary, i.e.:
{
  "@context": { ... },
  "@id": "http://localhost:8080/serverapi/vocab#Area",
  "@type": "hydra:Class",
  "description": "Class for Area of Interest of the server",
  "supportedOperation": [
   ....
  1. ids in http://localhost:8080/serverapi/contexts/EntryPoint.jsonld should link to serverapi/vocab# fragments like @id": "http://localhost:8080/serverapi/**vocab#Area**"

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Mec-iScommented, Oct 12, 2020

Sorry I forgot about this part of RFC. we need to take a look into how RDF servers implement this feature.

@chrizandr @sameshl any observation?

UPDATE: I think it would be ok to implement it as a GET parameter

1reaction
Mec-iScommented, Oct 7, 2020

the idea is to provide for the JSON-LD a feature that is availalble in HTML pages. For example if you write this link into you browser https://en.wikipedia.org/wiki/Representational_state_transfer#Layered_system you are redirected to the paragraph “Layered_system” inside the linked page. The same should happen for the JSON-LD, if a fragment is specified, the server should return only the object requested.

Here it is a way you can implement this:

  1. create a Flask decorator that reads the path for the request (Request object, from flask import request); if a fragment name is present in the request (you can use a regular expression to match the fragment name or simply read the URI backward up to the #; first one would be more solid) tell the handler to return only the context plus the object specified by the fragment name
  2. apply the decorator to the view that returns the JSON-LD

[UPDATED] as a plus, you can provide appropriate caching settings for this URI/handler as its content is basically immutable for every server instance

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dislocated Lens Fragments Should Be Referred to a Specialist
Dislocated Lens Fragments Should Be Referred to a Specialist ... While such techniques have allowed the phaco surgeon to remove harder nuclei more...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found