Giter Site home page Giter Site logo

Comments (7)

albertoabellagarcia avatar albertoabellagarcia commented on July 22, 2024

I guess it could be a GitHub failure (not uncommon) now it is working properly without touching anything
https://smart-data-models.github.io/dataModel.GBFS/station_status/examples/example-normalized.jsonld

Regarding the @context I see the error but the context remains accessible as well. I guess this should be solved by https://rdf-play.rubensworks.net or maybe the error is misleading us.

from datamodel.gbfs.

pietercolpaert avatar pietercolpaert commented on July 22, 2024

No, the headers on https://smartdatamodels.org/context.jsonld are incorrect. As far as I can see, you should:

from datamodel.gbfs.

albertoabellagarcia avatar albertoabellagarcia commented on July 22, 2024

Could you show me an example in Github setting those headers?

from datamodel.gbfs.

pietercolpaert avatar pietercolpaert commented on July 22, 2024

Could you show me an example in Github setting those headers?

This is not a github hosting issue, as your file hosted on github pages has all the right headers:

$ curl -I https://smart-data-models.github.io/dataModel.GBFS/station_status/examples/example-normalized.jsonld
HTTP/2 200 
server: GitHub.com
content-type: application/ld+json
access-control-allow-origin: *
etag: "61a97b57-81d"

The problem is with the context file that is referenced in this file (https://smartdatamodels.org/context.jsonld), where there is no such content-type or access-control-allow-origin header. A JSON-LD library is going to try to dereference the context in order to read this file, but is going to bump into something it is not allowed to fetch from another domain, and when it is able to fetch it, it is going to see that this is not indicated as an application/ld+json file and thus is not going to continue parsing the file.

$ curl -I https://smartdatamodels.org/context.jsonld
HTTP/1.1 200 OK
Date: Thu, 16 Dec 2021 18:33:17 GMT
Server: Apache/2.4.29 (Ubuntu)
Last-Modified: Thu, 16 Dec 2021 10:52:01 GMT
ETag: "1e573-5d341365cbb64"
Accept-Ranges: bytes
Content-Length: 124275
Content-Type: application/json; charset=utf-8

I can see from the headers you’re using Apache on that server. Adding a .htaccess file (or adding these 2 lines if it already exists) to the /var/www (or the real path of your public www dir) should do the trick:

Header set Access-Control-Allow-Origin *
AddType application/ld+json .jsonld

from datamodel.gbfs.

albertoabellagarcia avatar albertoabellagarcia commented on July 22, 2024

We will try to add headers to smartdamodels.org/context.jsonld

This context is no longer updated as long as now every subject has its own context.jsonld in the root of every subject.

Anyhow we will assess how to set the proper headers for this file.

from datamodel.gbfs.

pietercolpaert avatar pietercolpaert commented on July 22, 2024

Another solution would then be indeed to just not use https://smartdatamodels.org/context.jsonld in the examples and give each jsonld-file its own context!

from datamodel.gbfs.

albertoabellagarcia avatar albertoabellagarcia commented on July 22, 2024

We are reviewing all @context from all the data models' examples to include only the local @context (and we will reorder the payloads so they all look the same way)
It will take a while (some hours)

from datamodel.gbfs.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.